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.6.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.6-cp314-cp314-macosx_11_0_arm64.whl (2.5 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

openai_oxide-0.9.6-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.6.tar.gz.

File metadata

  • Download URL: openai_oxide-0.9.6.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.6.tar.gz
Algorithm Hash digest
SHA256 ccb58628bd37d45c4c5fb9e6afbbe48801da162843b0e8e2b76054d3856392c4
MD5 2f659df86ce59e3aa3617662f9e2933e
BLAKE2b-256 fd9fd933cc2e8a3d2362fa556c9bc24fb25d9735f8e6db5939941d8ae2d55c19

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openai_oxide-0.9.6-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 35f590eed028a604ad68b91f5f5b5f5fb40314a168ae6ef518c29f19ea1992ef
MD5 56f8d1ef7f7274d9123dda00b199a1f8
BLAKE2b-256 b4cc7e0a4364756171463e123b5d73224fe42865e6e271ebfd7098245b02389c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openai_oxide-0.9.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 2da0354978ce610ebf5d29587c4a575ae3553c37e316c1b952d78042a2ef8e0f
MD5 ceadb655970a73c202460d2ff06e7cae
BLAKE2b-256 1a6fbe8698d53ba493f133bbcea2fb29c2da096e8bcabaad24f5e163fec5d257

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openai_oxide-0.9.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e7f8c05dd0112f22253aa7488660fa6ca64862534d5477262362b0f13b237c73
MD5 52ce0ca9376a39d1c949b598e16d656d
BLAKE2b-256 59a87941b407fbaa8e58a20b15ade45ef90c0846778bb61ab285c4f070aac0ff

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