### Start OpenAI-Compatible HTTP Server Source: https://context7.com/tracel-ai/burn-lm/llms.txt Compile and start the OpenAI-compatible HTTP server. Supports hot-reloading with `cargo-watch`. Can specify custom ports and backends. ```sh cargo burn-lm server run ``` ```sh cargo burn-lm --backend cuda --dtype f16 server run --port 8080 ``` -------------------------------- ### Run Burn LM HTTP Server with Metal Backend Source: https://context7.com/tracel-ai/burn-lm/llms.txt Start the Burn LM HTTP server using the Apple Metal backend. This command enables the Metal feature for the `burn-lm-inference` dependency. ```sh # Run the HTTP server with Apple Metal cargo run --package burn-lm-http --features "burn-lm-inference/metal" ``` -------------------------------- ### Start Interactive Chat Session Source: https://context7.com/tracel-ai/burn-lm/llms.txt Start an interactive multi-turn chat session with a model, maintaining conversation context. Supports slash commands like `/stats`, `/clear`, and `/exit`. ```sh cargo burn-lm chat llama3-2-1b ``` -------------------------------- ### Run Burn LM CLI with Specific Features Source: https://context7.com/tracel-ai/burn-lm/llms.txt Execute the Burn LM command-line interface with custom backend and precision features enabled. This example demonstrates running the CLI with CUDA and f16 precision. ```sh # Run the CLI with the CUDA backend and f16 precision cargo run --package burn-lm --features "burn-lm-inference/cuda,burn-lm-inference/f16" ``` -------------------------------- ### Get Single Model Metadata Source: https://context7.com/tracel-ai/burn-lm/llms.txt Retrieve metadata for a specific model by its ID. Returns a 404 error if the model is not found. ```sh curl http://localhost:3001/v1/models/Llama-3.2-1B-Instruct ``` -------------------------------- ### Get Model Metadata Source: https://context7.com/tracel-ai/burn-lm/llms.txt Retrieves metadata for a specific model identified by its ID. Returns a 404 error if the model is not found. ```APIDOC ## GET /v1/models/{model} ### Description Returns metadata for a single model by its ID. Returns 404 if the model is not found. ### Method GET ### Endpoint /v1/models/{model} ### Parameters #### Path Parameters - **model** (string) - Required - The ID of the model to retrieve. ### Request Example ```sh curl http://localhost:3001/v1/models/Llama-3.2-1B-Instruct ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the model. - **object** (string) - The type of object, always "model". - **created** (integer) - Timestamp of when the model was created. - **owned_by** (string) - The entity that owns the model. #### Response Example ```json { "id": "Llama-3.2-1B-Instruct", "object": "model", "created": 1727222400, "owned_by": "Meta" } ``` #### Error Response (404) Model not found. ``` -------------------------------- ### Bootstrap a New Model Server Source: https://github.com/tracel-ai/burn-lm/blob/main/README.md Use the 'new' command to create a new model server crate and register it in the Burn LM registry. This bootstrapped server is model-less and repeats the prompt. ```sh cargo burn-lm new "my-model" ``` -------------------------------- ### Launch Interactive REPL Source: https://context7.com/tracel-ai/burn-lm/llms.txt Clone the repository and launch the interactive REPL. Defaults to the ndarray CPU backend. Can specify GPU backends and data types. ```sh git clone https://github.com/tracel-ai/burn-lm.git cd burn-lm cargo burn-lm ``` ```sh cargo burn-lm --backend cuda --dtype f16 ``` -------------------------------- ### Download Models Source: https://context7.com/tracel-ai/burn-lm/llms.txt Download specific models or all available models from the model registry. Use `--help` to list downloadable models. ```sh cargo burn-lm download --help ``` ```sh cargo burn-lm download llama3-2-1b ``` ```sh cargo burn-lm download all ``` -------------------------------- ### Initialize Transformer Model from Configuration Source: https://github.com/tracel-ai/burn-lm/blob/main/burn-lm-book/src/new-model-implementation.md Implement the initialization logic for a transformer model based on its configuration. This involves creating token embeddings, transformer blocks, normalization layers, and the output linear layer. ```rust impl TransformerConfig { /// Initialize a new [decoder-only transformer](Transformer). pub fn init(&self, device: &Device) -> Transformer { let tok_embeddings = EmbeddingConfig::new(self.vocab_size, self.d_model).init(device); let layers = (0..self.n_layers) .map(|_| { TransformerBlockConfig::new( self.n_layers, self.d_model, self.hidden_size, self.n_heads, self.n_kv_heads, self.norm_eps, ) .init(device) }) .collect::>(); let norm = RmsNormConfig::new(self.d_model) .with_epsilon(self.norm_eps) .init(device); let output = LinearConfig::new(self.d_model, self.vocab_size) .with_bias(false) .init(device); Transformer { tok_embeddings, layers, norm, output, } } } ``` -------------------------------- ### Programmatic Inference with InferenceJob Source: https://context7.com/tracel-ai/burn-lm/llms.txt Use `InferenceJob` for low-level inference control. Create a job with a task and a listener, then pass it to a plugin. Join the handle to retrieve the generated output. ```rust use burn_lm_inference::{ InferenceJob, InferenceTask, Message, MessageRole, StdOutListener, TextGenerationListener, }; // --- Stream tokens directly to stdout --- let message = Message { role: MessageRole::User, content: "Tell me about Rust's borrow checker.".to_string(), refusal: None, }; let task = InferenceTask::Message(message); let (job, handle) = InferenceJob::create(task, StdOutListener::default()); let _stats = plugin.run_job(job)?; handle.join(); // blocks until generation is complete // --- Collect the full response as a String --- let task2 = InferenceTask::Context(vec![ Message { role: MessageRole::System, content: "You are concise.".into(), refusal: None }, Message { role: MessageRole::User, content: "What is Rust?".into(), refusal: None }, ]); let (job2, handle2) = InferenceJob::create(task2, TextGenerationListener::default()); let stats = plugin.run_job(job2)?; let full_text: String = handle2.join(); println!("Response: {full_text}"); println!("{}", stats.display_stats()); // --- Run inference from a raw prompt string --- let task3 = InferenceTask::Prompt("Once upon a time".to_string()); let (job3, handle3) = InferenceJob::create(task3, TextGenerationListener::default()); plugin.run_job(job3)?; let story = handle3.join(); ``` -------------------------------- ### Launch Burn LM Shell Source: https://github.com/tracel-ai/burn-lm/blob/main/README.md Clone the repository, navigate to the directory, and launch the Burn LM shell using the cargo command. ```sh git clone https://github.com/tracel-ai/burn-lm.git cd burn-lm cargo burn-lm ``` -------------------------------- ### Create New Model Crate Source: https://github.com/tracel-ai/burn-lm/blob/main/burn-lm-book/src/new-model-implementation.md Use this command to generate a new crate for your model implementation and register it in the model registry. ```sh cargo burn-lm new {model_name} ``` -------------------------------- ### Configure Burn LM Backend with Cargo Features Source: https://context7.com/tracel-ai/burn-lm/llms.txt Select the compute backend and floating-point precision for Burn LM by specifying Cargo feature flags in your `Cargo.toml` file. This allows for compile-time optimization without runtime overhead. Combine GPU backends with precision flags like `f16` or `bf16` for optimized performance. ```toml # Cargo.toml — select backend features for burn-lm-inference [dependencies] burn-lm-inference = { version = "0.0.1", features = ["cuda", "f16"] } # Available backends: # cuda → NVIDIA CUDA (Burn Cuda backend) # rocm → AMD ROCm # wgpu → WebGPU (cross-platform GPU) # vulkan → Vulkan via wgpu # metal → Apple Metal via wgpu # wgpu-cpu → wgpu CPU fallback # candle-cpu → Candle CPU # candle-cuda → Candle CUDA # candle-metal → Candle Metal # libtorch → PyTorch LibTorch (CUDA/MPS) # libtorch-cpu → PyTorch LibTorch CPU # ndarray → CPU ndarray (default, for testing) # # Precision flags (combine with a GPU backend): # f16 → half-precision float16 # bf16 → bfloat16 # (default is f32 when no precision flag is set) ``` -------------------------------- ### List Registered Models Source: https://context7.com/tracel-ai/burn-lm/llms.txt List all models registered in the Burn LM registry, including their name, creator, creation date, and download status. ```sh cargo burn-lm models ``` -------------------------------- ### Create Chat Completion (Streaming SSE) Source: https://context7.com/tracel-ai/burn-lm/llms.txt An OpenAI-compatible endpoint for chat completions that returns a `text/event-stream` response using Server-Sent Events. This is useful for real-time token generation. ```APIDOC ## POST /v1/chat/completions (Streaming SSE) ### Description Same endpoint with `"stream": true`. Returns a `text/event-stream` response with Server-Sent Events. The first chunks include model loading status; subsequent chunks carry generated tokens; the final event is `data: [DONE]`. ### Method POST ### Endpoint /v1/chat/completions ### Parameters #### Request Body - **model** (string) - Required - The ID of the model to use for completion. - **messages** (array) - Required - A list of message objects, each with a `role` (system, user, or assistant) and `content`. - **temperature** (number) - Optional - Controls randomness. Lower values make output more focused and deterministic. - **top_p** (number) - Optional - Controls diversity via nucleus sampling. Use with temperature. - **max_tokens** (integer) - Optional - The maximum number of tokens to generate in the completion. - **seed** (integer) - Optional - A seed for reproducible results. - **stream** (boolean) - Required - Set to `true` to enable streaming. ### Request Example ```sh curl -N -X POST http://localhost:3001/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "Llama-3.2-1B-Instruct", "messages": [{"role": "user", "content": "Tell me a joke." }], "stream": true }' ``` ### Response #### Success Response (200) - **Content-Type**: `text/event-stream` - Events are Server-Sent Events (SSE) formatted. - The stream begins with model loading status messages. - Subsequent events contain generated tokens in `delta` objects within `choices`. - The stream concludes with a `data: [DONE]` event. #### Response Example (Stream of SSE events) ``` data: {"id":"chatcmpl-xyz","object":"chat.completion.chunk","created":1716000000,"model":"Llama-3.2-1B-Instruct","choices":[{"index":0,"delta":{"content":"```Burn LM\nloading model 'Llama-3.2-1B-Instruct'... "},...}],...} data: {"id":"chatcmpl-xyz",...,"choices":[{"index":0,"delta":{"content":"model loaded ! ✓(2.14s)\n```\n\n"},...}],...} data: {"id":"chatcmpl-xyz",...,"choices":[{"index":0,"delta":{"content":"Why don't scientists trust atoms? Because they make up everything!"},...}],...} data: [DONE] ``` ``` -------------------------------- ### Run Single Inference Pass Source: https://context7.com/tracel-ai/burn-lm/llms.txt Run a single inference pass with a prompt against a downloaded model. Optionally suppress the statistics table. ```sh cargo burn-lm run llama3-2-1b "Explain the Rust ownership model in one paragraph" ``` ```sh cargo burn-lm run llama3-2-1b --no-stats "Hello, world!" ``` -------------------------------- ### Chat Completions (Streaming SSE) Source: https://context7.com/tracel-ai/burn-lm/llms.txt This endpoint provides chat completions using Server-Sent Events (SSE) for real-time token generation. Set `stream` to `true`. Initial events indicate model loading status, followed by generated tokens, and a final `[DONE]` event. ```sh curl -N -X POST http://localhost:3001/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "Llama-3.2-1B-Instruct", "messages": [{"role": "user", "content": "Tell me a joke."}], "stream": true }' ``` -------------------------------- ### Scaffold New Model Crate Source: https://context7.com/tracel-ai/burn-lm/llms.txt Scaffold a new model crate pre-wired with an `InferenceServer` stub and automatically register it in `burn-lm-registry`. ```sh cargo burn-lm new ``` -------------------------------- ### Define FeedForward Network Configuration Source: https://github.com/tracel-ai/burn-lm/blob/main/burn-lm-book/src/new-model-implementation.md Use `#[derive(Config)]` to define the structure for a feed-forward network's configuration. This includes fields for model dimensions and supports default values and serialization. ```rust #[derive(Config, Debug)] /// Configuration to create a [feed-forward transformation network](FeedForward). pub struct FeedForwardConfig { /// The size of the model. pub d_model: usize, /// The size of the hidden inner features. pub hidden_size: usize, } impl FeedForwardConfig { /// Initialize a new [feed-forward transformation network](FeedForward). pub fn init(&self, device: &Device) -> FeedForward { let swiglu = SwiGluConfig::new(self.d_model, self.hidden_size) .with_bias(false) .init(device); let w2 = LinearConfig::new(self.hidden_size, self.d_model) .with_bias(false) .init(device); FeedForward { swiglu, w2 } } } ``` -------------------------------- ### Load Llama Models with LlamaConfig Source: https://context7.com/tracel-ai/burn-lm/llms.txt Utilize `LlamaConfig` for loading pre-trained Llama models. This abstracts hyperparameters and checkpoint loading. Supports loading various Llama variants and tokenizers. ```rust use burn::backend::NdArray; use burn_lm_llama::{LlamaConfig, Llama}; use burn_lm_llama::tokenizer::Tiktoken; type Backend = NdArray; // Load Llama-3.2-1B with Tiktoken tokenizer let device = burn::backend::ndarray::NdArrayDevice::Cpu; let llama: Llama = LlamaConfig::load_llama3_2_1b( "path/to/llama3_2_1b.mpk", // Burn NamedMpk checkpoint "path/to/tokenizer.model", // tiktoken .model file 512, // max_seq_len &device, ).expect("Failed to load Llama-3.2-1B"); // Tokenize input text let tokens = llama.tokenize("Hello, Burn LM!"); // Quantize model weights (int8 symmetric) use burn::tensor::quantization::{QuantScheme, QuantizationType, SymmetricQuantization}; let scheme = QuantScheme::PerTensorSymmetric(SymmetricQuantization::new(QuantizationType::QInt8)); let llama_quantized = llama.quantize(scheme); // Save model to disk use burn::record::NamedMpkFileRecorder; use burn::record::FullPrecisionSettings; let recorder = NamedMpkFileRecorder::::new(); lama_quantized.save("path/to/output_checkpoint", &recorder).unwrap(); ``` -------------------------------- ### Aggregate and Display Inference Statistics Source: https://context7.com/tracel-ai/burn-lm/llms.txt Use the `Stats` struct to collect performance entries like token count, inference duration, and model loading time. The `display_stats` method renders these into a markdown table. Ensure all necessary `StatEntry` variants are inserted. ```rust use burn_lm_inference::stats::{StatEntry, Stats}; use std::time::Duration; let mut stats = Stats::new(); stats.entries.insert(StatEntry::TokensCount(142)); stats.entries.insert(StatEntry::InferenceDuration(Duration::from_secs_f64(5.21))); stats.entries.insert(StatEntry::TokensPerSecond(142, Duration::from_secs_f64(5.21))); stats.entries.insert(StatEntry::ModelLoadingDuration(Duration::from_secs_f64(2.03))); stats.entries.insert(StatEntry::TotalDuration(Duration::from_secs_f64(7.24))); println!("{}", stats.display_stats()); ``` -------------------------------- ### List All Models Source: https://context7.com/tracel-ai/burn-lm/llms.txt Retrieves a JSON array of all registered models along with their associated metadata. ```APIDOC ## GET /v1/models ### Description Returns a JSON array of all registered models with their metadata. ### Method GET ### Endpoint /v1/models ### Request Example ```sh curl http://localhost:3001/v1/models ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the model. - **object** (string) - The type of object, always "model". - **created** (integer) - Timestamp of when the model was created. - **owned_by** (string) - The entity that owns the model. #### Response Example ```json [ { "id": "Llama-3.2-1B-Instruct", "object": "model", "created": 1727222400, "owned_by": "Meta" }, { "id": "TinyLlama-1.1B-Chat-v1.0", "object": "model", "created": 1703030400, "owned_by": "TinyLlama" } ] ``` ``` -------------------------------- ### Create Chat Completion (Non-Streaming) Source: https://context7.com/tracel-ai/burn-lm/llms.txt Provides an OpenAI-compatible endpoint for chat completions. It accepts a list of messages and optional sampling parameters, returning the full response in a single JSON payload. ```APIDOC ## POST /v1/chat/completions (Non-Streaming) ### Description OpenAI-compatible chat completions endpoint. Accepts a list of messages, optional sampling parameters (`temperature`, `top_p`, `max_tokens`, `seed`), and returns the complete response in a single JSON payload. ### Method POST ### Endpoint /v1/chat/completions ### Parameters #### Request Body - **model** (string) - Required - The ID of the model to use for completion. - **messages** (array) - Required - A list of message objects, each with a `role` (system, user, or assistant) and `content`. - **temperature** (number) - Optional - Controls randomness. Lower values make output more focused and deterministic. - **top_p** (number) - Optional - Controls diversity via nucleus sampling. Use with temperature. - **max_tokens** (integer) - Optional - The maximum number of tokens to generate in the completion. - **seed** (integer) - Optional - A seed for reproducible results. - **stream** (boolean) - Optional - Set to `false` for a single JSON response. ### Request Example ```json { "model": "Llama-3.2-1B-Instruct", "messages": [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "What is 2 + 2?"} ], "temperature": 0.7, "max_tokens": 256, "stream": false } ``` ### Response #### Success Response (200) - **id** (string) - Unique identifier for the completion. - **object** (string) - Type of object, "chat.completion". - **created** (integer) - Timestamp of creation. - **model** (string) - The model used for completion. - **choices** (array) - A list of completion choices. - **index** (integer) - Index of the choice. - **message** (object) - The generated message. - **role** (string) - Role of the message sender (assistant). - **content** (string) - The text content of the message. - **refusal** (null) - Placeholder for refusal information. - **finish_reason** (string) - The reason the model stopped generating tokens (e.g., "stop"). - **logprobs** (null) - Placeholder for log probabilities. - **usage** (object) - Token usage statistics. - **prompt_tokens** (integer) - Number of tokens in the prompt. - **completion_tokens** (integer) - Number of tokens in the completion. - **total_tokens** (integer) - Total tokens used. - **system_fingerprint** (string) - System fingerprint information. #### Response Example ```json { "id": "chatcmpl-a1b2c3d4", "object": "chat.completion", "created": 1716000000, "model": "Llama-3.2-1B-Instruct", "choices": [{ "index": 0, "message": {"role": "assistant", "content": "2 + 2 equals 4.", "refusal": null}, "finish_reason": "stop", "logprobs": null }], "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}, "system_fingerprint": "" } ``` ``` -------------------------------- ### Implement Forward Pass for FeedForward Source: https://github.com/tracel-ai/burn-lm/blob/main/burn-lm-book/src/new-model-implementation.md Implements the forward pass for the `FeedForward` module. It applies the SwiGlu activation followed by the linear layer. ```rust impl FeedForward { /// Applies the forward pass on the input tensor. /// /// # Shapes /// /// - input: `[batch_size, seq_length, d_model]` /// - output: `[batch_size, seq_length, d_model]` pub fn forward(&self, input: Tensor) -> Tensor { self.w2.forward(self.swiglu.forward(input)) } } ``` -------------------------------- ### Implement Custom Inference Server with InferenceServer Trait Source: https://context7.com/tracel-ai/burn-lm/llms.txt Implement the `InferenceServer` trait to register custom models. This allows models to be exposed through CLI commands and HTTP routes automatically. Ensure configuration is parsed correctly for both CLI and JSON inputs. ```rust use burn_lm_inference::{ inference_server_config, InferenceJob, InferenceResult, InferenceServer, InferenceServerConfig, ServerConfigParsing, Stats, }; use serde::Deserialize; // 1. Define the server configuration (maps to CLI flags and JSON request params) #[derive(clap::Parser, Deserialize, Debug, Clone, Default)] pub struct MyModelConfig { #[arg(long, default_value_t = 512)] pub max_tokens: usize, } impl InferenceServerConfig for MyModelConfig {} // 2. Implement the server #[derive(Clone, Default, Debug)] pub struct MyModelServer { config: MyModelConfig, loaded: bool, } impl ServerConfigParsing for MyModelServer { type Config = MyModelConfig; fn parse_cli_config(&mut self, args: &clap::ArgMatches) { use clap::FromArgMatches; self.config = MyModelConfig::from_arg_matches(args).unwrap_or_default(); } fn parse_json_config(&mut self, json: &str) { if let Ok(cfg) = serde_json::from_str(json) { self.config = cfg; } } } impl InferenceServer for MyModelServer { fn load(&mut self) -> InferenceResult> { // Load model weights here self.loaded = true; Ok(None) } fn is_loaded(&mut self) -> bool { self.loaded } fn unload(&mut self) -> InferenceResult> { self.loaded = false; Ok(None) } fn run_job(&mut self, job: InferenceJob) -> InferenceResult { // Stream generated tokens back via job.emitter job.emitter.completed(burn_lm_inference::GeneratedItem::Text( "Hello from MyModel!".to_string(), )); Ok(Stats::new()) } fn clear_state(&mut self) -> InferenceResult<()> { Ok(()) } } ``` -------------------------------- ### Chat Completions (Non-Streaming) Source: https://context7.com/tracel-ai/burn-lm/llms.txt An OpenAI-compatible endpoint for chat completions. It accepts messages and sampling parameters, returning the full response in a single JSON payload. Set `stream` to `false` for non-streaming responses. ```sh curl -X POST http://localhost:3001/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "Llama-3.2-1B-Instruct", "messages": [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "What is 2 + 2?"} ], "temperature": 0.7, "max_tokens": 256, "stream": false }' ``` -------------------------------- ### Define Transformer Model Configuration Source: https://github.com/tracel-ai/burn-lm/blob/main/burn-lm-book/src/new-model-implementation.md Define a composite configuration for a transformer model using `#[derive(Config)]`. This captures essential hyperparameters like vocabulary size, number of layers, model dimensions, and attention heads, with support for default values. ```rust /// Configuration to create a Llama [decoder-only transformer](Transformer). #[derive(Config, Debug)] pub struct TransformerConfig { /// The size of the vocabulary. pub vocab_size: usize, /// The number of transformer blocks. pub n_layers: usize, /// The size of the model. pub d_model: usize, /// The size of the feed-forward hidden inner features. pub hidden_size: usize, /// The number of heads. pub n_heads: usize, /// The number of key-value heads. pub n_kv_heads: usize, /// Maximum token sequence length. #[config(default = "512")] pub max_seq_len: usize, /// RMSNorm epsilon. #[config(default = "1e-5")] pub norm_eps: f64, } ``` -------------------------------- ### List All Registered Models Source: https://context7.com/tracel-ai/burn-lm/llms.txt This endpoint returns a JSON array of all models registered with the Burn-LM server, including their IDs and metadata. It's useful for discovering available models. ```sh curl http://localhost:3001/v1/models ``` -------------------------------- ### Implement Forward Pass for Transformer Source: https://github.com/tracel-ai/burn-lm/blob/main/burn-lm-book/src/new-model-implementation.md Implements the forward pass for the `Transformer` module, processing input embeddings through multiple layers with caching and masking. ```rust impl Transformer { pub fn forward( &self, input: Tensor, cache: &mut TransformerCache, pos_encoding: &PositionalEncodingState, mask: Option>, ) -> Tensor { let mut h = self.tok_embeddings.forward(input); for (layer, c) in self.layers.iter().zip(cache.layers.iter_mut()) { h = layer.forward(h, c, pos_encoding, mask.clone()); } let h = self.norm.forward(h); self.output.forward(h) } } ``` -------------------------------- ### Define FeedForward Module in Burn Source: https://github.com/tracel-ai/burn-lm/blob/main/burn-lm-book/src/new-model-implementation.md Defines a FeedForward module using Burn's `Module` trait. This struct contains a SwiGlu activation and an outer linear layer. ```rust /// Feed-forward transformation network. #[derive(Module, Debug)] pub struct FeedForward { // Swish gated linear unit with trainable parameters. swiglu: SwiGlu, /// Outer linear. w2: Linear, } ``` -------------------------------- ### Define Transformer Module in Burn Source: https://github.com/tracel-ai/burn-lm/blob/main/burn-lm-book/src/new-model-implementation.md Defines the main `Transformer` module, composing embedding, multiple transformer blocks, normalization, and an output linear layer. ```rust /// Llama decoder-only transformer. #[derive(Module, Debug)] pub struct Transformer { tok_embeddings: Embedding, layers: Vec>, norm: RmsNorm, output: Linear, } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.