OpenAI-compatible transport for Axio
Project description
axio-transport-openai
OpenAI-compatible streaming transport for axio.
Works with any API that speaks the OpenAI chat completions format — OpenAI itself, Azure OpenAI, local models via Ollama/vLLM/LM Studio, and compatible cloud providers.
Features
- Full SSE streaming — parses
data:chunks incrementally; no waiting for full responses - Automatic retry — configurable backoff on transient HTTP errors
- Tool calling — streams tool-use JSON fragments as
ToolInputDeltaevents - aiohttp-based — zero blocking I/O
- Optional TUI settings screen — install with
[tui]extra for a Textual configuration UI
Installation
pip install axio-transport-openai
With TUI settings screen:
pip install "axio-transport-openai[tui]"
Usage
from axio import Agent
from axio.context import MemoryContextStore
from axio_transport_openai import OpenAITransport
transport = OpenAITransport(
api_key="sk-...",
model="gpt-4o-mini",
base_url="https://api.openai.com/v1", # default; override for local models
max_tokens=4096,
)
agent = Agent(system="You are a helpful assistant.", tools=[], transport=transport)
async def main() -> None:
ctx = MemoryContextStore()
result = await agent.run("What is 2 + 2?", ctx)
print(result)
Local models (Ollama, vLLM, LM Studio)
transport = OpenAITransport(
api_key="ollama", # any non-empty string
model="llama3.2",
base_url="http://localhost:11434/v1",
)
Streaming events
from axio.events import TextDelta, SessionEndEvent
async for event in agent.run_stream("Tell me a joke", ctx):
match event:
case TextDelta(delta=text):
print(text, end="", flush=True)
case SessionEndEvent(total_usage=usage):
print(f"\n[{usage.input_tokens}in / {usage.output_tokens}out tokens]")
Plugin registration
When installed, this package registers itself via entry points so axio-tui discovers it automatically:
[project.entry-points."axio.transport"]
openai = "axio_transport_openai:OpenAITransport"
Part of the axio ecosystem
axio · axio-transport-nebius · axio-transport-codex · axio-tui
License
MIT
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 axio_transport_openai-0.3.3.tar.gz.
File metadata
- Download URL: axio_transport_openai-0.3.3.tar.gz
- Upload date:
- Size: 100.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
780260039c5c5a3266141bcd2f1a06fd8e57184217a6522fd8dee1c15374a487
|
|
| MD5 |
76ab034be47d7d2c0cb3f2641529f7e1
|
|
| BLAKE2b-256 |
37463d1f1bb4258a4d08d168d9c42c0691afdc60baeff411e2fc4fb28b8a3281
|
Provenance
The following attestation bundles were made for axio_transport_openai-0.3.3.tar.gz:
Publisher:
publish.yml on axio-agent/monorepo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
axio_transport_openai-0.3.3.tar.gz -
Subject digest:
780260039c5c5a3266141bcd2f1a06fd8e57184217a6522fd8dee1c15374a487 - Sigstore transparency entry: 1208265671
- Sigstore integration time:
-
Permalink:
axio-agent/monorepo@b96d4335b3d5a0fe0b154d4188d2d02ef1312aac -
Branch / Tag:
refs/tags/0.3.3 - Owner: https://github.com/axio-agent
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b96d4335b3d5a0fe0b154d4188d2d02ef1312aac -
Trigger Event:
release
-
Statement type:
File details
Details for the file axio_transport_openai-0.3.3-py3-none-any.whl.
File metadata
- Download URL: axio_transport_openai-0.3.3-py3-none-any.whl
- Upload date:
- Size: 20.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee94b97d01ebe28c6c77015b1747d719f8147126b78cbfd5e8c4ef104f2a7164
|
|
| MD5 |
7506e628d22882cd030b6c6fb2612029
|
|
| BLAKE2b-256 |
5ef7bcb185b40073b0951fe9cd698c30fa76ab3b2d4452c19766d00987e927ea
|
Provenance
The following attestation bundles were made for axio_transport_openai-0.3.3-py3-none-any.whl:
Publisher:
publish.yml on axio-agent/monorepo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
axio_transport_openai-0.3.3-py3-none-any.whl -
Subject digest:
ee94b97d01ebe28c6c77015b1747d719f8147126b78cbfd5e8c4ef104f2a7164 - Sigstore transparency entry: 1208265815
- Sigstore integration time:
-
Permalink:
axio-agent/monorepo@b96d4335b3d5a0fe0b154d4188d2d02ef1312aac -
Branch / Tag:
refs/tags/0.3.3 - Owner: https://github.com/axio-agent
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b96d4335b3d5a0fe0b154d4188d2d02ef1312aac -
Trigger Event:
release
-
Statement type: