Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

onnx-genai

ONNX Runtime-backed text generation for Python.

onnx-genai exposes a small, high-level generation API implemented on ONNX Runtime. It is the ONNX Runtime-compatible counterpart of nxrt.genai: both packages present the same Engine / GenerateResult API, but onnx_genai runs on ONNX Runtime while nxrt.genai runs on the native nxrt runtime.

import onnx_genai

engine = onnx_genai.Engine.from_dir("path/to/model_dir")

result = engine.generate("Hello, world!", max_tokens=64, temperature=0.8)
print(result.text)

# Streaming
def on_token(text, token_id, finish_reason):
    print(text, end="", flush=True)

engine.generate_stream("Tell me a story", on_token, max_tokens=128)

The model directory must contain the ONNX graph(s), tokenizer.json, and model metadata (inference_metadata.yaml or genai_config.json).

Wheels

Distributed as stable-ABI (abi3) wheels tagged cp310-abi3, so a single wheel per platform loads on CPython 3.10 and newer. ONNX Runtime is not bundled: onnx_genai loads libonnxruntime from the installed onnxruntime (CPU) or onnxruntime-gpu (CUDA) wheel at import time, so it uses whichever execution providers you installed.

Related packages

  • nxrt — the low-level nxrt runtime (inference sessions, eager ops) plus nxrt.genai, the same generation API backed by the native runtime.
  • onnx-genai-server — the onnx-genai command-line tool, including the OpenAI-compatible server (onnx-genai serve).

See https://github.com/justinchuby/onnx-genai.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

onnx_genai-0.1.0.dev6.tar.gz (12.8 MB view details)

Uploaded Source

Built Distributions

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

onnx_genai-0.1.0.dev6-cp310-abi3-win_arm64.whl (8.8 MB view details)

Uploaded CPython 3.10+Windows ARM64

onnx_genai-0.1.0.dev6-cp310-abi3-win_amd64.whl (10.0 MB view details)

Uploaded CPython 3.10+Windows x86-64

onnx_genai-0.1.0.dev6-cp310-abi3-manylinux_2_28_x86_64.whl (10.0 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ x86-64

onnx_genai-0.1.0.dev6-cp310-abi3-macosx_11_0_arm64.whl (8.5 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file onnx_genai-0.1.0.dev6.tar.gz.

File metadata

  • Download URL: onnx_genai-0.1.0.dev6.tar.gz
  • Upload date:
  • Size: 12.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for onnx_genai-0.1.0.dev6.tar.gz
Algorithm Hash digest
SHA256 12f9b54a42b7f7cbf4dd11e60253a3cba2c28aab7443d667e2bb48984c44ed4c
MD5 8b165ee7f4a92700b2c2d6411c7abf2e
BLAKE2b-256 24d7ffd103c744961d317eef59016a1441006c4a41cea0105b16830e12103ff3

See more details on using hashes here.

Provenance

The following attestation bundles were made for onnx_genai-0.1.0.dev6.tar.gz:

Publisher: publish.yml on justinchuby/onnx-genai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file onnx_genai-0.1.0.dev6-cp310-abi3-win_arm64.whl.

File metadata

File hashes

Hashes for onnx_genai-0.1.0.dev6-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 33c462064ade56210db33840d15efc61d01eb99c9403e0b1bf115e285041a78f
MD5 2674d92a1fbd558c5c42a4066ca522fd
BLAKE2b-256 8d75df47a2e90eaf222f9e4b5ee0558da1292411baf2c3b7b10e32acd6c93421

See more details on using hashes here.

Provenance

The following attestation bundles were made for onnx_genai-0.1.0.dev6-cp310-abi3-win_arm64.whl:

Publisher: publish.yml on justinchuby/onnx-genai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file onnx_genai-0.1.0.dev6-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for onnx_genai-0.1.0.dev6-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 60686a410fc0edf0721af4f86c0df0f7432da3ae4c7477a7b925fa92faf51c18
MD5 b1800753a5045607c74711a7ee292210
BLAKE2b-256 7a788baf984e69c612fad4cf48ffb9d70dbed14bcc13cff0e25e40e10dbcd7e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for onnx_genai-0.1.0.dev6-cp310-abi3-win_amd64.whl:

Publisher: publish.yml on justinchuby/onnx-genai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file onnx_genai-0.1.0.dev6-cp310-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for onnx_genai-0.1.0.dev6-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ea27400c4bd51b6c2daa26e073f959d6c00665070e8fe0c7a3dbcfe50de21d4e
MD5 c8a422f49aa47336e16450199acf59e5
BLAKE2b-256 5019b66bfc0b8abf478d3c92dd3603eb7de0d8f1370d29632ee4df7621023e49

See more details on using hashes here.

Provenance

The following attestation bundles were made for onnx_genai-0.1.0.dev6-cp310-abi3-manylinux_2_28_x86_64.whl:

Publisher: publish.yml on justinchuby/onnx-genai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file onnx_genai-0.1.0.dev6-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for onnx_genai-0.1.0.dev6-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ed77d07a22f2d0265d89fdd5c857f3fd4f9df20d8f499d044cc121638cf959ab
MD5 6b85529453cb4894f674a242d385766c
BLAKE2b-256 28fbca1e715daf32663c5ae159f82adf4efa2e9afa71510d84da5ed5aa676ce0

See more details on using hashes here.

Provenance

The following attestation bundles were made for onnx_genai-0.1.0.dev6-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: publish.yml on justinchuby/onnx-genai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0.dev6 This release

5 files

0.0.0

1 file

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