MCPcopy Create free account

hub / github.com/ml-explore/mlx-lm / functions

Functions2,622 in github.com/ml-explore/mlx-lm

↓ 6 callersFunctionrprint
(*args, **kwargs)
mlx_lm/examples/sharded_generate.py:59
↓ 6 callersFunctionsave
( dst_path: Union[str, Path], src_path_or_repo: Union[str, Path], model: nn.Module, tokenizer:
mlx_lm/utils.py:925
↓ 6 callersFunctionssm_attn
SSD-SSM forward pass. Args: x: Input of shape (batch_size, seq_len, num_heads, head_dim). dt: Time deltas of shape (seq_len, num_
mlx_lm/models/ssm.py:115
↓ 6 callersFunctionssm_update
( hidden_states: mx.array, A_log: mx.array, B: mx.array, C: mx.array, D: mx.array, dt:
mlx_lm/models/ssm.py:217
↓ 6 callersFunctionto_json
(value: Any)
mlx_lm/chat_templates/deepseek_v32.py:68
↓ 5 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/gpt_oss.py:233
↓ 5 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/minimax.py:255
↓ 5 callersMethod__init__
(self, dim, hidden_dim)
mlx_lm/models/qwen3_moe.py:100
↓ 5 callersMethod__init__
(self, config: ModelArgs)
mlx_lm/models/plamo.py:109
↓ 5 callersMethod__init__
(self, dim, hidden_dim)
mlx_lm/models/gemma.py:91
↓ 5 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/granitemoe.py:185
↓ 5 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/ernie4_5_moe.py:239
↓ 5 callersMethod__init__
( self, dim: int, ff_dim: int, multiple_of: int, auto_adjust_ff_dim: b
mlx_lm/models/lfm2.py:174
↓ 5 callersMethod__init__
(self, dim, hidden_dim)
mlx_lm/models/qwen2_moe.py:100
↓ 5 callersMethod__init__
(self, dim, hidden_dim)
mlx_lm/models/stablelm.py:132
↓ 5 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/exaone.py:86
↓ 5 callersMethod__init__
(self, dim, hidden_dim)
mlx_lm/models/gemma2.py:112
↓ 5 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/iquestloopcoder.py:118
↓ 5 callersMethod__init__
(self, dim, hidden_dim)
mlx_lm/models/gemma3_text.py:115
↓ 5 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/hunyuan_v1_dense.py:137
↓ 5 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/Klear.py:215
↓ 5 callersMethod__init__
(self, dim, hidden_dim)
mlx_lm/models/cohere.py:106
↓ 5 callersMethod__init__
(self, args: ModelArgs, ffn_config: FFNConfig)
mlx_lm/models/nemotron-nas.py:218
↓ 5 callersMethod__init__
(self, dim, hidden_dim, bias)
mlx_lm/models/internlm3.py:151
↓ 5 callersMethod__init__
(self, dim, hidden_dim)
mlx_lm/models/internlm2.py:153
↓ 5 callersMethod__setattr__
(self, attr, value)
mlx_lm/tokenizer_utils.py:467
↓ 5 callersFunction_download
Ensures the model is available locally. If the path does not exist locally, it is downloaded from the Hugging Face Hub. Args: pa
mlx_lm/utils.py:218
↓ 5 callersMethod_temporal_order
Rearrange the cache into temporal order, slicing off the end if unused.
mlx_lm/models/cache.py:431
↓ 5 callersFunctionapply_xtc
Apply XTC sampling to the logits. Args: logits: The logits from the model's output. xtc_probability (float): Probability of
mlx_lm/sample_utils.py:241
↓ 5 callersFunctionbatch_generate
Generate responses for the given batch of prompts. Args: model (nn.Module): The language model. tokenizer (PreTrainedTokenizer
mlx_lm/generate.py:1887
↓ 5 callersMethodfilter
Filter the batch to keep only the specified indices.
mlx_lm/generate.py:1383
↓ 5 callersFunctiongated_delta_update
( q: mx.array, k: mx.array, v: mx.array, a: mx.array, b: mx.array, A_log: mx.array,
mlx_lm/models/gated_delta.py:262
↓ 5 callersMethodload
(self, model, adapter=None, draft_model=None)
tests/test_server.py:67
↓ 5 callersMethodmake_mask
( self, N: int, window_size: Optional[int] = None, return_array: bool = False )
mlx_lm/models/cache.py:1330
↓ 5 callersMethodmatch
(state, x)
mlx_lm/generate.py:990
↓ 5 callersFunctionprint_trainable_parameters
(model)
mlx_lm/tuner/utils.py:160
↓ 5 callersFunctionsharded_load
( repo, pipeline_group: Optional[mx.distributed.Group] = None, tensor_group: Optional[mx.distribut
mlx_lm/utils.py:505
↓ 5 callersFunctionyarn_get_mscale
(scale=1, mscale=1)
mlx_lm/models/deepseek_v2.py:68
↓ 4 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/telechat3.py:179
↓ 4 callersMethod__init__
(self, dim, hidden_dim)
mlx_lm/models/qwen2.py:88
↓ 4 callersMethod__init__
(self, dim, hidden_dim, use_bias=False)
mlx_lm/models/ernie4_5.py:84
↓ 4 callersMethod__init__
(self, dim, hidden_dim)
mlx_lm/models/cohere2.py:103
↓ 4 callersMethod__init__
(self, args: ModelArgs, layer_id: int)
mlx_lm/models/openelm.py:121
↓ 4 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/granite.py:93
↓ 4 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/gpt2.py:72
↓ 4 callersMethod__init__
(self, args)
mlx_lm/models/minicpm.py:35
↓ 4 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/qwen3_5.py:368
↓ 4 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/llama.py:106
↓ 4 callersMethod__init__
(self, args)
mlx_lm/models/minicpm3.py:153
↓ 4 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/olmo3.py:205
↓ 4 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/olmo2.py:104
↓ 4 callersMethod__init__
(self, config: ModelArgs)
mlx_lm/models/baichuan_m1.py:131
↓ 4 callersMethod__init__
(self, dim, hidden_dim)
mlx_lm/models/starcoder2.py:76
↓ 4 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/ministral3.py:115
↓ 4 callersMethod__init__
(self, dim, hidden_dim, bias=False)
mlx_lm/models/seed_oss.py:93
↓ 4 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/apertus.py:165
↓ 4 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/mixtral.py:185
↓ 4 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/gpt_bigcode.py:85
↓ 4 callersMethod__init__
(self, config: ModelArgs)
mlx_lm/models/phi.py:157
↓ 4 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/lille-130m.py:137
↓ 4 callersMethod__init__
(self, args)
mlx_lm/models/phi3small.py:199
↓ 4 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/nanochat.py:145
↓ 4 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/gpt_neox.py:91
↓ 4 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/glm.py:158
↓ 4 callersMethod__init__
(self, config: ModelArgs)
mlx_lm/models/youtu_llm.py:212
↓ 4 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/glm4.py:164
↓ 4 callersMethod__init__
(self, dim, hidden_dim)
mlx_lm/models/mimo.py:87
↓ 4 callersMethod__init__
(self, dim, hidden_dim)
mlx_lm/models/qwen3.py:93
↓ 4 callersMethod__init__
(self)
mlx_lm/models/switch_layers.py:153
↓ 4 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/mamba2.py:233
↓ 4 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/bitnet.py:97
↓ 4 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/phimoe.py:173
↓ 4 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/qwen.py:77
↓ 4 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/olmoe.py:177
↓ 4 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/nemotron.py:124
↓ 4 callersMethod__init__
(self, dim, hidden_dim)
mlx_lm/models/phi3.py:122
↓ 4 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/helium.py:156
↓ 4 callersMethod__init__
(self, dim, intermediate_size, activation=nn.silu)
mlx_lm/models/llama4_text.py:92
↓ 4 callersMethod__init__
(self, dim, hidden_dim)
mlx_lm/models/exaone4.py:99
↓ 4 callersMethod__new__
(cls, *args, **kwargs)
mlx_lm/models/cache.py:595
↓ 4 callersFunction_extend_cache
(cache_a, cache_b)
mlx_lm/generate.py:886
↓ 4 callersMethod_find
(self, tokens, sequence, start=None, end=None, reverse=False)
mlx_lm/tokenizer_utils.py:360
↓ 4 callersMethod_find_uids
(self, uids)
mlx_lm/generate.py:1670
↓ 4 callersFunction_make_gated_delta_kernel
(has_mask=False, vectorized=False)
mlx_lm/models/gated_delta.py:13
↓ 4 callersFunction_process_control_tokens
(ctx, token_stream)
mlx_lm/server.py:236
↓ 4 callersFunction_quantize
(quantization)
mlx_lm/utils.py:348
↓ 4 callersFunction_step
(input_tokens: mx.array, input_embeddings: Optional[mx.array] = None)
mlx_lm/generate.py:396
↓ 4 callersMethod_trim
(self, trim_size, v, append=None)
mlx_lm/models/cache.py:421
↓ 4 callersMethod_trim
(self, trim_size, v, append=None)
mlx_lm/models/cache.py:1152
↓ 4 callersMethodadd_token
(self, token)
mlx_lm/tokenizer_utils.py:46
↓ 4 callersFunctionapply_min_p
Apply min-p sampling to the logprobs. Min-p keeps all tokens that are above a minimum probability, scaled by the probability of the most
mlx_lm/sample_utils.py:155
↓ 4 callersFunctionapply_top_k
Sample from only the top K tokens ranked by probability. Args: logprobs: A vector of log probabilities. top_k (int): Top k t
mlx_lm/sample_utils.py:130
↓ 4 callersFunctionbuild_schedule
Build a learning rate schedule from the given config.
mlx_lm/tuner/utils.py:18
↓ 4 callersFunctionevaluate
( model, dataset, batch_size, num_batches, max_seq_length=2048, loss: callable = defau
mlx_lm/tuner/trainer.py:176
↓ 4 callersMethodextract
(self, idx)
mlx_lm/models/cache.py:873
↓ 4 callersFunctionfake_8bit_quant
(x, scale)
mlx_lm/models/afm7.py:157
↓ 4 callersMethodfinalize
(self)
mlx_lm/models/cache.py:880
↓ 4 callersFunctionget_total_parameters
(model)
mlx_lm/utils.py:196
↓ 4 callersFunctionkl_div_loss
(logits_q, logits_p)
mlx_lm/tuner/losses.py:377
↓ 4 callersFunctionload_data
(tokenizer, num_samples: int, sequence_length: int)
mlx_lm/quant/utils.py:8
← previousnext →101–200 of 2,622, ranked by callers