chat_mistralrs/lib.rs
1//! Local-inference provider for chat-rs, built on [mistral.rs](https://github.com/EricLBuehler/mistral.rs).
2//!
3//! Loads weights in-process (no HTTP, no daemon). On first use, model files
4//! are downloaded into the standard Hugging Face cache (`~/.cache/huggingface/`)
5//! using `HF_TOKEN` from the environment when present (only required for
6//! gated repos).
7//!
8//! ```no_run
9//! # async fn run() -> Result<(), Box<dyn std::error::Error>> {
10//! use chat_mistralrs::MistralRsBuilder;
11//!
12//! let client = MistralRsBuilder::new()
13//! .with_model("Qwen/Qwen2.5-3B-Instruct-GGUF")
14//! .with_gguf_file("qwen2.5-3b-instruct-q4_k_m.gguf")
15//! .build()
16//! .await?;
17//! # let _ = client;
18//! # Ok(()) }
19//! ```
20//!
21//! See `providers/AGENTS.md` for the overall provider architecture.
22
23#![allow(clippy::result_large_err)]
24
25pub mod api;
26pub mod builder;
27pub mod client;
28
29pub use builder::{DeviceChoice, MistralRsBuilder, WithModel, WithoutModel};
30pub use client::MistralRsClient;
31
32/// Re-exported for ergonomic use in builder calls.
33pub use mistralrs::IsqType;