Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/cartesia-one/csm.rs
/ functions
Functions
91 in github.com/cartesia-one/csm.rs
⨍
Functions
91
◇
Types & classes
38
↓ 8 callers
Method
add_kv
(self, key: str, value_type: int, value)
scripts/quantize.py:64
↓ 8 callers
Method
forward
(&self, xs: &Tensor)
csm-core/csm_quantized_impl.rs:155
↓ 6 callers
Method
forward
( &mut self, xs: &Tensor, attention_mask: Option<&Tensor>, seqlen_offset: usiz
csm-core/csm_full_impl.rs:209
↓ 6 callers
Method
write_u32
(self, val: int)
scripts/quantize.py:50
↓ 5 callers
Method
config
(&self)
csm-core/model.rs:109
↓ 5 callers
Method
write_u64
(self, val: int)
scripts/quantize.py:53
↓ 3 callers
Method
add_tensor_info
(self, name: str, tensor: np.ndarray, dtype_str: str, override_shape=None)
scripts/quantize.py:67
↓ 3 callers
Function
read_string
(f)
scripts/show-gguf.py:30
↓ 3 callers
Function
rms_norm
(hidden_size: usize, eps: f64, vb: VarBuilder, tensor_name: &str)
csm-core/csm_full_impl.rs:132
↓ 3 callers
Method
write_string
(self, val: str)
scripts/quantize.py:59
↓ 2 callers
Method
clear_kv_cache
(&mut self)
csm-core/model.rs:68
↓ 2 callers
Method
decode_frames
(&mut self, frames: Vec<Vec<u32>>)
csm-core/lib.rs:467
↓ 2 callers
Method
ensure_kv_cache
Pre-allocate the KV cache buffers to avoid repeated concatenation.
csm-core/csm_quantized_impl.rs:216
↓ 2 callers
Method
ensure_kv_cache
Pre-allocate the KV cache buffers to avoid repeated concatenation.
csm-core/csm_full_impl.rs:191
↓ 2 callers
Function
generate_audio_blocking
( generator: &mut Generator, text: &str, speaker_id: u32, temperature: f64, top_k: usize,
csm-cli/benchmark.rs:15
↓ 2 callers
Method
generate_stream
( &'a mut self, text: &'a str, speaker_id: u32, max_audio_len_ms: f32,
csm-core/lib.rs:260
↓ 2 callers
Method
get_or_create_causal_mask
( &mut self, tgt_len: usize, seqlen_offset: usize, )
csm-core/csm_quantized_impl.rs:491
↓ 2 callers
Method
get_or_create_causal_mask
( &mut self, tgt_len: usize, seqlen_offset: usize, )
csm-core/csm_full_impl.rs:488
↓ 2 callers
Function
load_model_weights
(identifier: str, model_name: str, index_file: str)
scripts/match-models.py:22
↓ 2 callers
Function
rms_norm
(eps: f64, vb: &QVarBuilder, tensor_name: &str)
csm-core/csm_quantized_impl.rs:130
↓ 1 callers
Method
apply_rotary_emb_qkv_interleaved
( &self, q: &Tensor, k: &Tensor, seqlen_offset: usize, )
csm-core/csm_quantized_impl.rs:102
↓ 1 callers
Method
apply_rotary_emb_qkv_interleaved
( &self, q: &Tensor, k: &Tensor, seqlen_offset: usize, )
csm-core/csm_full_impl.rs:103
↓ 1 callers
Method
apply_rotary_emb_qkv_non_interleaved
( &self, q: &Tensor, k: &Tensor, seqlen_offset: usize, )
csm-core/csm_quantized_impl.rs:116
↓ 1 callers
Method
apply_rotary_emb_qkv_non_interleaved
( &self, q: &Tensor, k: &Tensor, seqlen_offset: usize, )
csm-core/csm_full_impl.rs:117
↓ 1 callers
Method
audio_tokens_and_mask
(&self, frame: Vec<u32>)
csm-core/model.rs:95
↓ 1 callers
Function
calculate_default_inv_freq
(cfg: &LlamaConfig)
csm-core/csm_quantized_impl.rs:57
↓ 1 callers
Function
calculate_default_inv_freq
(cfg: &LlamaConfig)
csm-core/csm_full_impl.rs:58
↓ 1 callers
Method
clear_kv_cache
(&mut self)
csm-core/csm_quantized_impl.rs:304
↓ 1 callers
Method
clear_kv_cache
(&mut self)
csm-core/csm_full_impl.rs:280
↓ 1 callers
Method
close
(self)
scripts/quantize.py:120
↓ 1 callers
Function
compare_by_content
(weights1: dict, weights2: dict, args)
scripts/match-models.py:158
↓ 1 callers
Function
compare_by_name
Compares models based on matching tensor names (keys).
scripts/match-models.py:94
↓ 1 callers
Function
create_wav_header
(sample_rate: u32, num_channels: u16, bits_per_sample: u16)
csm-server/main.rs:268
↓ 1 callers
Method
generate_frame
( &mut self, tokens: &Tensor, tokens_mask: &Tensor, input_pos: usize,
csm-core/model.rs:82
↓ 1 callers
Method
generate_to_channel
Synchronous generation that sends audio chunks through a std::sync::mpsc channel. Designed to be called from a blocking thread (e.g. tokio::task::spaw
csm-core/lib.rs:356
↓ 1 callers
Function
load_model_weights
(identifier: str, model_name: str, index_file: str)
scripts/quantize.py:123
↓ 1 callers
Function
main
()
scripts/show-gguf.py:51
↓ 1 callers
Function
main
()
scripts/match-models.py:216
↓ 1 callers
Function
main
()
scripts/quantize.py:285
↓ 1 callers
Function
main
()
scripts/test-api.py:58
↓ 1 callers
Function
main
()
scripts/show-safetensors.py:9
↓ 1 callers
Function
print_results
( total_duration: Duration, total_ttfb: Duration, total_audio_len_s: f64, num_runs: u32, b
csm-cli/benchmark.rs:189
↓ 1 callers
Function
quantize_q4_k
(tensor: torch.Tensor)
scripts/quantize.py:223
↓ 1 callers
Function
quantize_q8_0
(tensor: torch.Tensor)
scripts/quantize.py:194
↓ 1 callers
Function
read_value
(f, value_type)
scripts/show-gguf.py:34
↓ 1 callers
Function
run
()
csm-cli/main.rs:57
↓ 1 callers
Function
test_blocking
(client: OpenAI, text: str, output_path: Path)
scripts/test-api.py:8
↓ 1 callers
Function
test_streaming
(client: OpenAI, text: str, output_path: Path)
scripts/test-api.py:30
↓ 1 callers
Method
text_tokens_and_mask
(&self, ids: &[u32])
csm-core/model.rs:102
↓ 1 callers
Method
tokenize_text
(&self, text: &str, speaker_id: u32, template: Option<&str>)
csm-core/lib.rs:244
↓ 1 callers
Method
warm_kv_cache
Pre-allocate KV cache buffers for all layers so the first forward pass doesn't pay allocation cost.
csm-core/csm_full_impl.rs:481
↓ 1 callers
Method
write_f32
(self, val: float)
scripts/quantize.py:56
↓ 1 callers
Method
write_header
(self)
scripts/quantize.py:81
↓ 1 callers
Method
write_tensor_data
(self)
scripts/quantize.py:115
↓ 1 callers
Method
write_tensor_info
(self)
scripts/quantize.py:101
Method
__init__
(self, path: Path, arch: str)
scripts/quantize.py:43
Method
audio_tokens_and_mask
(&self, mut frame: Vec<u32>)
csm-core/csm_quantized_impl.rs:761
Method
audio_tokens_and_mask
(&self, mut frame: Vec<u32>)
csm-core/csm_full_impl.rs:750
Function
auth_middleware
( State(state): State<Arc<AppState>>, request: Request, next: Next, )
csm-server/main.rs:146
Method
config
(&self)
csm-core/csm_quantized_impl.rs:796
Method
config
(&self)
csm-core/csm_full_impl.rs:785
Function
convert_tensor_to_bytes
(tensor: candle_core::Tensor)
csm-server/main.rs:250
Function
default_max_audio_len_ms
()
csm-server/main.rs:76
Function
default_temperature
()
csm-server/main.rs:74
Function
default_top_k
()
csm-server/main.rs:75
Method
free_kv_cache
(&mut self)
csm-core/csm_quantized_impl.rs:309
Method
free_kv_cache
(&mut self)
csm-core/csm_full_impl.rs:286
Method
from_flavor
(flavor: Flavor)
csm-core/csm_quantized_impl.rs:27
Method
from_flavor
(flavor: Flavor)
csm-core/csm_full_impl.rs:26
Method
from_gguf
( cfg: &Config, p: P, device: &Device, )
csm-core/csm_quantized_impl.rs:551
Method
from_vb
(prefix: String, vb: &QVarBuilder)
csm-core/csm_quantized_impl.rs:142
Method
generate_frame
( &mut self, tokens: &Tensor, tokens_mask: &Tensor, input_pos: usize,
csm-core/csm_quantized_impl.rs:659
Method
generate_frame
( &mut self, tokens: &Tensor, tokens_mask: &Tensor, input_pos: usize,
csm-core/csm_full_impl.rs:647
Function
main
()
csm-server/main.rs:94
Function
main
()
csm-cli/main.rs:135
Function
main
()
csm-cli/benchmark.rs:104
Method
new
(args: GeneratorArgs)
csm-core/lib.rs:50
Method
new
(dtype: DType, cfg: &LlamaConfig, dev: &Device)
csm-core/csm_quantized_impl.rs:65
Method
new
(dtype: DType, cfg: &LlamaConfig, dev: &Device)
csm-core/csm_full_impl.rs:66
Method
new_full
(config: &Config, vb: VarBuilder, flavor: WeightMapFlavor)
csm-core/model.rs:52
Method
new_quantized
( config: &Config, path: P, device: &Device, )
csm-core/model.rs:56
Function
parse_dtype
(s: &str)
csm-server/main.rs:84
Function
parse_dtype
(s: &str)
csm-cli/main.rs:48
Function
parse_dtype
(s: &str)
csm-cli/benchmark.rs:94
Method
resolve_model_source
(args: &GeneratorArgs, api: &Api)
csm-core/lib.rs:158
Method
source_from_path
(path: &Path)
csm-core/lib.rs:236
Function
speech_handler
( State(state): State<Arc<AppState>>, Json(payload): Json<SpeechRequest>, )
csm-server/main.rs:173
Method
text_tokens_and_mask
(&self, ids: &[u32])
csm-core/csm_quantized_impl.rs:773
Method
text_tokens_and_mask
(&self, ids: &[u32])
csm-core/csm_full_impl.rs:762
Method
warm_kv_cache
Pre-allocate KV cache buffers for all layers.
csm-core/csm_quantized_impl.rs:484
Method
warm_kv_cache
(&mut self)
csm-core/model.rs:75