Block a user
minibox-llm (0.19.0)
Published 2026-05-31 14:31:46 -05:00 by joe
Installation
[registry]
default = "gitea"
[registries.gitea]
index = "sparse+ " # Sparse index
# index = " " # Git
[net]
git-fetch-with-cli = truecargo add minibox-llm@0.19.0About this package
minibox-llm
Multi-provider LLM client with structured output support and fallback chains.
Providers
| Provider | Feature | Models |
|---|---|---|
| Claude (Anthropic) | anthropic |
claude-opus-4-6, claude-sonnet-4-6, claude-haiku-4-5 |
| OpenAI | openai |
gpt-4-turbo, gpt-4o, etc. |
| Google Gemini | gemini |
gemini-2.0-flash, etc. |
Usage
use minibox_llm::LlmClient;
let client = LlmClient::anthropic("your-api-key");
let response = client.complete("Explain containers").await?;
Structured Output
Use with_schema() to define JSON schemas for responses, enabling type-safe extraction:
let schema = json!({"type": "object", "properties": {...}});
let response = client.with_schema(schema).complete(prompt).await?;
Fallback Chains
Stack providers for automatic fallback:
let chain = vec![
Box::new(LlmClient::anthropic(key1)),
Box::new(LlmClient::openai(key2)),
];
Default features include all three providers. Disable individually as needed.
Dependencies
| ID | Version |
|---|---|
| async-trait | ^0.1 |
| minibox-macros | ^0.19.0 |
| reqwest | ^0.12 |
| serde | ^1 |
| serde_json | ^1 |
| thiserror | ^2 |
| tokio | ^1 |
| tracing | ^0.1 |
| proptest | ^1 |
| tokio | ^1 |
Details
2026-05-31 14:31:46 -05:00
Assets (1)
Versions (1)
View all
Cargo
2
MIT OR Apache-2.0
35 KiB
minibox-llm-0.19.0.crate
35 KiB
0.19.0
2026-05-31