Skip to main content

An agentic coding and automation assistant, supporting both local and cloud LLMs

Project description

PatchPal — An Agentic Coding and Automation Assistant

PatchPal Screenshot

Supporting both local and cloud LLMs, with autopilot mode and extensible tools.

PatchPal is an AI coding agent that helps you build software, debug issues, and automate tasks. It supports agent skills, tool use, and executable Python generation, enabling interactive workflows for tasks such as data analysis, visualization, web scraping, API interactions, and research with synthesized findings.

Most agent frameworks are built in TypeScript. PatchPal is Python-native, designed for developers who want both interactive terminal use (patchpal) and programmatic API access (agent.run("task")) in the same tool—without switching ecosystems.

Key Features

PatchPal prioritizes customizability: custom tools, custom skills, a flexible Python API, and support for any tool-calling LLM.

Full documentation is here.

Quick Start

$ pip install patchpal          # install
$ patchpal --model <model_id>   # start

Model support: Any LiteLLM-supported model can be used. Platform support: Linux, macOS, and Windows are all supported

Alternative: Run with Docker/Podman (no installation required)

# Using pre-built image with patchpal installed (default model)
docker run -it --rm \
  -v $(pwd):/workspace \
  -e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY \
  ghcr.io/amaiya/patchpal-sandbox:latest \
  patchpal --model anthropic/claude-sonnet-4-5

# Or with Podman
podman run -it --rm \
  -v $(pwd):/workspace \
  -e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY \
  ghcr.io/amaiya/patchpal-sandbox:latest \
  patchpal --model anthropic/claude-sonnet-4-5

# Specify a different model
docker run -it --rm \
  -v $(pwd):/workspace \
  -e OPENAI_API_KEY=$OPENAI_API_KEY \
  ghcr.io/amaiya/patchpal-sandbox:latest \
  patchpal --model openai/gpt-5-mini

Setup

  1. Install: pip install patchpal

  2. Get an API key or a Local LLM Engine:

  3. Set up your API key as environment variable:

# For Anthropic (default)
export ANTHROPIC_API_KEY=your_api_key_here

# For OpenAI
export OPENAI_API_KEY=your_api_key_here

# For vLLM - API key required only if configured
export HOSTED_VLLM_API_BASE=http://localhost:8000 # depends on your vLLM setup
export HOSTED_VLLM_API_KEY=token-abc123           # optional depending on your vLLM setup

# For Ollama, no API key required

# For other providers, check LiteLLM docs
  1. Run PatchPal:
# Use default model (anthropic/claude-sonnet-4-5)
patchpal

# Use a specific model via command-line argument
patchpal --model openai/gpt-5.2-codex  # or openai/gpt-5-mini, anthropic/claude-opus-4-5, etc.

# Use vLLM (local)
# Note: vLLM server must be started with --tool-call-parser and --enable-auto-tool-choice
export HOSTED_VLLM_API_BASE=http://localhost:8000
export HOSTED_VLLM_API_KEY=token-abc123
patchpal --model hosted_vllm/openai/gpt-oss-120b

# Use Ollama (local - requires OLLAMA_CONTEXT_LENGTH=32768)
export OLLAMA_CONTEXT_LENGTH=32768
patchpal --model ollama_chat/gpt-oss:120b

# Or set the model via environment variable
export PATCHPAL_MODEL=openai/gpt-5.2
patchpal

Tip for Local Models: Local models (i.e., models served by Ollama or vLLM) may work better with these settings:

  • PATCHPAL_MINIMAL_TOOLS=true and PATCHPAL_ENABLE_WEB=false - For models with function calling: Provides only essential tools (read_file, read_lines, write_file, edit_file, run_shell), reducing tool confusion
  • PATCHPAL_REACT_MODE=true - For models without function calling: Enables text-based tool invocation (see ReAct mode docs)
  • For Ollama, additionally setting PATCHPAL_STREAM_OUTPUT=false may help with tool call reliability

Beyond Coding: General Problem-Solving

While originally designed for software development, PatchPal is also a general-purpose assistant. With web search, file operations, shell commands, and custom tools/skills, it can help with research, data analysis, document processing, log file analyses, etc.

PatchPal as General Assistant

FAQ

There are so many coding agent harnesses. Why build yet another one?

  1. Most agent harnesses are in TypeScript. We wanted something in Python that we could easily extend for our custom workflows.
  2. PatchPal includes a unique guardrails system that is better suited to privacy-conscious use cases involving sensitive data.
  3. We needed an agent harness that seamlessly works with both local and cloud models, including AWS GovCloud Bedrock models.

On Windows Subsystem for Linux (WSL), why is it stalling intermittently at "Thinking..."?

This is a known issue with WSL2.

Try examining and then lowering the mtu:

$ cat /sys/class/net/eth1/mtu
1427

$ sudo ip link set eth1 mtu 1400

Documentation

Full documentation is available here.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

patchpal-0.23.0.tar.gz (212.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

patchpal-0.23.0-py3-none-any.whl (171.3 kB view details)

Uploaded Python 3

File details

Details for the file patchpal-0.23.0.tar.gz.

File metadata

  • Download URL: patchpal-0.23.0.tar.gz
  • Upload date:
  • Size: 212.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for patchpal-0.23.0.tar.gz
Algorithm Hash digest
SHA256 5663bac600e4bd4710f82062a0c4f6d025ae0ec2853ce914d19803a79ef44165
MD5 884b1370e919e669fc0f8f8c477b714f
BLAKE2b-256 6cf7cf20268bee2e1626003699d2fb5e4cad22c273a3e0ab6e5702f4e7df5bbe

See more details on using hashes here.

Provenance

The following attestation bundles were made for patchpal-0.23.0.tar.gz:

Publisher: release.yml on amaiya/patchpal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file patchpal-0.23.0-py3-none-any.whl.

File metadata

  • Download URL: patchpal-0.23.0-py3-none-any.whl
  • Upload date:
  • Size: 171.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for patchpal-0.23.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cde11f1fc49951f0e9735cb96c49f6bff52d426a89504bc2639feceb8b0315d5
MD5 7c2cf7c308dd9a9fc6514e11ca6af347
BLAKE2b-256 edb7f9ac4efaebaf6621fa95626d13edb30e2337bf72adbbfd5cc23ac7ed1691

See more details on using hashes here.

Provenance

The following attestation bundles were made for patchpal-0.23.0-py3-none-any.whl:

Publisher: release.yml on amaiya/patchpal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page