omp packages

pi-axonhub0.2.0

Auto-discover models from AxonHub API and register custom AxonHub provider for Pi coding agent

chenastron Published 27 days ago MIT ~183 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

pi-axonhub

npm version License: MIT

An extension package for Pi Coding Agent that automatically discovers available LLM models from an axonhub endpoint and registers the lowercase axonhub model provider.

Features

  • Auto Model Discovery: Queries the axonhub /models endpoint on startup and dynamically maps context windows, output limits, reasoning capability, pricing, and input modalities (text/image).
  • Safe Failure Handling & Timeout: Built-in 10-second fetch timeout (configurable) to prevent Pi startup hangs. If the endpoint is unreachable, cleanly warns and skips registration without polluting the model catalog.
  • Session & Turn Tracing: Automatically injects AH-Thread-Id (matching Pi's session ID) and AH-Trace-Id (scoped per user prompt and sub-agent run) into outgoing requests for AxonHub observability and trace-sticky prompt caching.
  • Dedicated Configuration: Configured cleanly via ~/.pi/agent/extensions/pi-axonhub/config.json.

Installation

Install using pi install:

pi install npm:pi-axonhub

Or from GitHub:

pi install git:github.com/Chenastron/pi-axonhub

To test without permanently installing:

pi -e npm:pi-axonhub

Configuration

Create or edit the configuration file at ~/.pi/agent/extensions/pi-axonhub/config.json:

{
  "baseUrl": "http://192.168.10.6:8090/v1",
  "apiKey": "ah-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "timeoutMs": 10000
}

Configuration Fields

Field Type Required Description
baseUrl string Yes The AxonHub API endpoint (e.g. http://your-server:8090/v1). If omitted, the extension will output a warning and skip registration.
apiKey string No Your AxonHub API key. If omitted, falls back to stored credentials in ~/.pi/agent/auth.json.
timeoutMs number No Timeout for the /models discovery request in milliseconds (default: 10000).

Development & Testing

Run unit tests:

npm test

Test directly with Pi:

pi -e . --list-models

License

MIT