Installable CLI for running llama-server in the background and using Aider against it.
Project description
Patchforge
This repo now ships an installable CLI that wraps:
llama-serverfor a local OpenAI-compatible endpointaider-chatfor file editing against that local model
The binary name is patchforge.
Install
Install the package into a tool environment:
uv tool install .
Or into a project virtualenv:
python3 -m venv .venv
./.venv/bin/pip install -e .
aider-chat is installed as a package dependency. Then bootstrap the native side:
patchforge install
patchforge install chooses the best local installation path it can find:
- Reuse an existing
llama-serverif one is already onPATH - Otherwise, on macOS, prefer Homebrew and install
llama.cpp - After that, prefetch the default GGUF models into the llama.cpp cache
Usage
Start the local model server in the background:
patchforge start
Check whether it is up:
patchforge status
Run Aider against that endpoint:
patchforge aider --yes-always --message "Create hello.txt with a short greeting."
You can also let the CLI ensure the server is running first:
patchforge aider --ensure-server --yes-always --message "Create hello.txt with a short greeting."
Stop the managed background server:
patchforge stop
Inspect the local /v1/models endpoint:
patchforge models
Defaults
- Host:
127.0.0.1 - Port:
8091 - Model alias:
gemma-local - Default models: cached
gemma-2-9b-itfirst, then cachedgemma-4-E4B-it - Runtime state:
.patchforge/under the current project
Overrides
These environment variables are supported:
LLAMA_HOST=127.0.0.1
LLAMA_PORT=8095
LLAMA_MODEL_ALIAS=my-local-model
LLAMA_MODEL_PATH=/absolute/path/to/model.gguf
LLAMA_CTX_SIZE=8192
LLAMA_PARALLEL=1
OPENAI_API_KEY=sk-local
You can also pass the same values as CLI flags such as --port, --model-alias, and --model-path.
If you want to force the Homebrew path explicitly:
patchforge install --installer brew --force-install
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file patchforge-0.1.0.tar.gz.
File metadata
- Download URL: patchforge-0.1.0.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
748efc281c11697ebab7b524e089419c21af9d6173f1329f51eb2c69667e9094
|
|
| MD5 |
1dbbb2691ece28ab18a60e3a5619d8a8
|
|
| BLAKE2b-256 |
fd173512af0cc198e61498d6d3fb92206e7aadee0a0046eecf11219bd21b9a4c
|
File details
Details for the file patchforge-0.1.0-py3-none-any.whl.
File metadata
- Download URL: patchforge-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aab9f2f9d324a10756e90dbd913c16a66713e5fe6d611aed2e46241878c813c2
|
|
| MD5 |
93224059fcae215d79030d6eee8de66b
|
|
| BLAKE2b-256 |
0f5cf5394a055c53cc8ec72152ff65ca525862a9c28bd9ade9bdd78fa29a1af9
|