agentos-provider-openai-compat
AgentOS executor for any server that speaks the OpenAI chat-completions wire format:
Ollama (zero-config default), vLLM, LM Studio, OpenRouter, OpenAI. Plain httpx, no
vendor SDK — the wire format is the stable contract; a client library is not.
pip install -e . -e providers/openai-compat # from the AgentOS checkout
Registers the executor openai-compat through the agentos.executors entry point; the API
and worker discover it at startup and GET /executors shows it with a health check
(server reachable? aliases resolvable to models it actually has?).
Five-minute walkthrough with a local model: docs/quickstart-llm.md,
or python scripts/quickstart_llm.py against a running API.
Agent definition
{"name": "poet", "type": "llm", "executor": "openai-compat",
"config": {"model": "chat.fast",
"system": "You are a terse poet.",
"prompt": "Write a haiku about {run.topic}."}}
config key |
meaning | default |
|---|---|---|
model |
capability alias (chat.fast) or concrete id (gpt-4o-mini) |
chat.default |
system |
system prompt | none |
prompt |
user-message template; {run.x} = run inputs, {step.field} = upstream output |
inputs as JSON |
temperature / seed |
deterministic by default so cassettes replay | 0 / 42 |
max_tokens |
server default | |
json_output |
request a JSON object; parsed into output.json |
false |
Environment
| variable | default | notes |
|---|---|---|
AGENTOS_OPENAI_BASE_URL |
http://127.0.0.1:11434/v1 |
include /v1 |
AGENTOS_OPENAI_API_KEY |
unset (falls back to OPENAI_API_KEY) |
Ollama needs none |
AGENTOS_OPENAI_ALIASES |
{"chat.fast": "qwen2.5:0.5b", "chat.default": "llama3.2:3b"} |
JSON, merged over the defaults |
AGENTOS_OPENAI_PRICING |
bundled pricing.json |
content-addressed; hash on every step |
AGENTOS_OPENAI_TIMEOUT |
60 |
seconds |
AGENTOS_OPENAI_CASSETTES |
off |
replay / record (tests) |
AGENTOS_OPENAI_CASSETTE_DIR / AGENTOS_OPENAI_CASSETTE |
./cassettes / default |
A bad value raises ConfigError naming the variable; the API/worker log it and skip this
plugin rather than refusing to start.
What a step records
output: text, model (the id the server reports), alias, finish_reason, usage,
priced, and json when requested. cost: input_tokens, output_tokens, requests
meters, a Decimal amount, and pricing_snapshot_hash — the table's bytes are stored in
the BlobStore at startup (GET /blobs/{hash}). provenance: openai-compat, package
version, concrete model_id, model_alias, prompt_hash. Effects: compute only.
Aliases and substitution (§11 A3)
resolve(req) maps the alias to a concrete id without touching the network. If the
resolution for an agent changes during a run — alias re-pointed, model retired — the
engine appends executor.substituted{from, to, reason} before the next step. Completed
steps are never re-run.
Errors say what to do
| exception | when | message tells you |
|---|---|---|
ProviderUnreachable |
connection refused | ollama serve / check AGENTOS_OPENAI_BASE_URL |
ModelNotFound |
404 | ollama pull <id> or fix the alias |
AuthenticationFailed |
401/403 | set AGENTOS_OPENAI_API_KEY |
ProviderRateLimited / ProviderServerError |
429 / 5xx / timeout | the node's retry policy applies |
TemplateError |
{x.y} not in inputs |
the keys that are available |
BadResponse |
malformed body or non-JSON when json_output |
what came back |
The engine records each as step.failed → retries per the node's policy →
step.dead_lettered with the message as the cause.
Testing (§11 A10)
tests/ runs against cassettes recorded from a real Ollama (qwen2.5:0.5b, see each
file's source), never the network. tests/reference_server.py fakes specific status
codes. Re-record: python scripts/record_cassettes.py --live. The nightly
provider-live workflow installs Ollama on a
runner, re-records, and re-runs the replay tests on the fresh recordings. If that job fails
for 30 days this README gets a deprecated banner; the core is unaffected.
Status
0.1.0 — first provider plugin. MIT.
Metadata
Release files for agentos-provider-openai-compat 0.17.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agentos_provider_openai_compat-0.17.0.tar.gz | 13.3 kB | With provenance | Details for agentos_provider_openai_compat-0.17.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agentos_provider_openai_compat-0.17.0-py3-none-any.whl | Python 3 | none | any | Details for agentos_provider_openai_compat-0.17.0-py3-none-any.whl |
Total release size: 23.7 kB
Release files / agentos_provider_openai_compat-0.17.0.tar.gz
| Download URL | agentos_provider_openai_compat-0.17.0.tar.gz |
|---|---|
| Size | 13.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0abb95af19781e7fdbbf98b73048fc76aab310dff6890310b50f874bcdd96c95
|
|
BLAKE2b-256 checksum How to use checksums |
48929fc171275a457e20a7ea8ac123f7df4c128b2bfc6ea4fb37c1b8aab0007b
|
| 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 16, 2026.
Transparency logRelease files / agentos_provider_openai_compat-0.17.0-py3-none-any.whl
| Download URL | agentos_provider_openai_compat-0.17.0-py3-none-any.whl |
|---|---|
| Size | 10.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f1d3934fb81fd34c69b815c98f71f13db69dd3b96d776a3e2b43e5f12028f4d4
|
|
BLAKE2b-256 checksum How to use checksums |
44f599423cc364bc9b271336689fa5d8178f160cf40bd8457fa36e6d92a4fc99
|
| 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 16, 2026.
Transparency logSecurity for agentos-provider-openai-compat 0.17.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.
Attestation for agentos_provider_openai_compat-0.17.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 16, 2026.
Transparency logA 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.