Safe, ergonomic and complete Rust bindings for llama.cpp.
# Rust crate
cargo add llama-crab
# HTTP server (optional)
cargo install llama-crab-server --features mtmd --force
For backend selection (Metal, CUDA, Vulkan, ROCm, OpenCL, ...), see the installation guide.
use llama_crab::{Llama, LlamaParams};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut llama = Llama::load(
LlamaParams::new("models/model.gguf")
.with_n_ctx(2048)
.with_n_gpu_layers(99),
)?;
let response = llama.create_completion("The capital of France is", 32)?;
println!("{}", response.text);
Ok(())
}
Runnable end-to-end examples live in the separate
llama-crab-examples repo.
llama.cpp, ggml, gguf and mtmd.mtmd.llama-crab-server) and Tauri plugin (tauri-plugin-llama-crab).@llama-crab/core, @llama-crab/tauri).| Name | Description |
|---|---|
llama-crab | Safe high-level API and Rust abstractions. Start here. |
llama-crab-sys | Low-level FFI bindings to llama.cpp. |
llama-crab-server | OpenAI-compatible HTTP server binary. |
tauri-plugin-llama-crab | Tauri plugin for in-app local inference. |
@llama-crab/core | OpenAI-like TypeScript contracts and helpers. |
@llama-crab/tauri | TypeScript client for the Tauri plugin. |
rustdoc for the current release.rustdoc for main / latest version.The documentation site is published at https://llama-crab.nlp.rocks/.
Contributions are welcome. Read CONTRIBUTING.md before opening a pull request and follow the Code of Conduct. Bug reports and security issues are tracked through GitHub Issues and SECURITY.md.
Clone with submodules:
git clone --recursive https://github.com/DominguesM/llama-crab.git
cd llama-crab
Licensed under the MIT License.
llama-crab builds on llama.cpp.
105 commits
Rust
91.3%
TypeScript
5.5%
Shell
2.4%
Safe, ergonomic and complete Rust bindings for llama.cpp.
# Rust crate
cargo add llama-crab
# HTTP server (optional)
cargo install llama-crab-server --features mtmd --force
For backend selection (Metal, CUDA, Vulkan, ROCm, OpenCL, ...), see the installation guide.
use llama_crab::{Llama, LlamaParams};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut llama = Llama::load(
LlamaParams::new("models/model.gguf")
.with_n_ctx(2048)
.with_n_gpu_layers(99),
)?;
let response = llama.create_completion("The capital of France is", 32)?;
println!("{}", response.text);
Ok(())
}
Runnable end-to-end examples live in the separate
llama-crab-examples repo.
llama.cpp, ggml, gguf and mtmd.mtmd.llama-crab-server) and Tauri plugin (tauri-plugin-llama-crab).@llama-crab/core, @llama-crab/tauri).| Name | Description |
|---|---|
llama-crab | Safe high-level API and Rust abstractions. Start here. |
llama-crab-sys | Low-level FFI bindings to llama.cpp. |
llama-crab-server | OpenAI-compatible HTTP server binary. |
tauri-plugin-llama-crab | Tauri plugin for in-app local inference. |
@llama-crab/core | OpenAI-like TypeScript contracts and helpers. |
@llama-crab/tauri | TypeScript client for the Tauri plugin. |
rustdoc for the current release.rustdoc for main / latest version.The documentation site is published at https://llama-crab.nlp.rocks/.
Contributions are welcome. Read CONTRIBUTING.md before opening a pull request and follow the Code of Conduct. Bug reports and security issues are tracked through GitHub Issues and SECURITY.md.
Clone with submodules:
git clone --recursive https://github.com/DominguesM/llama-crab.git
cd llama-crab
Licensed under the MIT License.
llama-crab builds on llama.cpp.
105 commits
Rust
91.3%
TypeScript
5.5%
Shell
2.4%