Skip to main content

pi-sync

Keep Pi coding agent's models.json in sync with your local vLLM or llama.cpp llama-server.

pi-sync queries GET /v1/models, updates ~/.pi/agent/models.json, and preserves existing model metadata for IDs that are still served. If models.json does not exist, it creates a local llama-cpp provider using the OpenAI-compatible completions API.

Install

pip install pi-codingagent-sync

For local development:

pip install -e .

Usage

Sync against the URL already in models.json, or create the default local config:

pi-sync

Point at a specific server and update the stored URL:

pi-sync --host 127.0.0.1 --port 8080

pi-sync also respects llama.cpp's server target environment variables:

LLAMA_ARG_HOST=127.0.0.1 LLAMA_ARG_PORT=8080 pi-sync

Target precedence is:

Source Server queried baseUrl in config
pi-sync Existing baseUrl (fallback: localhost:8080) Unchanged
LLAMA_ARG_HOST=X pi-sync http://X:8080/v1 Updated
LLAMA_ARG_HOST=X LLAMA_ARG_PORT=9000 pi-sync http://X:9000/v1 Updated
pi-sync --host X http://X:8080/v1 Updated
pi-sync --host X --no-url-update http://X:8080/v1 Unchanged

CLI --host/--port values override LLAMA_ARG_HOST/LLAMA_ARG_PORT.

Preview changes without writing:

pi-sync --dry-run

Auto-sync on every Pi launch

Install the wrapper once:

pi-sync install

This writes ~/.local/bin/pi, which runs pi-sync silently and then execs the real pi binary. Make sure ~/.local/bin appears earlier in PATH than the real Pi binary.

Default Config

When creating a new config, pi-sync starts with:

{
  "providers": {
    "llama-cpp": {
      "baseUrl": "http://localhost:8080/v1",
      "api": "openai-completions",
      "apiKey": "llama",
      "compat": {
        "supportsDeveloperRole": false,
        "supportsReasoningEffort": false
      },
      "models": [
        {
          "id": "qwen3-coder-local",
          "name": "Qwen local via llama-server",
          "input": ["text"],
          "contextWindow": 32768,
          "maxTokens": 8192
        }
      ]
    }
  }
}

Options

pi-sync [--host HOST] [--port PORT] [--provider ID] [--config PATH]
        [--dry-run] [--no-url-update] [--timeout SECONDS]

The default config path is $PI_CODING_AGENT_DIR/models.json, or ~/.pi/agent/models.json when PI_CODING_AGENT_DIR is unset.

Flag Default Description
--host HOST env, config, else localhost vLLM server hostname
--port PORT env, config, else 8080 vLLM server port
--provider ID auto-detect Provider key to update
--config PATH auto-detect Path to Pi models.json
--dry-run off Show changes without writing
--no-url-update off Query the target without updating stored baseUrl
--timeout SECONDS 10 HTTP request timeout

Development

pip install -e ".[dev]"
python -m pytest

Metadata

Release files for pi-codingagent-sync 0.1.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 pi-codingagent-sync 0.1.0
File Size Uploaded Provenance
pi_codingagent_sync-0.1.0.tar.gz 12.5 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pi-codingagent-sync 0.1.0
File Interpreter ABI Platform
pi_codingagent_sync-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 24.2 kB

Release files / pi_codingagent_sync-0.1.0.tar.gz

Download URL pi_codingagent_sync-0.1.0.tar.gz
Size 12.5 kB
Tags Source
SHA-256 checksum
How to use checksums
66ca3525f542975995b6cf7cd5c481be68071c8dc1378b1bdd80deefec9ad15c
BLAKE2b-256 checksum
How to use checksums
bff723b519fac72e43ea7a478dc4abb3cd315360413d6772ec2899466c041979
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 30, 2026.

Transparency log

Release files / pi_codingagent_sync-0.1.0-py3-none-any.whl

Download URL pi_codingagent_sync-0.1.0-py3-none-any.whl
Size 11.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aefa358082b2edb83628ff013c846039b3b6357fa45dd851e11a69e3e6e59cde
BLAKE2b-256 checksum
How to use checksums
0a75aaa143a2cee6bac47f5a403f984f985cbed56201fbba892a7297211d523a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 30, 2026.

Transparency log

Security for pi-codingagent-sync 0.1.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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pi_codingagent_sync-0.1.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 May 30, 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.

Release history Release notifications | RSS feed

This release

0.1.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