Skip to main content

rig/providers/
mod.rs

1//! This module contains clients for the different LLM providers that Rig supports.
2//!
3//! Currently, the following providers are supported:
4//! - Cohere
5//! - OpenAI
6//! - Perplexity
7//! - Anthropic
8//! - Google Gemini
9//! - xAI
10//! - EternalAI
11//! - DeepSeek
12//! - Azure OpenAI
13//! - Mira
14//!
15//! Each provider has its own module, which contains a `Client` implementation that can
16//! be used to initialize completion and embedding models and execute requests to those models.
17//!
18//! The clients also contain methods to easily create higher level AI constructs such as
19//! agents and RAG systems, reducing the need for boilerplate.
20//!
21//! # Example
22//! ```
23//! use rig::{providers::openai, agent::AgentBuilder};
24//!
25//! // Initialize the OpenAI client
26//! let openai = openai::Client::new("your-openai-api-key");
27//!
28//! // Create a model and initialize an agent
29//! let gpt_4o = openai.completion_model("gpt-4o");
30//!
31//! let agent = AgentBuilder::new(gpt_4o)
32//!     .preamble("\
33//!         You are Gandalf the white and you will be conversing with other \
34//!         powerful beings to discuss the fate of Middle Earth.\
35//!     ")
36//!     .build();
37//!
38//! // Alternatively, you can initialize an agent directly
39//! let agent = openai.agent("gpt-4o")
40//!     .preamble("\
41//!         You are Gandalf the white and you will be conversing with other \
42//!         powerful beings to discuss the fate of Middle Earth.\
43//!     ")
44//!     .build();
45//! ```
46//! Note: The example above uses the OpenAI provider client, but the same pattern can
47//! be used with the Cohere provider client.
48pub mod anthropic;
49pub mod azure;
50pub mod chatgpt;
51pub mod cohere;
52pub mod copilot;
53pub mod deepseek;
54pub mod galadriel;
55pub mod gemini;
56pub mod groq;
57pub mod huggingface;
58pub mod hyperbolic;
59pub(crate) mod internal;
60pub mod llamafile;
61pub mod minimax;
62pub mod mira;
63pub mod mistral;
64pub mod moonshot;
65pub mod ollama;
66pub mod openai;
67pub mod openrouter;
68pub mod perplexity;
69pub mod together;
70pub mod voyageai;
71pub mod xai;
72pub mod xiaomimimo;
73pub mod zai;