MCPcopy Create free account

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

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

↓ 2 callersMethodget_qkv
( self, x: mx.array, offset: int = 0 )
mlx_lm/models/iquestloopcoder.py:91
↓ 2 callersFunctionget_system_fingerprint
()
mlx_lm/server.py:49
↓ 2 callersMethodget_token_score
(self, token_id: int)
mlx_lm/gguf.py:74
↓ 2 callersMethodget_token_type
( self, token_id: int, token_text: bytes, special_ids: Set[int] )
mlx_lm/gguf.py:67
↓ 2 callersFunctionhf_repo_to_path
(hf_repo)
mlx_lm/utils.py:259
↓ 2 callersMethodinsert_segments
( self, segments: List[List[List[int]]], max_tokens: Optional[List[int]] = None,
mlx_lm/generate.py:1607
↓ 2 callersMethodis_trimmable
(self)
mlx_lm/models/cache.py:821
↓ 2 callersFunctionjs_div_loss
(logits_q, logits_p)
mlx_lm/tuner/losses.py:785
↓ 2 callersFunctionlinear_to_lora_layers
Convert some of the models linear layers to lora layers. Args: model (nn.Module): The neural network model. num_layers (int)
mlx_lm/tuner/utils.py:38
↓ 2 callersMethodload
(self, model_path, adapter_path=None, draft_model_path=None)
mlx_lm/server.py:387
↓ 2 callersFunctionload_adapters
(model: nn.Module, adapter_path: str)
mlx_lm/utils.py:423
↓ 2 callersFunctionmedian
(data)
benchmarks/server_benchmark.py:111
↓ 2 callersMethodon_train_loss_report
(self, train_info: dict)
mlx_lm/tuner/callbacks.py:50
↓ 2 callersMethodon_val_loss_report
(self, val_info: dict)
mlx_lm/tuner/callbacks.py:57
↓ 2 callersFunctionpermute_weights
(weights, n_head, n_head_kv=None)
mlx_lm/gguf.py:133
↓ 2 callersMethodpipeline
(self, group)
mlx_lm/models/pipeline.py:18
↓ 2 callersMethodprepare
(self, **kwargs)
mlx_lm/models/cache.py:876
↓ 2 callersFunctionprint_help
()
mlx_lm/chat.py:118
↓ 2 callersFunctionprocess
(idx)
mlx_lm/quant/dwq.py:233
↓ 2 callersMethodprompt
Process prompt tokens through the model. Args: tokens: List of token sequences to process.
mlx_lm/generate.py:1124
↓ 2 callersFunctionqdq
(w, bits, group_size)
mlx_lm/quant/dynamic_quant.py:49
↓ 2 callersFunctionquantize_func
(w)
mlx_lm/quant/awq.py:414
↓ 2 callersMethodremove
(self, uids, return_prompt_caches=False)
mlx_lm/generate.py:1701
↓ 2 callersMethodremove
(self, model: Any, tokens: List[Any])
mlx_lm/models/cache.py:1641
↓ 2 callersFunctionrender_tools
(tools: List[Dict[str, Union[str, Dict[str, Any]]]])
mlx_lm/chat_templates/deepseek_v32.py:131
↓ 2 callersMethodreset
(self)
mlx_lm/tokenizer_utils.py:43
↓ 2 callersMethodrfind_think_start
(self, tokens, start=None, end=None)
mlx_lm/tokenizer_utils.py:377
↓ 2 callersFunctionsampler
(logprobs)
mlx_lm/sample_utils.py:63
↓ 2 callersFunctionsave_config
Save the model configuration to the ``config_path``. The final configuration will be sorted before saving for better readability. Args:
mlx_lm/utils.py:899
↓ 2 callersMethodset_embedding
(self, embedding: nn.Module)
mlx_lm/tuner/dora.py:194
↓ 2 callersMethodshard
(self, group: Optional[mx.distributed.Group] = None)
mlx_lm/models/qwen2.py:188
↓ 2 callersFunctionshare_files
(path, files, src, group=None)
mlx_lm/share.py:174
↓ 2 callersFunctionswapped_with_identity
(obj, func)
tests/test_finetune.py:23
↓ 2 callersFunctiontabulate
Inspired by: - stackoverflow.com/a/8356620/593036 - stackoverflow.com/questions/9535954/printing-lists-as-tabular-data
mlx_lm/manage.py:7
↓ 2 callersFunctiontarget_fn
(_, idx, split)
mlx_lm/quant/dwq.py:359
↓ 2 callersFunctionto_lora
(layer)
mlx_lm/tuner/utils.py:57
↓ 2 callersFunctiontokens_per_second
(tokens)
benchmarks/server_benchmark.py:43
↓ 2 callersFunctiontools_from_openai_format
(tools)
mlx_lm/chat_templates/deepseek_v32.py:75
↓ 2 callersMethodtrim
(self, n)
mlx_lm/models/cache.py:378
↓ 2 callersMethodtrim_to
( self, *, n_sequences: Optional[int] = None, n_bytes: Optional[int] = None )
mlx_lm/models/cache.py:1739
↓ 2 callersFunctionupdate
(cfg, **kwargs)
mlx_lm/quant/awq.py:42
↓ 2 callersFunctionyarn_find_correction_range
( low_rot, high_rot, dim, base=10000, max_position_embeddings=2048 )
mlx_lm/models/deepseek_v2.py:56
↓ 2 callersFunctionyarn_linear_ramp_mask
(min_val, max_val, dim)
mlx_lm/models/deepseek_v2.py:74
↓ 1 callersMethod__init__
( self, tokenizer, detokenizer_class=NaiveStreamingDetokenizer, eos_token_ids=
mlx_lm/tokenizer_utils.py:294
↓ 1 callersMethod__init__
(self, budget=0.5, iterations=25, sync_frequency=10)
mlx_lm/server.py:253
↓ 1 callersMethod__init__
( self, input_dims: int, output_dims: int, r: int = 8, dropout: float
mlx_lm/tuner/dora.py:58
↓ 1 callersMethod__init__
(self, config: ModelArgs)
mlx_lm/models/kimi_k25.py:43
↓ 1 callersMethod__init__
(self, input_dims: int, output_dims: int, num_heads: int)
mlx_lm/models/mla.py:10
↓ 1 callersMethod__init__
(self, config: ModelArgs)
mlx_lm/models/kimi_vl.py:71
↓ 1 callersMethod_block_sparse_attention
(self, queries, keys, values, scale, mask)
mlx_lm/models/phi3small.py:126
↓ 1 callersMethod_block_sparse_mask
(self, q_len, kv_len)
mlx_lm/models/phi3small.py:99
↓ 1 callersFunction_cast_square_sum
(x)
mlx_lm/models/minimax.py:40
↓ 1 callersFunction_complete_square
(x2, y2, xy)
mlx_lm/models/gemma4_text.py:90
↓ 1 callersFunction_compute_gate
(query: mx.array, weight: mx.array, bias: mx.array)
mlx_lm/models/iquestloopcoder.py:17
↓ 1 callersMethod_compute_vocab_mods
(self)
mlx_lm/models/longcat_flash_ngram.py:70
↓ 1 callersMethod_conv
( self, conv_input: mx.array, cache: Optional[ArraysCache], mask: Optional[mx.
mlx_lm/models/falcon_h1.py:236
↓ 1 callersMethod_conv
( self, conv_input: mx.array, cache: Optional[ArraysCache], mask: Optional[mx.
mlx_lm/models/granitemoehybrid.py:123
↓ 1 callersMethod_conv
( self, conv_input: mx.array, cache: Optional[ArraysCache], mask: Optional[mx.
mlx_lm/models/mamba2.py:97
↓ 1 callersMethod_conv
( self, conv_input: mx.array, cache: Optional[ArraysCache], mask: Optional[mx.
mlx_lm/models/plamo2.py:101
↓ 1 callersMethod_conv
( self, conv_input: mx.array, cache: Optional[ArraysCache], mask: Optional[mx.
mlx_lm/models/nemotron_h.py:134
↓ 1 callersFunction_convert_param_value
Convert parameter value based on its type in the schema.
mlx_lm/tool_parsers/qwen3_coder.py:36
↓ 1 callersFunction_convert_param_value_with_types
(value: str, param_types: list[str])
mlx_lm/tool_parsers/minimax_m2.py:88
↓ 1 callersMethod_copy
(self)
mlx_lm/generate.py:1082
↓ 1 callersMethod_decode_bytes
(self, seq)
mlx_lm/tokenizer_utils.py:185
↓ 1 callersFunction_decode_value
(key: str, value: str, string: str)
mlx_lm/chat_templates/deepseek_v32.py:116
↓ 1 callersFunction_deserialize
(value: str)
mlx_lm/tool_parsers/longcat.py:37
↓ 1 callersFunction_deserialize
(value: str)
mlx_lm/tool_parsers/kimi_k2.py:27
↓ 1 callersFunction_draft_generate
(y, num_draft)
mlx_lm/generate.py:593
↓ 1 callersFunction_extract_types_from_schema
Extract all possible types from a JSON schema definition. Handles anyOf, oneOf, allOf, type arrays, and enum fields. Args: schem
mlx_lm/tool_parsers/minimax_m2.py:27
↓ 1 callersFunction_ffn_mult_to_intermediate_size
Calculates intermediate size based on multiplier, rounding up to multiple of 256.
mlx_lm/models/nemotron-nas.py:85
↓ 1 callersFunction_find_multiple
Finds the smallest multiple of k greater than or equal to n.
mlx_lm/models/nemotron-nas.py:78
↓ 1 callersMethod_format
(self, tc)
mlx_lm/server.py:61
↓ 1 callersFunction_gated_delta_step_ops
Ops-based reference implementation for a single recurrent step. Shapes: - q, k: [B, H, Dk] - v: [B, H, Dv] - g: [B, H] or
mlx_lm/models/gated_delta.py:127
↓ 1 callersFunction_gemma4_args_to_json
Convert Gemma 4 tool call args to valid JSON. Gemma 4 uses unquoted keys and <|"|> as string delimiters instead of standard double quotes.
mlx_lm/tool_parsers/gemma4.py:23
↓ 1 callersFunction_get_arguments_config
Extract argument configuration for a function.
mlx_lm/tool_parsers/qwen3_coder.py:22
↓ 1 callersFunction_get_llama_4_attn_scale
(size, offset, beta: float, max_position_embeddings: int)
mlx_lm/models/ministral3.py:42
↓ 1 callersMethod_get_ngram_ids
( self, input_ids: mx.array, shifted_ids: Dict[int, mx.array], vocab_mods: Lis
mlx_lm/models/longcat_flash_ngram.py:94
↓ 1 callersFunction_get_param_types_from_config
(param_name: str, param_config: dict)
mlx_lm/tool_parsers/minimax_m2.py:152
↓ 1 callersMethod_get_slopes
(self)
mlx_lm/models/bailing_moe_linear.py:260
↓ 1 callersFunction_group_expert_select
( gates: mx.array, bias: Optional[mx.array], top_k: int, n_group: int, topk_group: int,
mlx_lm/models/kimi_linear.py:76
↓ 1 callersFunction_infer_thinking
(tokenizer)
mlx_lm/tokenizer_utils.py:256
↓ 1 callersFunction_infer_tool_parser
Attempt to auto-infer a tool parser from the chat template.
mlx_lm/tokenizer_utils.py:548
↓ 1 callersFunction_is_bpe_decoder
(decoder)
mlx_lm/tokenizer_utils.py:544
↓ 1 callersFunction_is_spm_decoder
(decoder)
mlx_lm/tokenizer_utils.py:519
↓ 1 callersFunction_is_spm_decoder_no_space
(decoder)
mlx_lm/tokenizer_utils.py:532
↓ 1 callersFunction_is_string_type
( tool_name: str, arg_name: str, tools: list[Any] | None, )
mlx_lm/tool_parsers/longcat.py:19
↓ 1 callersFunction_js_div_loss
(logits_q, logits_p)
mlx_lm/tuner/losses.py:751
↓ 1 callersFunction_kl_div_loss
(logits_q, logits_p)
mlx_lm/tuner/losses.py:345
↓ 1 callersMethod_load
(self, model_path, adapter_path=None, draft_model_path=None)
mlx_lm/server.py:326
↓ 1 callersFunction_lstrip
Truncate the prefix of the string after the first occurrence of pattern.
mlx_lm/evaluate.py:41
↓ 1 callersMethod_make_batch
(self, n: int)
mlx_lm/generate.py:1735
↓ 1 callersFunction_make_js_backward_kernel
()
mlx_lm/tuner/losses.py:575
↓ 1 callersFunction_make_js_forward_kernel
()
mlx_lm/tuner/losses.py:389
↓ 1 callersFunction_make_kl_backward_kernel
()
mlx_lm/tuner/losses.py:179
↓ 1 callersFunction_make_kl_forward_kernel
()
mlx_lm/tuner/losses.py:11
↓ 1 callersMethod_make_masks
(self, h, cache)
mlx_lm/models/gemma4_text.py:503
↓ 1 callersMethod_make_new_cache
(self)
mlx_lm/generate.py:1657
↓ 1 callersFunction_make_wkv7_kernel
()
mlx_lm/models/rwkv7.py:48
↓ 1 callersFunction_merge_caches
(caches)
mlx_lm/generate.py:870
↓ 1 callersFunction_mix_attention
( gate: mx.array, attn_global: mx.array, attn_local: mx.array )
mlx_lm/models/iquestloopcoder.py:29
← previousnext →301–400 of 2,622, ranked by callers