-
A simple chatbot built using Rust, in the frontend and the backend.
-
Made using
candle,leptos,actix,tokioand TailwindCSS. -
Uses quantized Mistral 7B Instruct v0.1 GGUF models.
- This is a fork of MoonKraken/rusty_llama by Code to the Moon.
- This chatbot uses Mistral GGUF models and the
huggingface/candleframework, which includes thecandle-transformerscrate, whereas the original uses GGML models and therustformers/llmcrate. - The frontend has some aesthetic changes, but the overall structure is the same.
- Colours are from the Tokyo Night colorscheme.
You'll need to use the nightly Rust toolchain, and install the wasm32-unknown-unknown target as well as the trunk and cargo-leptos tools:
rustup toolchain install nightly
rustup target add wasm32-unknown-unknown
cargo install trunk cargo-leptos
- For CUDA, add the
cudafeature for candle_core in Cargo.toml.
candle-core = { git = "https://github.com/huggingface/candle.git", version = "0.6.0", optional = true, features = ["cuda"] }
- For Metal, add the
metalfeature for candle_core in Cargo.toml. - For Intel's oneAPI Math Kernel Library, add the
mklfeature for candle_core in Cargo.toml. - For Accelerate, add the
acceleratefeature for candle_core in Cargo.toml.
-
Download any Mistral 7B Instruct v0.1 GGUF model and set the environment variable
MODEL_PATHin.env. -
Download tokenizer.json and set the environment variable in
TOKENIZER_PATHin.env.
- Install TailwindCSS with
npm install -D tailwindcss.
git clone https://github.com/ShettySach/CandleMist.git
cd CandleMist
npx tailwindcss -i ./input.css -o ./style/output.css
cargo leptos serve --release
- In your browser, navigate to http://localhost:3000/?
- You can modify parameters such as temperature, seed, top-k, top-p, max history and max response length, and also modify the chat template in 'src/api.rs'.

