Skip to main content

Fastest OpenAI client — Rust core with Python bindings

Project description

openai-oxide-python

Python bindings for openai-oxide — the fastest OpenAI client.

Rust core compiled to native Python extension via PyO3 + maturin.

Install (dev)

cd openai-oxide-python
uv sync
uv run maturin develop --release

Usage

import asyncio, json
from openai_oxide_python import Client

async def main():
    client = Client()  # reads OPENAI_API_KEY env var

    # Simple
    r = await client.create("gpt-5.4", "Hello!")
    print(json.loads(r)["text"])

    # Structured output
    schema = json.dumps({"type": "object", "properties": {"answer": {"type": "integer"}}, "required": ["answer"], "additionalProperties": False})
    r = await client.create_structured("gpt-5.4", "What is 7*8?", "math", schema)
    print(json.loads(json.loads(r)["text"])["answer"])  # 56

    # Function calling
    tools = json.dumps([{"name": "get_weather", "description": "Get weather", "parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"], "additionalProperties": False}}])
    r = await client.create_with_tools("gpt-5.4", "Weather in Tokyo?", tools)
    print(json.loads(r)["function_calls"])

asyncio.run(main())

Test

uv run python test_oxide.py

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

openai_oxide-0.9.3.tar.gz (454.8 kB view details)

Uploaded Source

Built Distributions

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

openai_oxide-0.9.3-cp314-cp314-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

openai_oxide-0.9.3-cp312-cp312-win_amd64.whl (2.8 MB view details)

Uploaded CPython 3.12Windows x86-64

openai_oxide-0.9.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

Details for the file openai_oxide-0.9.3.tar.gz.

File metadata

  • Download URL: openai_oxide-0.9.3.tar.gz
  • Upload date:
  • Size: 454.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for openai_oxide-0.9.3.tar.gz
Algorithm Hash digest
SHA256 e1400ddcf0bfb4f36e6d2e8241f2d4d19d9fbdbc3dae6afdc35f4ef872b3a561
MD5 2f39b5af9e10de008bfe9a35c6b43fef
BLAKE2b-256 eb4861c2d4d5c4b5be11310e220efc950ac5f9689accefb969ff016a72723097

See more details on using hashes here.

File details

Details for the file openai_oxide-0.9.3-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for openai_oxide-0.9.3-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1fca4c9029a23572ef2c2555ec49b37265b16731d4cae7d4809fe5310910ef33
MD5 3470d272c86b828f9448860c6434be01
BLAKE2b-256 a7bb2b2d10173e858720f916eb6ad90f3872568d0d6f6c306fe033aefe76f35a

See more details on using hashes here.

File details

Details for the file openai_oxide-0.9.3-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for openai_oxide-0.9.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 94e8c435943a22f812c55fe56b6a802613dbabb35f0845ec6547490b3804110a
MD5 96095df1256b73f0677ce5e0ca2e8fb5
BLAKE2b-256 97b1cb05b3c857699ae98437f8019a8b78086e57a4c180ca915b09d1bcd385a1

See more details on using hashes here.

File details

Details for the file openai_oxide-0.9.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for openai_oxide-0.9.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 110c7817708880516da96c09ecc89023c0a8d71254968eee06406bd4d8a16534
MD5 d6ee43d5e978cc3f6391523a3ffbaaa5
BLAKE2b-256 6d05eb67ab25b68a30300d65c15bddd3488597c11f0591f31c518e81c5a57746

See more details on using hashes here.

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