1pub use rlx_core::{
23 BertConfig, EmbedGgufKind, FlowBuildExt, GgufDirGuide, GgufModelFamily, GgufTensorNameResolver,
24 LlamaFamilyGgufResolver, LoadOpts, LoadWeightsOptions, LoadedWeights, NomicBertConfig,
25 NomicVisionConfig, PassThroughGgufResolver, Qwen35NativeGgufResolver, RegisteredFormat,
26 ResolveOpts, ResolveWeightsOptions, STANDARD_DEVICE_NAMES, WeightDrainPolicy,
27 WeightFormatRegistration, WeightLoader, WeightMap, WeightMapSource, arch_registry,
28 assert_gguf_family, config, dataprocessing, flow_bridge, flow_util, format_for_extension,
29 gguf_architecture_str, gguf_dir_guide, gguf_f32_bytes_estimate, gguf_family_for_arch,
30 gguf_resolve, gguf_runner_hint, gguf_support, into_compile_parts, is_standard_device,
31 list_registered_formats, lm, load_from_path, load_weight_map_resolved, load_weights_resolved,
32 open as open_weights, open_map, open_map_with, open_with, register_gguf_tensor_resolver,
33 register_weight_format, resolve_weights_file, resolve_weights_file_with_options,
34 validate_sam_device, validate_standard_device, vision_ops_ir, weight_loader, weight_map,
35 weight_registry, weights,
36};
37pub use rlx_flow::{BuiltModel, CompileProfile};
38
39#[cfg(feature = "bert")]
40pub mod bert {
41 pub use rlx_bert::bert::*;
42}
43#[cfg(feature = "bert")]
44pub mod bert_flow {
45 pub use rlx_bert::flow::*;
46}
47#[cfg(feature = "clinicalbert")]
48pub mod clinicalbert {
49 pub use rlx_clinicalbert::*;
50}
51#[cfg(feature = "nomic")]
52pub mod nomic {
53 pub use rlx_nomic::nomic::*;
54}
55#[cfg(feature = "nomic")]
56pub mod nomic_flow {
57 pub use rlx_nomic::flow::*;
58}
59#[cfg(feature = "vision")]
60pub mod vision {
61 pub use rlx_vision::vision::*;
62}
63#[cfg(feature = "vision")]
64pub mod vision_flow {
65 pub use rlx_vision::flow::*;
66}
67#[cfg(feature = "dinov2")]
68pub mod dinov2 {
69 pub use rlx_dinov2::*;
70}
71#[cfg(feature = "bioclip2")]
72pub mod bioclip2 {
73 pub use rlx_bioclip2::*;
74}
75#[cfg(feature = "embed")]
76pub mod embed {
77 pub use rlx_embed::*;
78}
79#[cfg(feature = "flux2")]
80pub mod flux2 {
81 pub use rlx_flux2::*;
82}
83#[cfg(feature = "diamond")]
84pub mod diamond {
85 pub use rlx_diamond::*;
86}
87#[cfg(feature = "qwen3")]
88pub mod qwen3 {
89 pub use rlx_qwen3::*;
90}
91#[cfg(feature = "qwen35")]
92pub mod qwen35 {
93 pub use rlx_qwen35::*;
94}
95#[cfg(feature = "qwen25-vl")]
96pub mod qwen25_vl {
97 pub use rlx_qwen25_vl::*;
98}
99#[cfg(feature = "llama32")]
100pub mod llama32 {
101 pub use rlx_llama32::*;
102}
103#[cfg(feature = "gemma")]
104pub mod gemma {
105 pub use rlx_gemma::*;
106}
107#[cfg(feature = "llada2")]
108pub mod llada2 {
109 pub use rlx_llada2::llada2::*;
110}
111#[cfg(feature = "llada2")]
112pub mod tide {
113 pub use rlx_llada2::tide::*;
114}
115#[cfg(feature = "sam")]
116pub mod sam {
117 pub use rlx_sam::*;
118}
119#[cfg(feature = "sam2")]
120pub mod sam2 {
121 pub use rlx_sam2::*;
122}
123#[cfg(feature = "sam3")]
124pub mod sam3 {
125 pub use rlx_sam3::*;
126}
127#[cfg(feature = "vjepa2")]
128pub mod vjepa2 {
129 pub use rlx_vjepa2::*;
130}
131#[cfg(feature = "wav2vec2-bert")]
132pub mod wav2vec2_bert {
133 pub use rlx_wav2vec2_bert::*;
134}
135#[cfg(feature = "wav2vec2-asr")]
136pub mod wav2vec2_asr {
137 pub use rlx_wav2vec2_asr::*;
138}
139#[cfg(feature = "diarize")]
140pub mod diarize {
141 pub use rlx_diarize::*;
142}
143#[cfg(feature = "whisper")]
144pub mod whisper {
145 pub use rlx_whisper::*;
146}
147#[cfg(feature = "vad")]
148pub mod vad {
149 pub use rlx_vad::*;
150}
151#[cfg(feature = "aec")]
152pub mod aec {
153 pub use rlx_aec::*;
154}
155#[cfg(feature = "voxtral")]
156pub mod voxtral {
157 pub use rlx_voxtral::*;
158}
159#[cfg(feature = "qwen3-asr")]
160pub mod qwen3_asr {
161 pub use rlx_qwen3_asr::*;
162}
163#[cfg(feature = "voxtral-tts")]
164pub mod voxtral_tts {
165 pub use rlx_voxtral_tts::*;
166}
167
168#[cfg(feature = "qwen3-tts")]
169pub mod qwen3_tts {
170 pub use rlx_qwen3_tts::*;
171}
172#[cfg(feature = "locateanything")]
173pub mod locateanything {
174 pub use rlx_locateanything::*;
175}
176#[cfg(feature = "ocr")]
177pub mod ocr {
178 pub use rlx_ocr::*;
179}
180#[cfg(feature = "neutts")]
181pub mod neutts {
182 pub use rlx_neutts::*;
183}
184#[cfg(feature = "orpheus")]
185pub mod orpheus {
186 pub use rlx_orpheus::*;
187}
188#[cfg(feature = "kittentts")]
189pub mod kittentts {
190 pub use rlx_kittentts::*;
191}
192#[cfg(feature = "florence2")]
193pub mod florence2 {
194 pub use rlx_florence2::*;
195}
196#[cfg(feature = "mimi")]
197pub mod mimi {
198 pub use rlx_mimi::*;
199}
200#[cfg(feature = "tsac")]
201pub mod tsac {
202 pub use rlx_tsac::*;
203}
204#[cfg(feature = "moshi")]
205pub mod moshi {
206 pub use rlx_moshi::*;
207}
208#[cfg(feature = "neutts")]
209pub use rlx_neutts::{
210 BackboneModel, DEFAULT_N_CTX, GenerationConfig, NeuCodecDecoder, NeuCodecEncoder, NeuTTS,
211 STOP_TOKEN, build_prompt, extract_ids,
212};
213
214#[deprecated(note = "use `rlx_models::ocr`")]
215#[cfg(feature = "ocr")]
216pub mod ocrs {
217 pub use rlx_ocr::*;
218}
219
220#[cfg(feature = "mistral")]
224pub mod mistral {
225 pub use rlx_mistral::*;
226}
227#[cfg(feature = "bonsai")]
228pub mod bonsai {
229 pub use rlx_bonsai::*;
230}
231#[cfg(feature = "minicpm5")]
232pub mod minicpm5 {
233 pub use rlx_minicpm5::*;
234}
235#[cfg(feature = "tinyllama")]
236pub mod tinyllama {
237 pub use rlx_tinyllama::*;
238}
239#[cfg(feature = "phi")]
240pub mod phi {
241 pub use rlx_phi::*;
242}
243#[cfg(feature = "omnicoder")]
244pub mod omnicoder {
245 pub use rlx_omnicoder::*;
246}
247#[cfg(feature = "granite")]
248pub mod granite {
249 pub use rlx_granite::*;
250}
251#[cfg(feature = "cohere")]
252pub mod cohere {
253 pub use rlx_cohere::*;
254}
255#[cfg(feature = "sam-ir")]
256pub mod mask_hyper_matmul_ir {
257 pub use rlx_sam_ir::mask_hyper_matmul_ir::*;
258}
259#[cfg(feature = "sam-ir")]
260pub mod mask_prompt_ir {
261 pub use rlx_sam_ir::mask_prompt_ir::*;
262}
263#[cfg(feature = "sam-ir")]
264pub mod mlp_relu_ir {
265 pub use rlx_sam_ir::mlp_relu_ir::*;
266}
267#[cfg(feature = "sam-ir")]
268pub mod twoway_transformer_ir {
269 pub use rlx_sam_ir::twoway_transformer_ir::*;
270}
271
272#[cfg(feature = "runner")]
273pub mod run;
274#[cfg(feature = "runner")]
275mod sam_runner;
276
277pub use rlx_core::flow_bridge::{
278 apply_compile_profile, compile_graph_encoder, compile_graph_legacy,
279 compile_graph_llama32_decode, compile_graph_llama32_prefill, compile_graph_qwen3_decode,
280 compile_graph_qwen3_prefill, compile_graph_qwen35_decode, compile_graph_qwen35_prefill,
281 compile_graph_sam, compile_graph_with_profile, load_compile_profile, profile_near_weights,
282};
283pub use rlx_core::flow_util::{
284 build_graph, built_from_graph, built_from_hir, built_from_hir_with_profile, compile_built,
285 compile_built_cpu, compile_graph_encoder_with_params, compile_graph_profile,
286 compile_graph_qwen3_prefill_with_params, compile_graph_qwen35_decode_with_params,
287 compile_graph_qwen35_prefill_with_params, compile_graph_sam_with_params, graph_from_built,
288 graph_from_hir,
289};
290
291#[cfg(feature = "bert")]
292pub use bert::build_bert_graph_sized;
293#[cfg(feature = "bert")]
294pub use bert_flow::{BertFlow, build_bert_built};
295#[cfg(feature = "diarize")]
296pub use diarize::{DiarizeConfig, DiarizeSession, SpeakerTurn as DiarizeSpeakerTurn};
297#[cfg(feature = "dinov2")]
298pub use dinov2::{
299 DinoV2Built, DinoV2Config, DinoV2Flow, DinoV2PreprocessWeights, build_dinov2_built,
300 build_dinov2_graph_sized,
301};
302#[cfg(feature = "embed")]
303pub use embed::{
304 Arch, BertTokenizer, EmbeddingModel, ImageEmbeddingModel, ModelArch, ModelInfo, Pooling,
305 RlxBertModel, RlxEmbed, RlxNomicModel, RlxVisionModel, TokenizedBatch, assemble_vision_hidden,
306 compile_model, detect_arch, embed_with_rlx, models_map,
307};
308#[cfg(feature = "flux2")]
309pub use flux2::{
310 DEFAULT_TEXT_ENCODER_LAYERS, Flux2CfgCombineFlow, Flux2CfgCombineGraph, Flux2Checkpoint,
311 Flux2Config, Flux2Flow, Flux2ForwardBuilt, Flux2ForwardGraph, Flux2ForwardInput,
312 Flux2GraphParams, Flux2PromptOutput, Flux2Session, Flux2SessionCache, Flux2SessionKey,
313 Flux2TextEncoderBuilt, Flux2TextEncoderFlow, Flux2VaeConfig, Flux2VaeDecoderFlow,
314 Flux2VaeEncoderFlow, Flux2VaeGraph, Flux2VaeWeights, Flux2Weights, build_flux2_cfg_combine_hir,
315 build_flux2_forward_graph, build_flux2_forward_hir, build_flux2_minimal_graph,
316 build_flux2_minimal_hir, build_flux2_text_encoder_hir, cfg_combine, compile_flux2_cfg_combine,
317 compile_flux2_forward, compile_flux2_forward_via_flow, compile_flux2_minimal,
318 compile_flux2_text_encoder_hir, download_flux2_repo, encode_flux2_prompt,
319 encode_prompt_embeds_default_layers, encode_prompt_padded, extract_flux2_vae_weights,
320 extract_flux2_weights, extract_text_encoder_weights, flux2_decode_packed_latents,
321 flux2_prefers_compiled_hir, flux2_prefers_compiled_te, flux2_rgb_to_u8,
322 flux2_transformer_forward, host_temb, load_and_apply_flux2_lora, load_flux2_vae_weights,
323 load_flux2_weights, load_rgb_planar, load_text_encoder_weights, parse_lora_scale,
324 prepare_latent_ids, prepare_text_ids, prepare_weight_map, resolve_text_encoder_dir,
325 resolve_tokenizer_path, resolve_transformer_config, resolve_vae_dir, tiny_text_encoder_config,
326};
327#[cfg(feature = "gemma")]
328pub use gemma::{
329 GemmaArch, GemmaConfig, GemmaFlow, GemmaGenerator, build_gemma_decode_graph_sized,
330 build_gemma_graph_sized, build_gemma_graph_sized_last_logits, build_gemma_graph_sized_packed,
331 encode_prompt as gemma_encode_prompt, encode_prompt_auto as gemma_encode_prompt_auto,
332 gemma_cfg_from_gguf, resolve_tokenizer_path as gemma_resolve_tokenizer_path,
333};
334#[cfg(feature = "llada2")]
335pub use llada2::{
336 LLaDA2MoeConfig, LLaDA2Runner, LLaDA2RunnerBuilder, LLaDA2Weights, build_llada2_forward_graph,
337 default_memory_budget_bytes, validate_device as validate_llada2_device,
338};
339#[cfg(feature = "llama32")]
340pub use llama32::{
341 Llama32Config, Llama32Flow, Llama32Generator, build_llama32_decode_graph_sized,
342 build_llama32_graph_sized, build_llama32_graph_sized_last_logits,
343 build_llama32_graph_sized_packed, encode_prompt as llama32_encode_prompt,
344 encode_prompt_auto as llama32_encode_prompt_auto, llama32_cfg_from_gguf,
345 resolve_tokenizer_path as llama32_resolve_tokenizer_path,
346};
347#[cfg(feature = "nomic")]
348pub use nomic::{build_nomic_diagnostic_graph, build_nomic_graph_sized};
349#[cfg(feature = "nomic")]
350pub use nomic_flow::{NomicFlow, build_nomic_built};
351#[cfg(feature = "ocr")]
352pub use ocr::{
353 BLACK_VALUE, DEFAULT_ALPHABET, DecodeMethod, DetectionParams, DimOrder, HF_DETECTION_RTEN,
354 HF_DETECTION_ST, HF_RECOGNITION_RTEN, HF_RECOGNITION_ST, ImageSource, OcrConfig, OcrEngine,
355 OcrEngineParams, OcrInput, OcrOutput, OcrRunner, OcrRunnerBuilder, RotatedRect, TextChar,
356 TextLine, TextWord, resolve_model_dir,
357};
358#[cfg(feature = "qwen3")]
359pub use qwen3::{
360 Qwen3Config, Qwen3Flow, Qwen3Generator, Qwen3PrefillOpts, Qwen3Speculator, SampleOpts,
361 build_qwen3_graph_sized, build_qwen3_prefill_built, sample_token,
362};
363#[cfg(feature = "qwen3-tts")]
364pub use qwen3_tts::{
365 HF_MODEL_ID_06B_CUSTOM as QWEN3_TTS_HF_MODEL_ID, PRESET_SPEAKERS as QWEN3_TTS_SPEAKERS,
366 Qwen3TtsBenchReport, Qwen3TtsConfig, Qwen3TtsRunner, Qwen3TtsWeightStore, TalkerEngine,
367};
368#[cfg(feature = "qwen35")]
369pub use qwen35::{
370 ChatMessage, ChatRole, MatWeight, Qwen35Config, Qwen35FullAttnLayer, Qwen35LayerFfn,
371 Qwen35LinearLayer, Qwen35MoeFfn, Qwen35MtpLayer, Qwen35PrefillOutput, Qwen35Runner,
372 Qwen35RunnerBuilder, Qwen35TrunkLayer, Qwen35Weights, build_qwen35_decode_graph,
373 build_qwen35_decode_hir_dynamic_ext, build_qwen35_graph_sized, build_qwen35_graph_sized_ext,
374 build_qwen35_graph_sized_stub, build_qwen35_prefill_cache_graph,
375 build_qwen35_prefill_cache_graph_ext, build_qwen35_prefill_cache_hir_dynamic_ext,
376 decode_step_feeds, encode_chat_auto, format_chatml, messages_from_prompt, mrope_prefill_feeds,
377 mrope_row_for_sections, mrope_slice_at_pos, mtp_draft_vocab_size, pack_input_ids,
378 parse_messages_json, recurrent_output_count, seed_cache_from_outputs,
379 supports_multimodal_mrope, synth as qwen35_synth, text_section_pos, validate_device,
380 zero_recurrent_inputs,
381};
382#[cfg(feature = "flux2")]
383pub use rlx_flux2::{Flux2Output, Flux2Runner, Flux2RunnerBuilder};
384#[cfg(feature = "runner")]
385pub use run::{
386 ConfigSource, DinoV2Output, DinoV2Runner, DinoV2RunnerBuilder, DinoV2Variant, Llama32Runner,
387 Llama32RunnerBuilder, LmRunner, ModelRunner, Precision, Qwen3Runner, Qwen3RunnerBuilder,
388 SamArch, SamPredictionAny, SamRunner, SamRunnerBuilder, Vjepa2Output, Vjepa2PoolOutput,
389 Vjepa2PredictOutput, Vjepa2Runner, Vjepa2RunnerBuilder, Wav2Vec2BertRunner,
390 Wav2Vec2BertRunnerBuilder, WeightFormat, debug_resolve_name, dispatch, dispatch_help,
391 list_mtp_keys, open_gguf_loader, open_loader, open_loader_resolved, open_loader_with_format,
392 register_runner, registered_runners, run_registered,
393};
394#[cfg(feature = "sam")]
395pub use sam::{
396 NeckWeights as SamNeckWeights, SamConfig, SamEncoderBuilt, SamEncoderConfig, SamEncoderFlow,
397 SamPreprocessWeights, apply_neck_host as sam_apply_neck_host,
398 assemble_patch_tokens as sam_assemble_patch_tokens, build_sam_encoder_built,
399 build_sam_encoder_graph, preprocess_image as sam_preprocess_image,
400};
401#[cfg(feature = "sam2")]
402pub use sam2::{
403 FpnLevel as Sam2FpnLevel, FpnNeckWeights as Sam2FpnNeckWeights, Sam2, Sam2Config,
404 Sam2DecoderConfig, Sam2FpnConfig, Sam2HieraConfig, Sam2ImageEncoderBuilt, Sam2ImageEncoderFlow,
405 Sam2ImagePrediction, Sam2MaskDecoderOutput, Sam2MaskDecoderWeights, Sam2MemoryAttentionWeights,
406 Sam2MemoryConfig, Sam2MemoryEncoderConfig, Sam2MemoryEncoderOutput, Sam2MemoryEncoderWeights,
407 Sam2PreprocessWeights, Sam2PromptEncoderOutput, Sam2PromptEncoderWeights,
408 Sam2TwoWayTransformerWeights, Sam2VideoState, apply_fpn_neck as sam2_apply_fpn_neck,
409 apply_fpn_neck_host as sam2_apply_fpn_neck_host,
410 assemble_patch_tokens as sam2_assemble_patch_tokens, build_sam2_image_encoder_built,
411 build_sam2_image_encoder_graph, mask_decoder_forward as sam2_mask_decoder_forward,
412 memory_attention_forward as sam2_memory_attention_forward,
413 memory_encoder_forward as sam2_memory_encoder_forward,
414 preprocess_image as sam2_preprocess_image,
415 prompt_encoder_forward as sam2_prompt_encoder_forward,
416 two_way_transformer_forward as sam2_two_way_transformer_forward,
417};
418#[cfg(feature = "sam3")]
419pub use sam3::{
420 Sam3, Sam3CompiledDecoder, Sam3Config, Sam3DetectorConfig, Sam3DetectorDecoderBuilt,
421 Sam3DetectorDecoderFlow, Sam3DetectorEncoderFlow, Sam3EncodedImage, Sam3ImagePrediction,
422 Sam3PreprocessWeights, Sam3TextConfig, Sam3TrackerConfig, Sam3VideoFramePrediction,
423 Sam3VideoState, Sam3VitConfig, assemble_patch_tokens as sam3_assemble_patch_tokens,
424 build_sam3_detector_decoder_built, build_sam3_detector_encoder_built,
425 build_sam3_detector_encoder_graph, forward_decoder_ir_on,
426 preprocess_image as sam3_preprocess_image,
427};
428#[cfg(feature = "llada2")]
429pub use tide::{
430 BlockDenoiseConfig, BlockDenoiseLoop, GenerateConfig, PredictiveOffloadInfo,
431 PredictiveOffloadParams, TideOffloadStats, TideRunner, aggregate_offload_stats,
432 refresh_experts,
433};
434#[cfg(feature = "vision")]
435pub use vision::{VisionPreprocessWeights, build_vision_graph_sized};
436#[cfg(feature = "vision")]
437pub use vision_flow::{NomicVisionBuilt, NomicVisionFlow, build_nomic_vision_built};
438#[cfg(feature = "vjepa2")]
439pub use vjepa2::{
440 Vjepa2Config, Vjepa2EncoderBuilt, Vjepa2EncoderFlow, Vjepa2EncoderOutput, Vjepa2EncoderWeights,
441 Vjepa2Masks, Vjepa2ModelWeights, Vjepa2PatchEmbedWeights, Vjepa2PoolerFlow,
442 Vjepa2PoolerWeights, Vjepa2PredictorFlow, Vjepa2PredictorWeights,
443 build_vjepa2_encoder_graph_sized, conv3d_patch_embed, encode_video_native,
444 extract_encoder_weights, extract_model_weights, extract_patch_embed_weights,
445 extract_pooler_weights, extract_predictor_weights, normalize_video_hwc, pool_native,
446 predict_native,
447};
448#[cfg(feature = "voxtral")]
449pub use voxtral::{
450 FAMILY as VOXTRAL_FAMILY, HF_MODEL_ID_MINI_3B, LanguageModelPrefixLoader,
451 MelSpectrogram as VoxtralMel, VoxtralAudioConfig, VoxtralConfig, VoxtralRunner,
452 VoxtralRunnerBuilder, VoxtralWeightPrefix, build_voxtral_decode_built,
453 build_voxtral_encoder_built, build_voxtral_prefill_built, build_voxtral_projector_built,
454 fuse_inputs_embeds, pcm_to_mel as voxtral_pcm_to_mel, transcription_prompt_ids,
455};
456#[cfg(feature = "voxtral-tts")]
457pub use voxtral_tts::{
458 CodecDecoder, HF_MODEL_ID as VOXTRAL_TTS_HF_MODEL_ID, PRESET_VOICES as VOXTRAL_TTS_VOICES,
459 VoxtralTtsBenchReport, VoxtralTtsConfig, VoxtralTtsRunner, VoxtralTtsWeightStore,
460};
461#[cfg(feature = "wav2vec2-asr")]
462pub use wav2vec2_asr::{AlignSession, AlignedWord, Wav2Vec2AsrConfig, align_model_for_language};
463#[cfg(feature = "wav2vec2-bert")]
464pub use wav2vec2_bert::{
465 LogMelExtractor, LogMelFeatures, Wav2Vec2BertConfig, Wav2Vec2BertFlow,
466 Wav2Vec2BertPreprocessConfig, build_wav2vec2_bert_built, build_wav2vec2_bert_graph_sized,
467 load_wav_mono_f32,
468};
469#[cfg(feature = "whisper")]
470pub use whisper::{
471 MelSpectrogram, SubtitleFormat, TranscriptSegment, WhisperConfig, WhisperDecoderFlow,
472 WhisperEncoderFlow, WhisperKvCache, WhisperPipeline, WhisperPipelineOpts, WhisperRunner,
473 WhisperRunnerBuilder, WhisperTranscript, WhisperWeightPrefix, WordAlignMode, WordTiming,
474 build_whisper_decode_step_built, build_whisper_decoder_built,
475 build_whisper_decoder_graph_sized, build_whisper_decoder_prefill_built,
476 build_whisper_encoder_built, build_whisper_encoder_graph_sized, default_mel_frames, pcm_to_mel,
477 to_json_pretty, to_srt, to_tsv, to_vtt,
478};