EricLBuehler/mistral.rs

Fast, flexible LLM inference

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 27 minutes ago
Added to GitGenius on July 30th, 2025
Created on February 26th, 2024
Open Issues & Pull Requests: 382 (+0)
Number of forks: 675
Total Stargazers: 7,599 (+0)
Total Subscribers: 44 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 18.6 hours
Mean response time: 11.3 days
90th percentile: 26.1 days
Tracked items: 581

How this project is maintained

Around half of the issues opened in the past year never receive a reply. 98% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. Work labelled "urgent" is answered fastest, typically in under an hour, while "new feature" waits about 2 days. 67% of tracked open issues have had no activity in three months, so the open count overstates what is actively being worked. Only 9% of issues opened in the past year have been closed.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 235
New in 7 days: 1
Closed in 7 days: 0
Avg open age: 293 days
Stale 30+ days: 228
Stale 90+ days: 202

Recent activity

Opened in 7 days: 1
Closed in 7 days: 0
Comments in 7 days: 1
Events in 7 days: 2

Top labels

  • bug (393)
  • new feature (139)
  • build (56)
  • triaged (25)
  • models (23)
  • resolved (22)
  • urgent (12)
  • backend (9)

Most active issues this week

Detailed Description

mistral.rs is a Rust library providing safe, high-performance bindings to the Mistral AI models, specifically focusing on the 7B Instruct v0.1 and 7B Instruct v0.2 models. It aims to offer a developer-friendly experience for integrating these models into Rust applications, bypassing the need for Python intermediaries and the associated overhead. The core strength lies in its direct memory management and efficient implementation, leveraging Rust's safety features to prevent common issues like segmentation faults that can plague C/C++ bindings.

The library's architecture centers around a `Mistral` struct which encapsulates the model weights and provides methods for generating text. It supports both CPU and GPU inference, utilizing the `candle-core` and `candle-nn` crates for tensor operations and neural network functionality. A key design choice is to load the model weights directly from GGML/GGUF format, a quantized format optimized for CPU inference, making it accessible even on systems without powerful GPUs. GPU acceleration is achieved through the `candle-cuda` backend, allowing for significant speedups when a compatible NVIDIA GPU is available. The project explicitly avoids relying on `unsafe` code as much as possible, prioritizing memory safety and predictable behavior.

A significant feature is the support for various generation parameters, mirroring those found in the official Mistral API and other popular inference libraries. These include temperature, top_p, top_k, repetition penalty, and maximum sequence length. This allows developers to fine-tune the generated text to achieve desired results, controlling the randomness, creativity, and coherence of the output. The library also provides mechanisms for streaming responses, enabling real-time text generation and improving the user experience in interactive applications. The `stream_infer` function is particularly important for this, yielding tokens as they are generated.

The repository includes comprehensive examples demonstrating how to load the model, perform inference, and stream responses. These examples cover both CPU and GPU usage, providing a clear starting point for developers. Furthermore, the project is well-documented, with detailed explanations of the API and usage patterns. The documentation emphasizes the importance of understanding the model's limitations and potential biases. The project also includes benchmarks comparing its performance to other inference solutions, showcasing its efficiency.

Currently, the project is actively maintained and under development. Future plans include expanding support to other Mistral models (like Mixtral 8x7B), improving quantization support, and adding more advanced features like prompt templates and better error handling. The project welcomes contributions from the community, encouraging developers to submit pull requests and report issues. Overall, mistral.rs provides a compelling solution for running Mistral AI models directly within Rust, offering a balance of performance, safety, and ease of use.