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.5.tar.gz (459.6 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.5-cp314-cp314-macosx_11_0_arm64.whl (2.5 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

openai_oxide-0.9.5-cp312-cp312-win_amd64.whl (2.3 MB view details)

Uploaded CPython 3.12Windows x86-64

openai_oxide-0.9.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

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

File metadata

  • Download URL: openai_oxide-0.9.5.tar.gz
  • Upload date:
  • Size: 459.6 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.5.tar.gz
Algorithm Hash digest
SHA256 ab75fe6f9489085b366481608298e17743294b7801e9c79979340fc06789eac0
MD5 56f96090811d24d26b732ee2fb8e69a1
BLAKE2b-256 e61a7d707515dadeb8dbcc28fcf735982a9680296ec6f818b187a335f9d297ed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openai_oxide-0.9.5-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 68a14718b812603436fb07e3739a97cf9b710719ba1283ba28228d9ca914cfb9
MD5 fedb3f3e6d866ad9a98c013eb384aa8b
BLAKE2b-256 8fd99118f7c01c93b763286436fb25961fb4c5381371aee41106c0cfec935bc8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openai_oxide-0.9.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 13b9855ba7e0a2d483a16c3e9fb84b99e88f3ec493f23596db94b9e717131768
MD5 cc19b2bdc17fc865b30c13cfeb776cdd
BLAKE2b-256 6888ac46a60e3bd815cd6c2a86b847da1ae532008df5e36305205ad5fbbd84ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openai_oxide-0.9.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c6bbb7e68b79be6af4e9f67b464d0b6daf114bce2de36e530fed28e3f6c7442b
MD5 5fbafcbb1597ba0bf391db78c2701948
BLAKE2b-256 e9eade3afe50fd68a5af84b0c0d0540fc56ba62c2ec223113461b1d98eeb4df3

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