MCPcopy Create free account
hub / github.com/MoonKraken/rusty_llama

github.com/MoonKraken/rusty_llama @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
8 symbols 10 edges 12 files ⚖ MIT 0 documented · 0% ● updated 2mo ago★ 4347 open issues

Browse by type

⨍ Functions 6◇ Types & classes 2
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Rusty Llama Webapp

A simple webapp to showcase the ability to write a simple chatbot webapp using only Rust, TailwindCSS and an Open Source language model such as a variant of GPT, LLaMA, etc.

Inference is handled in-process by mistral.rs. The UI is a Leptos 0.8 app served by Actix.

Setup Instructions

Hardware

By default, the project enables Apple's Metal backend through the metal feature on the mistralrs dependency in Cargo.toml. On an NVIDIA machine, replace metal with cuda. For a CPU-only build, remove the feature list.

The Metal feature compiles GPU shaders while the server crate builds. Xcode 26 and later do not ship that compiler inside Xcode. It is a separate component, the Metal Toolchain. Install it once:

xcodebuild -runFirstLaunch
xcodebuild -downloadComponent MetalToolchain
xcrun metal --version

xcodebuild -runFirstLaunch updates Xcode's system packages and asks for an administrator password. Let it finish. xcrun metal --version should then print a version. Until it does, cargo leptos watch stops while compiling mistral.rs shaders.

Rust Toolchain

Stable Rust 1.88 or newer is required, along with the wasm32-unknown-unknown target and cargo-leptos:

rustup target add wasm32-unknown-unknown
cargo install cargo-leptos --locked

Model

The default is Qwen3.8 27B, the Q4_K_M GGUF (about 17 GB). .env sets MODEL_REPO and MODEL_FILE. mistral.rs downloads that file from Hugging Face into ~/.cache/huggingface the first time the server starts, then reuses the cache. No separate download step is required. A Hugging Face token is only needed for gated repos. This one is public.

To use a different quant, change MODEL_FILE to another filename in that repo, such as Qwen3.8-27B-Q6_K.gguf. To use a file you already have, set MODEL_PATH to a .gguf file or a directory of GGUF shards. MODEL_PATH overrides the Hugging Face settings. Older GGML .bin files are not supported.

If a file has no embedded chat template, set CHAT_TEMPLATE to a Jinja template string or a path to a .json template file.

Run

To run the project locally,

  1. cargo leptos watch in the project directory. This compiles Tailwind from input.css into the site CSS.
  2. In your browser, open http://localhost:3000/.

The first server build compiles mistral.rs and its Metal kernels, so it takes a while.

Example Models

Core symbols most depended-on inside this repo

browse all functions →

Shape

Function 5
Class 2
Method 1

Languages

Rust100%

Modules by API surface

src/model/conversation.rs3 symbols
src/main.rs2 symbols
src/app/components/type_area.rs1 symbols
src/app/components/chat_area.rs1 symbols
src/app.rs1 symbols

For agents

$ claude mcp add rusty_llama \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page