Skip to main content

Sync Pi coding agent models.json with models served by a vLLM/llama.cpp server

Project description

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

Project details


Download files

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

Source Distribution

pi_codingagent_sync-0.1.0.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

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

pi_codingagent_sync-0.1.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file pi_codingagent_sync-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for pi_codingagent_sync-0.1.0.tar.gz
Algorithm Hash digest
SHA256 66ca3525f542975995b6cf7cd5c481be68071c8dc1378b1bdd80deefec9ad15c
MD5 ba93b044e6296d438be78021878a44e6
BLAKE2b-256 bff723b519fac72e43ea7a478dc4abb3cd315360413d6772ec2899466c041979

See more details on using hashes here.

Provenance

The following attestation bundles were made for pi_codingagent_sync-0.1.0.tar.gz:

Publisher: release.yml on ozskywalker/pi-sync

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

File details

Details for the file pi_codingagent_sync-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pi_codingagent_sync-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aefa358082b2edb83628ff013c846039b3b6357fa45dd851e11a69e3e6e59cde
MD5 3d43fa23af48e3d37264f54ebc2a4adf
BLAKE2b-256 0a75aaa143a2cee6bac47f5a403f984f985cbed56201fbba892a7297211d523a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pi_codingagent_sync-0.1.0-py3-none-any.whl:

Publisher: release.yml on ozskywalker/pi-sync

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