Skip to main content

oxa — Python Reference Implementation

Pure, in-process protocol-conversion library for OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages in Python.

Like the Go and Rust implementations, oxa in Python is not a proxy, HTTP client, router, retry layer, authentication service, or model capability database. It provides deterministic, pure conversions between protocol wire structures and oxa's shared Intermediate Representation (IR).

Architecture

  • Hub-and-spoke: Spoke packages (oxa.openai.chatcompletions, oxa.openai.responses, oxa.anthropic.messages) implement only face → IR and IR → face. No direct face-to-face conversions.
  • Zero runtime dependencies: Pure Python standard library only (dataclasses, typing, json, enum, etc.).
  • Opaque tool inputs (INV-1): Tool call arguments and streaming delta fragments remain unparsed raw JSON text.
  • Shared Golden Vectors: Conforms to the exact same shared vectors/ golden suite as Go and Rust.

Installation

pip install elkpi-oxa

Import in Python:

import oxa
from oxa.openai.chatcompletions import decode_request

Development

The project uses uv for development and environment management:

cd python

# Sync virtualenv and development dependencies
uv sync

# Run tests
uv run pytest

# Type check
uv run mypy

# Lint & format check
uv run ruff check .
uv run ruff format --check .

Vectors Location Convention

Test harnesses locate the shared vectors/ suite by walking up parent directories from python/ until finding a directory containing both vectors/ and .git/. Tests skip cleanly if the repository root is absent (e.g. when building a standalone package archive).

Release files for elkpi-oxa 2.0.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 elkpi-oxa 2.0.0
File Size Uploaded
elkpi_oxa-2.0.0.tar.gz 60.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for elkpi-oxa 2.0.0
File Interpreter ABI Platform
elkpi_oxa-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 130.6 kB

Release files / elkpi_oxa-2.0.0.tar.gz

Download URL elkpi_oxa-2.0.0.tar.gz
Size 60.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b135995d1b9822221161fdb99dd52b93d58dd6bfa8ac8cdccf78e1acf1dce173
BLAKE2b-256 checksum
How to use checksums
fc21bd2db59365effc5b3824e42ca9e59d7a2b365948166ff5dfa87fd3332072
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / elkpi_oxa-2.0.0-py3-none-any.whl

Download URL elkpi_oxa-2.0.0-py3-none-any.whl
Size 70.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fc52a74048a6571aa27607666a408fe03538c75e1f44e8d5f5012948fe30f879
BLAKE2b-256 checksum
How to use checksums
77bcc0cd63b23de19a9a49bf0858bddcadc9b919112f892ad584b5132e49955a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

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