allms
Library Listed
One Library to rule them aLLMs
- Downloads
- 178
- Dependents
- 0
- Stars
- 110
- Forks
- 9
- Contributors
- 4
- Commits
- 113
- Latest release
- 0.45.0 ·
About
allms: One Library to rule them aLLMs
This Rust library is specialized in providing type-safe interactions with APIs of the following LLM providers: Anthropic, AWS Bedrock, Azure, DeepSeek, Google Gemini, Mistral, OpenAI, Perplexity, xAI. (More providers to be added in the future.) It's designed to simplify the process of experimenting with different models. It de-risks the process of migrating between providers reducing vendor lock-in issues. It also standardizes serialization of sending requests to LLM APIs and interpreting the responses, ensuring that the JSON data is handled in a type-safe manner. With allms you can focus on creating effective prompts and providing LLM with the right context, instead of worrying about differences in API implementations.
Read the full README
Features
- Support for various foundational LLM providers including Anthropic, AWS Bedrock, Azure, DeepSeek, Google Gemini, OpenAI, Mistral, and Perplexity.
- Easy-to-use functions for chat/text completions and assistants. Use the same struct and methods regardless of which model you choose.
- Automated response deserialization to custom types.
- Standardized approach to providing context with support of function calling, tools, and file uploads.
- Enhanced developer productivity with automated token calculations, rate limits and debug mode.
- Extensibility enabling easy adoption of other models with standardized trait.
- Asynchronous support using Tokio.
Foundational Models
Anthropic:
- APIs: Messages, Text Completions
- Models: Claude Opus 4.7, Claude Sonnet 4.6, Claude Opus 4.6, Claude Opus 4.5, Claude Sonnet 4.5, Claude Haiku 4.5, Claude Opus 4.1, Claude Sonnet 4, Claude Opus 4, Claude 3.7 Sonnet, Claude 3.5 Sonnet, Claude 3.5 Haiku, Claude 3 Opus, Claude 3 Sonnet, Claude 3 Haiku, Claude 2.0, Claude Instant 1.2
- Tools: file search, image analysis, web search (including dynamic filtering), code interpreter, computer use
AWS Bedrock:
- APIs: Converse
- Models: Nova Micro, Nova Lite, Nova Pro (additional models to be added)
Azure OpenAI:
- APIs: Completions, Responses, Assistants, Files, Vector Stores, Tools
- API version can be set using
AzureVersionvariant
- API version can be set using
- Models: as per model deployments in Azure OpenAI Studio
- If using custom model deployment names please use the
Customvariant ofOpenAIModels
- If using custom model deployment names please use the
DeepSeek:
- APIs: Chat Completion
- Models: DeepSeek-V3, DeepSeek-R1
Google Gemini:
- APIs: Chat Completions (including streaming)
- Via Vertex AI or AI Studio
- Models: Gemini 3.1 Pro (Preview), Gemini 3.1 Flash-Lite (Preview), Gemini 3 Pro (Preview), Gemini 3 Flash (Preview), Gemini 2.5 Pro, Gemini 2.5 Flash, Gemini 2.5 Flash-Lite, Gemini 2.0 Flash, Gemini 2.0 Flash-Lite, Gemini 1.5 Pro, Gemini 1.5 Flash, Gemini 1.5 Flash-8B
- Experimental models: Gemini 2.0 Pro, Gemini 2.0 Flash-Thinking
- Fine-tuned models: in Vertex AI only, using endpoint constructor
- Tools: Google Search, code execution
Mistral:
- APIs: Chat Completions
- Models:
- Multimodal: Mistral Large 2.1, Mistral Medium 3.1, Mistral Medium 3, Mistral Small 3.2, Mistral Small 3.1, Mistral Small 3, Mistral Small 2
- Reasoning: Magistral Medium 1.2, Magistral Medium, Magistral Small 1.2
- Other: Codestral 2508, Codestral 2, Ministral 3B, Ministral 8B
- Legacy models: Mistral Large, Mistral Nemo, Mistral 7B, Mixtral 8x7B, Mixtral 8x22B, Mistral Medium, Mistral Small, Mistral Tiny
- Tools: file web search, code interpreter
OpenAI:
- APIs: Chat Completions, Responses, Function Calling, Assistants (v1 & v2), Files, Vector Stores
- Models:
- Chat Completions & Responses: GPT-6 Astra, GPT-6.1 Sol, GPT-6.1 Terra, GPT-6 Luna, GPT-6 Sol, GPT-5.6 Sol, GPT-5.6 Terra, GPT-5.6 Luna, GPT-5.6 Cyber, GPT-5.5, GPT-5.5 Pro, GPT-5.4, GPT-5.4 Pro, GPT-5.4-Mini, GPT-5.4-Nano, GPT-5.2, GPT-5.2 Pro, GPT-5.1, o1, o1 Preview, o1 Mini, o1 Pro, o3, o3 Mini, o4 Mini
- Chat Completions, Responses & Assistants: GPT-5, GPT-5-mini, GPT-5-nano, GPT-4.5-Preview, GPT-4o, GPT-4, GPT-4 32k, GPT-4 Turbo, GPT-3.5 Turbo, GPT-3.5 Turbo 16k, fine-tuned models (via
Customvariant)
- Tools: file search, image analysis, web search, code interpreter, computer use
Perplexity:
- APIs: Chat Completions
- Models: Sonar, Sonar Pro, Sonar Reasoning
- The following legacy models will be supported until February 22, 2025: Llama 3.1 Sonar Small, Llama 3.1 Sonar Large, Llama 3.1 Sonar Huge
xAI:
- APIs: Chat Completions, Responses
- Models: Grok 4.3, Grok 4.1 Fast Thinking, Grok 4.1 Fast Non Thinking, Grok 4, Grok 4 Fast Thinking, Grok 4 Fast Non Thinking, Grok Code Fast 1, Grok 3, Grok 3 Mini, Grok 3 Fast, Grok 3 Mini Fast
- Tools: web search, X search
Prerequisites
- Anthropic: API key (passed in model constructor)
- AWS Bedrock: environment variables
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEYandAWS_REGIONset as per AWS settings. - Azure OpenAI: environment variable
OPENAI_API_URLset to your Azure OpenAI resource endpoint. Endpoint key passed in constructor - DeepSeek: API key (passed in model constructor)
- Google AI Studio: API key (passed in model constructor)
- Google Vertex AI: GCP service account key (used to obtain access token) + GCP project ID (set as environment variable)
- Mistral: API key (passed in model constructor)
- OpenAI: API key (passed in model constructor)
- Perplexity: API key (passed in model constructor)
- xAI: API key (passed in model constructor)
Examples
Explore the examples directory to see more use cases and how to use different LLM providers and endpoint types.
Using Completions API with different foundational models:
let anthropic_answer = Completions::new(AnthropicModels::Claude4Sonnet, &API_KEY, None, None)
.get_answer::<T>(instructions)
.await?
let aws_bedrock_answer = Completions::new(AwsBedrockModels::NovaLite, "", None, None)
.get_answer::<T>(instructions)
.await?
let deepseek_answer = Completions::new(DeepSeekModels::DeepSeekReasoner, &API_KEY, None, None)
.get_answer::<T>(instructions)
.await?
let google_answer = Completions::new(GoogleModels::Gemini2_5Flash, &API_KEY, None, None)
.get_answer::<T>(instructions)
.await?
let mistral_answer = Completions::new(MistralModels::MistralMedium3, &API_KEY, None, None)
.get_answer::<T>(instructions)
.await?
let openai_answer = Completions::new(OpenAIModels::Gpt6_1Sol, &API_KEY, None, None)
.get_answer::<T>(instructions)
.await?
let openai_responses_answer = Completions::new(OpenAIModels::Gpt6_1Sol, &API_KEY, None, None)
.version("openai_responses")
.get_answer::<T>(instructions)
.await?
let perplexity_answer = Completions::new(PerplexityModels::SonarPro, &API_KEY, None, None)
.get_answer::<T>(instructions)
.await?
let xai_answer = Completions::new(XAIModels::Grok3Mini, &API_KEY, None, None)
.get_answer::<T>(instructions)
.await?
Native web-search citations (and future side-channel metadata) via get_answer_with_metadata.
get_answer is unchanged. Pass None for all metadata kinds, or Some(&[...]) to select a subset:
use allms::{CompletionMetadataKind, Completions};
use allms::llm::{
tools::{LLMTools, OpenAIWebSearchConfig},
OpenAIModels,
};
let result = Completions::new(OpenAIModels::Gpt6_1Sol, &API_KEY, None, None)
.version("openai_responses")
.add_tool(LLMTools::OpenAIWebSearch(OpenAIWebSearchConfig::new()))
.get_answer_with_metadata::<T>(instructions, None)
.await?;
let answer = result.answer;
let sources = result
.metadata
.citations
.map(|c| c.urls)
.unwrap_or_default();
// Or request only citations explicitly:
let result = Completions::new(OpenAIModels::Gpt6_1Sol, &API_KEY, None, None)
.version("openai_responses")
.add_tool(LLMTools::OpenAIWebSearch(OpenAIWebSearchConfig::new()))
.get_answer_with_metadata::<T>(
instructions,
Some(&[CompletionMetadataKind::Citations]),
)
.await?;
CompletionMetadata is the extension point for future non-answer fields; kinds not requested stay None (omitted when serialized). Requested kinds with no provider data are Some with empty lists.
Example with web search + native citations via get_answer_with_metadata:
RUST_LOG=info RUST_BACKTRACE=1 cargo run --example use_completions_metadata
Example:
RUST_LOG=info RUST_BACKTRACE=1 cargo run --example use_completions
Using Assistant API to analyze your files with File and VectorStore capabilities:
// Create a File
let openai_file = OpenAIFile::new(None, &API_KEY)
.upload(&file_name, bytes)
.await?;
// Create a Vector Store
let openai_vector_store = OpenAIVectorStore::new(None, "Name", &API_KEY)
.upload(&[openai_file.id.clone().unwrap_or_default()])
.await?;
// Extract data using Assistant
let openai_answer = OpenAIAssistant::new(OpenAIModels::Gpt4o, &API_KEY)
.version(OpenAIAssistantVersion::V2)
.vector_store(openai_vector_store.clone())
.await?
.get_answer::<T>(instructions, &[])
.await?;
Example:
RUST_LOG=info RUST_BACKTRACE=1 cargo run --example use_openai_assistant
License
This project is licensed under dual MIT/Apache-2.0 license. See the LICENSE-MIT and LICENSE-APACHE files for details.
Compatibility
- Runs on
- GPU support unknown
What shows it
- no dependency or feature matches a backend row
- Native code
- None found
- No native code found
- Python bindings
- No Python binding crate found
- License
- MIT
Compare with similar projects
Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days. ML Rust runs this catalogue, so its closest project always gets a row.
| Project | Downloads | Dependents | Stars | Latest release | Runs on (GPU) | Native code | License |
|---|---|---|---|---|---|---|---|
|
One Library to rule them aLLMs |
178 downloads over 30 days | 0 | 110 | 0.45.0 | GPU support unknown | No native code found | MIT |
|
async-openai Featured
Rust library for OpenAI |
1,302,033 downloads over 30 days | 275 | 2,031 | 0.43.0 | GPU support unknown | No native code found | MIT |
|
rust-genai Featured
Multi-AI Providers Library for Rust. (OpenAI, Gemini, Anthropic, DeepSeek, Ollama, OMLX, AWS Bedrock, Vertex, Xai, Groq, Kimi, GLM and many more) |
118,643 downloads over 30 days | 81 | 938 | 0.7.3 | GPU support unknown | No native code found | Apache-2.0 OR MIT |
|
ollama-rs Featured
A Rust library for interacting with the Ollama API |
45,579 downloads over 30 days | 68 | 1,061 | 0.3.6 | GPU support unknown | No native code found | MIT |
|
All-in-one LLM CLI tool featuring Shell Assistant, Chat-REPL, RAG, AI Tools & Agents, with access to OpenAI, Claude, Gemini, Ollama, Groq, and more. |
28,422 binary downloads per release | Not applicable | 10,556 | 0.30.0 | GPU support unknown | No native code found | Apache-2.0 OR MIT |
|
llm Featured
A Rust library unifying multiple LLM backends. |
7,669 downloads over 30 days | 34 | 365 | 1.3.8 | GPU support unknown | Binds native code: alsa-sys (feature audio-example) | MIT |
|
An open protocol that gives AI agents a secure, sandboxed place to run code and use tools — with lean context usage. AXP works alongside MCP |
Not measured | Not applicable | 3 | Not measured | Not measured | Not measured | Apache-2.0 |
Why ListedNo archive, New or Featured rule places it, so it is Listed.
What it lacks for Featured
- It has 0 active dependents and 0 new dependents in 365 days. Featured needs 11 active dependents or 9 new dependents in 365 days. The repository route reads 110 stars, 9 forks and 4 contributors. It needs 4,539 stars, 434 forks and 79 contributors together.
What else the check found
- The last activity is on 30 Oct 2026, 10 days ago. The rules expect an update within 365 days. Dormancy rule
- The oldest outside issue waits 1069 days for a reply, past the limit of 270. No maintainer replied in 365 days. Rot signals rule
- The latest release requires the deprecated dependency backoff. RUSTSEC-2025-0012 Rot signals rule
Exact rules: Listed, Featured library. The check on applied thresholds version 9.
Every rule outcome, as the check records it
expected-interval: version 0.45.0 base 140, raised to the 365-day floor: E = 365 daysdormancy: last activity 2026-10-30, 10 days ago, E = 365: activerot: oldest unanswered issue 1069 days (limit 270), no maintainer reply in 365 daysrot: deprecated requirement `backoff (RUSTSEC-2025-0012, https://rustsec.org/advisories/RUSTSEC-2025-0012.html)`featured: not featured: active_users 0 < 11 and new_adopters 0 < 9 and repository route stars 110 (needs 4539), forks 9 (needs 434), contributors 4 (needs 79)listed: listed: no archive, new or featured rule applies
Measurements and sources
Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.
Sources6 sources
- Description: the crates.io description
- crates.io database dump, fetched
- RustSec advisory database, fetched
- GitHub repository, fetched
- crates.io package, fetched
- GitHub contributors, fetched
Adoption0 active dependents, 0 new dependents in 365 days1 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Active dependents | 0 | crates.io database dump | Yes | |
| New dependents (365 days) | 0 | crates.io database dump | Yes | |
| Peak active dependents | 1 | crates.io database dump | Yes | |
| Active dependents as a share of the peak | 1 | crates.io database dump | Yes | |
| Binary downloads per release | Not measured | Yes |
MaintenanceLatest human commit: 11 days ago3 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Latest human commit | 2026-10-29 | GitHub repository | Yes | |
| Latest release | 2026-10-30 | crates.io database dump | Yes | |
| First release | 2024-01-03 | crates.io database dump | Yes | |
| Latest version | 0.45.0 | crates.io database dump | Yes | |
| Days the oldest outside issue waits for a reply | 1069 | GitHub repository | Yes | |
| Maintainer replies over 365 days | 0 | GitHub repository | Yes | |
| Repository archived | false | GitHub repository | Yes | |
| Repository gone | false | GitHub repository | Yes | |
| Release commit or manifest in the repo | true | crates.io package | Yes | |
| Published docs | true | crates.io database dump | Yes | |
| Latest release fails cargo check | Not measured | Yes | ||
| Build check date | Not measured | Yes | ||
| Build check toolchain | Not measured | Yes |
SecurityUnpatched vulnerabilities: none
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Unpatched vulnerabilities past the grace window | none | RustSec advisory database | Yes | |
| RustSec unmaintained advisory | none | RustSec advisory database | Yes | |
| Deprecation notice | none | crates.io database dump | Yes | |
| Deprecated requirement | backoff (RUSTSEC-2025-0012, https://rustsec.org/advisories/RUSTSEC-2025-0012.html) | crates.io database dump | Yes |
Distribution69 releases, 178 downloads over 30 days5 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Releases | 69 | crates.io database dump | Yes | |
| Downloads over 30 days | 178 | crates.io database dump | Yes | |
| Binary downloads over the last 3 releases | Not measured | Yes | ||
| Homebrew installs on request over 365 days | Not measured | Yes | ||
| Repology repository families | Not measured | Yes | ||
| Docker pull growth over 90 days | Not measured | Yes | ||
| Docker pulls at the growth baseline | Not measured | Yes | ||
| Every version a prerelease | false | crates.io database dump | Yes | |
| Every version 0.0.x | false | crates.io database dump | Yes | |
| Every version yanked | false | crates.io database dump | Yes | |
| Crate deleted from crates.io | false | crates.io database dump | Yes |
Repository110 stars, 9 forks, 4 contributors, 113 commits. Stars alone never qualify a project.
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| GitHub stars | 110 | GitHub repository | Yes — one part of the repository route | |
| GitHub forks | 9 | GitHub repository | Yes — one part of the repository route | |
| Contributors with a GitHub account | 4 | GitHub contributors | Yes — one part of the repository route | |
| Commits on the default branch | 113 | GitHub repository | No | |
| Repository's main crate left out of the entry | none | crates.io database dump | Yes |
Facts that never count
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| License | MIT | crates.io database dump | No | |
| Runs on, from listed crates and their direct dependencies | GPU support unknown | crates.io database dump | No | |
| What shows each backend | no dependency or feature matches a backend row | crates.io database dump | No | |
| Native code, from listed crates and their dependencies | No native code found | crates.io database dump | No | |
| Python bindings, from direct dependencies of listed crates | No Python binding crate found | crates.io database dump | No | |
| Crates that depend on a listed crate directly | 0 | crates.io database dump | No |
Corrections and review history
No correction applies to this entry.
Judgments
A judgment enters only through an approved issue and a merged pull request.
No judgment applies to this entry.