Skip to main content

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

    • Optional: For browser automation (13 additional tools): pip install patchpal[browser] && python -m playwright install chromium
  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 - set OLLAMA_CONTEXT_LENGTH and PATCHPAL_CONTEXT_LIMIT to the same window)
export OLLAMA_CONTEXT_LENGTH=16384 # or set the context length in the Ollama app's Settings
PATCHPAL_CONTEXT_LIMIT=16384 patchpal --model ollama_chat/gemma4:e4b

# 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) work best with these settings:

  • Always: set PATCHPAL_CONTEXT_LIMIT to your served window (e.g., 32768 to match OLLAMA_CONTEXT_LENGTH=32768, or 16384 on resource-constrained machines). PatchPal can't detect it from the server. At 64K or less, PatchPal uses TinyAgent, which includes minimal tools plus small-window compaction and reading.
  • Model with function calling, window over 64K: PATCHPAL_MINIMAL_TOOLS=true limits tools to read_file, read_lines, write_file, edit_file, run_shell, reducing tool confusion.
  • Model without function calling: PATCHPAL_REACT_MODE=true enables text-based tool invocation (see ReAct mode docs).
  • Ollama: PATCHPAL_STREAM_OUTPUT=false may help with tool call reliability.
  • Offline: PATCHPAL_ENABLE_WEB=false disables web tools.

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.

I noticed there's another package called PatchPal on GitLab. Are they related?

No, they're separate projects. The project with the same name on GitLab is unrelated to this one.

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.

Metadata

Release files for patchpal 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for patchpal 1.0.0
File Size Uploaded Provenance Actions
patchpal-1.0.0.tar.gz 269.1 kB With provenance Details for patchpal-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for patchpal 1.0.0
File Interpreter ABI Platform Actions
patchpal-1.0.0-py3-none-any.whl Python 3 none any Details for patchpal-1.0.0-py3-none-any.whl

Total release size: 479.4 kB

Release files / patchpal-1.0.0.tar.gz

Download URL patchpal-1.0.0.tar.gz
Size 269.1 kB
Tags Source
SHA-256 checksum
How to use checksums
65b53e01395384df11e02a7d20650e3dfb34ffb8b4a6f5d26f34a132e234e924
BLAKE2b-256 checksum
How to use checksums
2ad5afef89952179384107f6f47fde9d114f105e005113aedd9e31532dca093b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / patchpal-1.0.0-py3-none-any.whl

Download URL patchpal-1.0.0-py3-none-any.whl
Size 210.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ba7358be09a264ca8258f59053e0a9302ec6e4b611c09502994100e748b36b7b
BLAKE2b-256 checksum
How to use checksums
975f56d4ff7a017bbbe92994d000c33bfc676953cd9836ce4cb08d595aadb03b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Security for patchpal 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for patchpal-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page