freeradiantbunny.org

freeradiantbunny.org/blog

rust for grok

Rust Crates Supporting the Grok API

Here is a curated list of Rust packages that support the Grok API from xAI. These crates provide direct or unified access to large language models including Grok, OpenAI, Anthropic, and others.

genai

A multi-provider generative AI client written in Rust, supporting:

Offers a unified interface with async support and config flexibility. Excellent for building apps that can switch between Grok and other models easily.

View on docs.rs

ai_client

A lightweight trait-based framework for interacting with AI chat completions. Implements clients for:

Includes LRU caching, retry logic, and Prometheus-style metrics. Example usage:

let client = GrokClient::new()?;
      let resp = client.send_chat_completion(messages, "low").await?;

View on lib.rs

x-ai (aka opensass/x-ai)

CLI, TUI, and SDK for Grok integration via xAI. Features:

View on GitHub