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:
- OpenAI
- Anthropic
- Gemini
- Ollama
- Groq
- xAI/Grok
Offers a unified interface with async support and config flexibility. Excellent for building apps that can switch between Grok and other models easily.
ai_client
A lightweight trait-based framework for interacting with AI chat completions. Implements clients for:
GrokClient
OpenAIClient
AnthropicClient
Includes LRU caching, retry logic, and Prometheus-style metrics. Example usage:
let client = GrokClient::new()?;
let resp = client.send_chat_completion(messages, "low").await?;
x-ai
(aka opensass/x-ai
)
CLI, TUI, and SDK for Grok integration via xAI. Features:
- Support for models like
grok-beta
- Streaming completion support
- Modular config and prompt interface