async-openai  by 64bit

Rust library for interacting with the OpenAI API

created 2 years ago
1,537 stars

Top 27.5% on sourcepulse

GitHubView on GitHub
Project Summary

This Rust library provides an asynchronous interface to the OpenAI API, targeting developers building applications that leverage AI models for tasks like text generation, image creation, and embeddings. It offers a robust and efficient way to integrate OpenAI's capabilities into Rust projects, emphasizing performance and type safety.

How It Works

The library utilizes Rust's async/await features and the reqwest HTTP client for non-blocking API calls. It maps OpenAI's REST API endpoints to strongly-typed Rust structs and enums, ensuring compile-time validation of requests and responses. This approach minimizes runtime errors and provides a clear, idiomatic Rust experience for interacting with the AI services.

Quick Start & Requirements

  • Install: cargo add async-openai
  • Prerequisites: Rust toolchain (stable or nightly), OpenAI API key (set as OPENAI_API_KEY environment variable).
  • Docs: https://docs.rs/async-openai/

Highlighted Details

  • Supports all major OpenAI API endpoints including Chat Completions, Image Generation, Embeddings, and Audio.
  • Provides streaming support for Chat Completions.
  • Includes models for fine-tuning and fine-tuned model management.
  • Offers robust error handling and retry mechanisms.

Maintenance & Community

The project is actively maintained by the 64bit organization. Community engagement channels are not explicitly listed in the README.

Licensing & Compatibility

  • License: MIT License
  • Compatibility: Permissive MIT license allows for use in commercial and closed-source applications.

Limitations & Caveats

The library is under active development, and while it covers most core OpenAI functionalities, some newer or less common API features might not yet be implemented. Users should consult the documentation for the latest supported endpoints.

Health Check
Last commit

1 month ago

Responsiveness

1 day

Pull Requests (30d)
5
Issues (30d)
2
Star History
125 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.