This section groups AI-related Rust libraries into machine learning frameworks, OpenAI and Gemini clients, agent and LLM tooling, and genetic algorithms. Machine learning is the largest group, led by Candle and Burn for deep learning and Hugging Face's tokenizers. The others cover building on top of hosted models.
For language model applications, Rig is a framework for building LLM-powered apps and agents with a common interface across providers, and async-openai is a typed async client for the OpenAI API. tiktoken-rs counts tokens the way OpenAI's models do, which helps with prompt budgeting. OpenAI's own Codex CLI is written in Rust, and its harmony crate implements the response format used by the gpt-oss models. BAML is a language for defining structured prompts with typed outputs.
Genetic algorithm crates such as radiate and genevo are useful for optimization problems where gradients are not available. When choosing, check how actively a client tracks API changes, because provider APIs move quickly and unmaintained wrappers fall behind. For local inference without a hosted API, the Machine learning subcategory has Candle, Burn and mistral.rs, which can run open-weight models from a single Rust binary.