Crate nanochat

Crate nanochat 

Source
Expand description

NanoChat - A GPT implementation in Rust using Burn

This library provides a complete implementation of the NanoChat model with modern features like rotary embeddings, Multi-Query Attention, and efficient KV caching.

Re-exports§

pub use checkpoint::load_checkpoint;
pub use checkpoint::save_checkpoint;
pub use checkpoint::load_weights;
pub use checkpoint::save_weights;
pub use backend::get_device;
pub use backend::print_backend_info;
pub use backend::AutoBackend;
pub use config::NanoChatConfig;

Modules§

backend
Backend selection with automatic GPU detection for Burn 0.18
checkpoint
Checkpoint save/load for NanoChat models
config
Configuration structures for NanoChat model and training
engine
gpt
NanoChat GPT with numerically stable attention and logits
prelude
Prelude module for convenient imports
sampling
Sampling strategies for text generation
tokenizer
Tokenizer for NanoChat with special token support and chat templating Mirrors the Python tokenizer.py implementation

Functions§

init