harmony  by openai

Renderer for OpenAI's harmony response format

created 2 weeks ago

New!

3,464 stars

Top 14.0% on SourcePulse

GitHubView on GitHub
Project Summary

This repository provides the openai-harmony library, a Rust-backed tool for formatting and parsing conversations for OpenAI's open-weight models (gpt-oss). It ensures consistent, loss-free token sequences for structured outputs, tool calling, and multi-channel reasoning, primarily targeting developers building custom inference solutions for these models.

How It Works

The core logic resides in Rust, leveraging tiktoken for tokenization and pyo3 for Python bindings. This approach ensures high performance for rendering and parsing conversation structures, mimicking the OpenAI Responses API. The library supports multiple channels (e.g., analysis, commentary, final) and structured tool calls within a unified format.

Quick Start & Requirements

  • Installation: pip install openai-harmony
  • Prerequisites: Python ≥ 3.8. Rust toolchain recommended for development.
  • Documentation: gpt-oss, harmony format guide

Highlighted Details

  • Implements a consistent, loss-free response format for gpt-oss models.
  • Heavy lifting performed in Rust for performance.
  • First-class Python support with typed stubs and 100% test parity.
  • Supports structured tool calling and multi-channel reasoning.

Maintenance & Community

The project is maintained by OpenAI. Development is primarily in Rust with Python bindings.

Licensing & Compatibility

The repository does not explicitly state a license in the provided README snippet. Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

The README implies that gpt-oss models must be used with the Harmony format to function correctly. No specific limitations or known issues are detailed.

Health Check
Last commit

3 days ago

Responsiveness

Inactive

Pull Requests (30d)
32
Issues (30d)
28
Star History
3,491 stars in the last 16 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Shawn Wang Shawn Wang(Editor of Latent Space), and
10 more.

llm by rustformers

0.0%
6k
Rust ecosystem for LLM Rust inference (unmaintained)
created 2 years ago
updated 1 year ago
Feedback? Help us improve.