Repository Analysis

mlc-ai/mlc-llm

Universal LLM Deployment Engine with ML Compilation

14.7 Low AI signal View on GitHub
14.7
Adjusted Score
14.7
Raw Score
100%
Time Factor
2026-05-11
Last Push
22,731
Stars
Python
Language
84,939
Lines of Code
550
Files
677
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 68MEDIUM 96LOW 513

Pattern Findings

677 matches across 14 categories. Click a row to expand file-level details.

Hyper-Verbose Identifiers215 hits · 226 pts
SeverityFileLineSnippet
LOWpython/mlc_llm/__init__.py14def _create_socket_session_local_workers(num_workers):
LOWpython/mlc_llm/base.py26def _debug_cuda_profiler_start() -> None:
LOWpython/mlc_llm/base.py35def _debug_cuda_profiler_stop() -> None:
LOWpython/mlc_llm/json_ffi/engine.py26 def get_request_stream_callback(self) -> Callable[[str], None]:
LOWpython/mlc_llm/json_ffi/engine.py34 def _sync_request_stream_callback(self, chat_completion_stream_responses_json_str: str) -> None:
LOWpython/mlc_llm/bench/request_processor.py71 def _sample_from_plain_request_records(
LOWpython/mlc_llm/bench/request_processor.py94 def _sample_from_grouped_request_records(
LOWpython/mlc_llm/bench/request_processor.py274 def generate_fake_warmup_requests(
LOWpython/mlc_llm/bench/__main__.py34def _parse_num_concurrent_requests(num_str: Optional[str]) -> Optional[List[int]]: # noqa: UP006
LOWpython/mlc_llm/bench/request_record.py116def _compute_metrics_statistics(
LOWpython/mlc_llm/interface/gen_config.py28def apply_system_defaults_for_missing_fields(mlc_chat_config: MLCChatConfig) -> None:
LOWpython/mlc_llm/interface/compile.py62def _apply_preproc_to_params_and_check_pipeline(
LOWpython/mlc_llm/interface/calibrate.py106async def send_calibration_requests(
LOWpython/mlc_llm/interface/convert_weight.py68def _merge_lora_adapter_with_base_model(base_source: Path, lora_adapter: Path) -> Iterator[Path]:
LOWpython/mlc_llm/interface/router.py66 async def completion_stream_generator() -> AsyncGenerator[str, None]:
LOWpython/mlc_llm/op/triton.py495def _compute_expert_id_per_block(
LOWpython/mlc_llm/op/triton.py527 def tir_compute_expert_id_per_block(
LOWpython/mlc_llm/op/moe_misc.py35def _gating_topk_init_local_top_k(k_val, dtype, local_top_k, local_top_k_index):
LOWpython/mlc_llm/op/moe_misc.py42def _gating_topk_process_value(k_val, x, local_top_k, local_top_k_index, vi, vk):
LOWpython/mlc_llm/op/moe_misc.py162 def _get_topk_softmax_norm_func(k_val: int):
LOWpython/mlc_llm/op/moe_misc.py238def group_limited_greedy_topk(
LOWpython/mlc_llm/op/moe_misc.py306 def group_limited_mask_scores(
LOWpython/mlc_llm/op/mrope.py30def _split_indices_from_sizes(sizes: Sequence[int]) -> List[int]: # noqa: UP006
LOWpython/mlc_llm/op/mrope.py123def apply_multimodal_rotary_pos_emb(
LOWpython/mlc_llm/op/mrope.py263def _build_sequence_position_ids(
LOWpython/mlc_llm/op/ft_gemm.py11def faster_transformer_dequantize_gemm(
LOWpython/mlc_llm/op/ft_gemm.py95def faster_transformer_moe_gemm(
LOWpython/mlc_llm/compiler_pass/fuse_add_norm.py83def _get_add_rms_norm_prefill(hidden_size: int, eps: float, TX: int, in_dtype: str):
LOWpython/mlc_llm/compiler_pass/attach_logit_processor.py41def _get_apply_logit_bias_inplace_cpu():
LOWpython/mlc_llm/compiler_pass/attach_logit_processor.py43 def _apply_logit_bias_inplace(
LOWpython/mlc_llm/compiler_pass/attach_logit_processor.py72def _get_apply_logit_bias_inplace(target: tvm.target.Target):
LOWpython/mlc_llm/compiler_pass/attach_logit_processor.py79 def _apply_logit_bias_inplace(
LOWpython/mlc_llm/compiler_pass/attach_logit_processor.py112def _get_apply_penalty_inplace_cpu():
LOWpython/mlc_llm/compiler_pass/attach_logit_processor.py156def _get_apply_penalty_inplace(target: tvm.target.Target):
LOWpython/mlc_llm/compiler_pass/attach_logit_processor.py210def _get_apply_bitmask_inplace_cpu():
LOWpython/mlc_llm/compiler_pass/attach_logit_processor.py246def _get_apply_bitmask_inplace(target: tvm.target.Target):
LOWpython/mlc_llm/compiler_pass/attach_sampler.py69def _attach_multinomial_sampling_func(bb: relax.BlockBuilder):
LOWpython/mlc_llm/compiler_pass/attach_sampler.py153def _attach_sample_with_top_p(bb: relax.BlockBuilder):
LOWpython/mlc_llm/compiler_pass/attach_sampler.py235def _attach_renormalize_by_top_p(bb: relax.BlockBuilder, target: tvm.target.Target):
LOW…/mlc_llm/compiler_pass/attach_spec_decode_aux_funcs.py76def _add_scatter_hidden_states(bb: BlockBuilder, tensor_parallel_shards: int, dtype: str):
LOW…/mlc_llm/compiler_pass/attach_spec_decode_aux_funcs.py102def _add_gather_hidden_states(bb: BlockBuilder, tensor_parallel_shards: int, dtype: str):
LOW…c_llm/compiler_pass/attach_softmax_with_temperature.py101def _get_lse_and_softmax_func(target: tvm.target.Target, chunk_size: int, active_vocab_size: int):
LOW…hon/mlc_llm/compiler_pass/pipeline_parallel_rewrite.py249 def _prepare_stage_func_params_and_args(
LOW…hon/mlc_llm/compiler_pass/pipeline_parallel_rewrite.py368def _analyze_required_func_params(
LOW…on/mlc_llm/compiler_pass/dispatch_kv_cache_creation.py147 def create_tir_paged_kv_cache(
LOW…on/mlc_llm/compiler_pass/dispatch_kv_cache_creation.py187 def create_flashinfer_paged_kv_cache(
LOWpython/mlc_llm/protocol/conversation_protocol.py229def _strip_reasoning_in_history(
LOWpython/mlc_llm/protocol/conversation_protocol.py255def _combine_consecutive_messages(messages: List[Any]) -> List[Any]: # noqa: UP006
LOWpython/mlc_llm/protocol/mlc_chat_config.py65 def get_system_defaults_for_missing_fields(self) -> Dict[str, Any]: # noqa: UP006
LOWpython/mlc_llm/protocol/openai_api_protocol.py366 def check_function_call_usage(self, conv_template: Conversation) -> None:
LOWpython/mlc_llm/protocol/openai_api_protocol.py450def openai_api_get_unsupported_fields(
LOWpython/mlc_llm/protocol/error_protocol.py33async def bad_request_error_handler(_request: fastapi.Request, e: BadRequestError):
LOWpython/mlc_llm/cli/package.py26 def _parse_mlc_llm_source_dir(path: str) -> Path:
LOWpython/mlc_llm/cli/delivery.py219def _generate_model_delivery_diff(
LOWpython/mlc_llm/contrib/embeddings/openai.py146 async def _aget_len_safe_embeddings(
LOWpython/mlc_llm/quantization/per_tensor_quantization.py246 def _compute_quantized_tensor(weight: te.Tensor, scale: Optional[te.Tensor]) -> te.Tensor:
LOWpython/mlc_llm/quantization/model_quantization.py20def make_quantization_functions(
LOWpython/mlc_llm/quantization/block_scale_quantization.py735def broadcast_activation_scale(
LOWpython/mlc_llm/testing/debug_chat.py406 def _softmax_with_temperature(self, logits: np.ndarray, temperature: float):
LOWpython/mlc_llm/testing/debug_chat.py415 def _apply_presence_and_freq_penalty(
155 more matches not shown…
Cross-File Repetition43 hits · 215 pts
SeverityFileLineSnippet
HIGHpython/mlc_llm/nn/__init__.py0common `nn.modules` used to define llms in this project.
HIGHpython/mlc_llm/model/phi3/__init__.py0common `nn.modules` used to define llms in this project.
HIGHpython/mlc_llm/model/vision/__init__.py0common `nn.modules` used to define llms in this project.
HIGHpython/mlc_llm/quantization/group_quantization.py0override to() such that we do not convert bias if there is an out_dtype. otherwise, we might run into dtype mismatch whe
HIGHpython/mlc_llm/quantization/per_tensor_quantization.py0override to() such that we do not convert bias if there is an out_dtype. otherwise, we might run into dtype mismatch whe
HIGHpython/mlc_llm/quantization/ft_quantization.py0override to() such that we do not convert bias if there is an out_dtype. otherwise, we might run into dtype mismatch whe
HIGHpython/mlc_llm/quantization/block_scale_quantization.py0override to() such that we do not convert bias if there is an out_dtype. otherwise, we might run into dtype mismatch whe
HIGHpython/mlc_llm/quantization/block_scale_quantization.py0override to() such that we do not convert bias if there is an out_dtype. otherwise, we might run into dtype mismatch whe
HIGHpython/mlc_llm/quantization/awq_quantization.py0override to() such that we do not convert bias if there is an out_dtype. otherwise, we might run into dtype mismatch whe
HIGHpython/mlc_llm/model/llama4/llama4_model.py0the embedding module that can be shared with the final lm_head. from qwen2embedding.
HIGHpython/mlc_llm/model/olmo/olmo_model.py0the embedding module that can be shared with the final lm_head. from qwen2embedding.
HIGHpython/mlc_llm/model/llama/llama_model.py0the embedding module that can be shared with the final lm_head. from qwen2embedding.
HIGHpython/mlc_llm/model/llama4/llama4_model.py0the lm_head forwarding, which transposes the weight and multiplies with the input tensor.
HIGHpython/mlc_llm/model/ministral3/ministral3_model.py0the lm_head forwarding, which transposes the weight and multiplies with the input tensor.
HIGHpython/mlc_llm/model/cohere/cohere_model.py0the lm_head forwarding, which transposes the weight and multiplies with the input tensor.
HIGHpython/mlc_llm/model/gemma/gemma_model.py0the lm_head forwarding, which transposes the weight and multiplies with the input tensor.
HIGHpython/mlc_llm/model/olmo2/olmo2_model.py0the lm_head forwarding, which transposes the weight and multiplies with the input tensor.
HIGHpython/mlc_llm/model/olmo/olmo_model.py0the lm_head forwarding, which transposes the weight and multiplies with the input tensor.
HIGHpython/mlc_llm/model/phi3/phi3_model.py0the lm_head forwarding, which transposes the weight and multiplies with the input tensor.
HIGHpython/mlc_llm/model/qwen2/qwen2_model.py0the lm_head forwarding, which transposes the weight and multiplies with the input tensor.
HIGHpython/mlc_llm/model/minicpm/minicpm_model.py0the lm_head forwarding, which transposes the weight and multiplies with the input tensor.
HIGHpython/mlc_llm/model/qwen3/qwen3_model.py0the lm_head forwarding, which transposes the weight and multiplies with the input tensor.
HIGHpython/mlc_llm/model/nemotron/nemotron_model.py0the lm_head forwarding, which transposes the weight and multiplies with the input tensor.
HIGHpython/mlc_llm/model/llama/llama_model.py0the lm_head forwarding, which transposes the weight and multiplies with the input tensor.
HIGHpython/mlc_llm/model/phi3/phi3_loader.py0this file specifies how mlc's phi parameter maps from other formats, for example huggingface pytorch, huggingface safete
HIGHpython/mlc_llm/model/phi3v/phi3v_loader.py0this file specifies how mlc's phi parameter maps from other formats, for example huggingface pytorch, huggingface safete
HIGHpython/mlc_llm/model/phi/phi_loader.py0this file specifies how mlc's phi parameter maps from other formats, for example huggingface pytorch, huggingface safete
HIGHpython/mlc_llm/model/phi3/phi3_loader.py0returns a parameter mapping that maps from the names of mlc llm parameters to the names of phi-1/phi-1.5 huggingface pyt
HIGHpython/mlc_llm/model/phi3v/phi3v_loader.py0returns a parameter mapping that maps from the names of mlc llm parameters to the names of phi-1/phi-1.5 huggingface pyt
HIGHpython/mlc_llm/model/phi/phi_loader.py0returns a parameter mapping that maps from the names of mlc llm parameters to the names of phi-1/phi-1.5 huggingface pyt
HIGHpython/mlc_llm/model/qwen2/qwen2_loader.py0this file specifies how mlc's qwen2 parameter maps from other formats, for example huggingface pytorch, huggingface safe
HIGHpython/mlc_llm/model/qwen3/qwen3_loader.py0this file specifies how mlc's qwen2 parameter maps from other formats, for example huggingface pytorch, huggingface safe
HIGHpython/mlc_llm/model/qwen2_moe/qwen2_moe_loader.py0this file specifies how mlc's qwen2 parameter maps from other formats, for example huggingface pytorch, huggingface safe
HIGHpython/mlc_llm/model/qwen3_moe/qwen3_moe_loader.py0this file specifies how mlc's qwen2 parameter maps from other formats, for example huggingface pytorch, huggingface safe
HIGHpython/mlc_llm/model/rwkv5/rwkv5_model.py0same as llamaforcausallm, except for the use of sliding window attention.
HIGHpython/mlc_llm/model/mistral/mistral_model.py0same as llamaforcausallm, except for the use of sliding window attention.
HIGHpython/mlc_llm/model/rwkv6/rwkv6_model.py0same as llamaforcausallm, except for the use of sliding window attention.
HIGHpython/mlc_llm/serve/sync_engine.py0reset the engine, clean up all running data and metrics.
HIGHpython/mlc_llm/serve/sync_engine.py0reset the engine, clean up all running data and metrics.
HIGHpython/mlc_llm/serve/entrypoints/debug_entrypoints.py0reset the engine, clean up all running data and metrics.
HIGHtests/python/serve/test_serve_engine_spec.py0test engine **with continuous batching**. - add all requests to the engine altogether in the beginning. - all requests h
HIGHtests/python/serve/test_serve_engine_spec.py0test engine **with continuous batching**. - add all requests to the engine altogether in the beginning. - all requests h
HIGHtests/python/serve/test_serve_sync_engine.py0test engine **with continuous batching**. - add all requests to the engine altogether in the beginning. - all requests h
Decorative Section Separators56 hits · 204 pts
SeverityFileLineSnippet
MEDIUMversion.py16# ---------------------------------------------------
MEDIUMversion.py27# ---------------------------------------------------
MEDIUMpython/mlc_llm/op/triton.py173 # -----------------------------------------------------------
MEDIUMpython/mlc_llm/op/triton.py186 # ----------------------------------------------------------
MEDIUMpython/mlc_llm/op/triton.py218 # -----------------------------------------------------------
MEDIUMpython/mlc_llm/op/triton.py261 # -----------------------------------------------------------
MEDIUMpython/mlc_llm/model/qwen35/qwen35_model.py214# ============================================================================
MEDIUMpython/mlc_llm/model/qwen35/qwen35_model.py216# ============================================================================
MEDIUMpython/mlc_llm/model/qwen35/qwen35_model.py372# ============================================================================
MEDIUMpython/mlc_llm/model/qwen35/qwen35_model.py374# ============================================================================
MEDIUMpython/mlc_llm/model/qwen35/qwen35_model.py600# ============================================================================
MEDIUMpython/mlc_llm/model/qwen35/qwen35_model.py602# ============================================================================
MEDIUMtests/python/serve/test_embedding_engine.py65# ---------------------------------------------------------------------------
MEDIUMtests/python/serve/test_embedding_engine.py67# ---------------------------------------------------------------------------
MEDIUMtests/python/serve/test_embedding_engine.py76# ===================================================================
MEDIUMtests/python/serve/test_embedding_engine.py78# ===================================================================
MEDIUMtests/python/serve/test_embedding_engine.py94# ===================================================================
MEDIUMtests/python/serve/test_embedding_engine.py96# ===================================================================
MEDIUMtests/python/serve/test_embedding_engine.py114# ===================================================================
MEDIUMtests/python/serve/test_embedding_engine.py116# ===================================================================
MEDIUMtests/python/serve/test_embedding_engine.py147# ===================================================================
MEDIUMtests/python/serve/test_embedding_engine.py149# ===================================================================
MEDIUMtests/python/serve/test_embedding_engine.py169# ===================================================================
MEDIUMtests/python/serve/test_embedding_engine.py171# ===================================================================
MEDIUMtests/python/serve/test_embedding_engine.py183# ===================================================================
MEDIUMtests/python/serve/test_embedding_engine.py185# ===================================================================
MEDIUMtests/python/serve/test_embedding_engine.py222# ===================================================================
MEDIUMtests/python/serve/test_embedding_engine.py224# ===================================================================
MEDIUMtests/python/serve/test_embedding_engine.py26# ---------------------------------------------------------------------------
MEDIUMtests/python/serve/test_embedding_engine.py28# ---------------------------------------------------------------------------
MEDIUMtests/python/serve/test_embedding_engine.py204# ===================================================================
MEDIUMtests/python/serve/test_embedding_engine.py206# ===================================================================
MEDIUMtests/python/serve/test_embedding_engine.py334# ===================================================================
MEDIUMtests/python/serve/test_embedding_engine.py336# ===================================================================
MEDIUMtests/python/serve/server/test_embedding_server.py217# ===================================================================
MEDIUMtests/python/serve/server/test_embedding_server.py219# ===================================================================
MEDIUMtests/python/serve/server/test_embedding_server.py229# ===================================================================
MEDIUMtests/python/serve/server/test_embedding_server.py231# ===================================================================
MEDIUMtests/python/serve/server/test_embedding_server.py254# ===================================================================
MEDIUMtests/python/serve/server/test_embedding_server.py256# ===================================================================
MEDIUMtests/python/serve/server/test_embedding_server.py277# ===================================================================
MEDIUMtests/python/serve/server/test_embedding_server.py279# ===================================================================
MEDIUMtests/python/serve/server/test_embedding_server.py322# ===================================================================
MEDIUMtests/python/serve/server/test_embedding_server.py324# ===================================================================
MEDIUMtests/python/serve/server/test_embedding_server.py39# ---------------------------------------------------------------------------
MEDIUMtests/python/serve/server/test_embedding_server.py41# ---------------------------------------------------------------------------
MEDIUMtests/python/serve/server/test_embedding_server.py66# ---------------------------------------------------------------------------
MEDIUMtests/python/serve/server/test_embedding_server.py68# ---------------------------------------------------------------------------
MEDIUMtests/python/serve/server/test_embedding_server.py121# ---------------------------------------------------------------------------
MEDIUMtests/python/serve/server/test_embedding_server.py123# ---------------------------------------------------------------------------
MEDIUMtests/python/serve/server/test_embedding_server.py203# ===================================================================
MEDIUMtests/python/serve/server/test_embedding_server.py205# ===================================================================
MEDIUMtests/python/serve/server/test_embedding_server.py297# ===================================================================
MEDIUMtests/python/serve/server/test_embedding_server.py299# ===================================================================
MEDIUMtests/python/serve/server/test_embedding_server.py344# ===================================================================
MEDIUMtests/python/serve/server/test_embedding_server.py346# ===================================================================
Cross-Language Confusion (JS/TS)22 hits · 162 pts
SeverityFileLineSnippet
HIGHexamples/rest/nodejs/sample_client.js28 print('\n');
HIGHexamples/rest/nodejs/sample_client.js32print(color.BOLD + "Without streaming:" + color.END);
HIGHexamples/rest/nodejs/sample_client.js37print(color.GREEN + r.body.choices[0].message.content + color.END);
HIGHexamples/rest/nodejs/sample_client.js38print('\n');
HIGHexamples/rest/nodejs/sample_client.js41print(color.BOLD + "Reset chat" + color.END);
HIGHexamples/rest/nodejs/sample_client.js52print( color.BOLD + "With streaming:" + color.END);
HIGHexamples/rest/nodejs/sample_client.js62 print(color.GREEN + jsData.choices[0].delta.content + color.END);
HIGHexamples/rest/nodejs/sample_client.js68 print(color.BOLD + "Runtime stats:" + color.END + txtresp.body);
HIGHexamples/rest/nodejs/sample_langchain.ts26 print('\n');
HIGHexamples/rest/nodejs/sample_langchain.ts51 print(color.BOLD + input + "..." + color.END);
HIGHexamples/rest/nodejs/sample_langchain.ts55 print(color.GREEN + res.text + color.END);
HIGHexamples/rest/nodejs/sample_langchain.ts58 print(color.BOLD + input + "..." + color.END);
HIGHexamples/rest/nodejs/sample_langchain.ts62 print(color.GREEN + res.text + color.END);
HIGHexamples/rest/nodejs/sample_langchain.ts71print(color.BOLD + "Query: " + color.END + color.BLUE + query + color.END);
HIGHexamples/rest/nodejs/sample_langchain.ts74print(color.BOLD + "Response: " + color.END + color.GREEN + result.text + color.END);
HIGHexamples/rest/nodejs/sample_openai.js32 print('\n');
HIGHexamples/rest/nodejs/sample_openai.js37print(color.BOLD + "OpenAI chat completion example without streaming:" + color.END);
HIGHexamples/rest/nodejs/sample_openai.js46print(color.GREEN + completion.data.choices[0].message.content + color.END)
HIGHexamples/rest/nodejs/sample_openai.js53print(color.BOLD + "OpenAI chat completion example with streaming:" + color.END);
HIGHexamples/rest/nodejs/sample_openai.js63 print(color.GREEN + parsed.choices[0].delta.content + color.END);
HIGHexamples/rest/nodejs/sample_openai.js70 print(color.BOLD + "OpenAI completion example:" + color.END)
HIGHexamples/rest/nodejs/sample_openai.js73 print(color.GREEN + res.data.choices[0].text + color.END);
Unused Imports120 hits · 116 pts
SeverityFileLineSnippet
LOWpython/mlc_llm/__init__.py8
LOWpython/mlc_llm/__init__.py8
LOWpython/mlc_llm/__init__.py9
LOWpython/mlc_llm/__init__.py10
LOWpython/mlc_llm/__init__.py10
LOWpython/mlc_llm/tokenizers/__init__.py3
LOWpython/mlc_llm/tokenizers/__init__.py3
LOWpython/mlc_llm/tokenizers/__init__.py4
LOWpython/mlc_llm/json_ffi/__init__.py8
LOWpython/mlc_llm/nn/__init__.py3
LOWpython/mlc_llm/nn/__init__.py4
LOWpython/mlc_llm/nn/__init__.py4
LOWpython/mlc_llm/conversation_template/__init__.py8
LOWpython/mlc_llm/conversation_template/__init__.py8
LOWpython/mlc_llm/conversation_template/__init__.py8
LOWpython/mlc_llm/conversation_template/__init__.py8
LOWpython/mlc_llm/conversation_template/__init__.py8
LOWpython/mlc_llm/conversation_template/__init__.py8
LOWpython/mlc_llm/conversation_template/__init__.py8
LOWpython/mlc_llm/conversation_template/__init__.py8
LOWpython/mlc_llm/conversation_template/__init__.py8
LOWpython/mlc_llm/conversation_template/__init__.py8
LOWpython/mlc_llm/conversation_template/__init__.py8
LOWpython/mlc_llm/conversation_template/__init__.py8
LOWpython/mlc_llm/conversation_template/__init__.py8
LOWpython/mlc_llm/conversation_template/__init__.py8
LOWpython/mlc_llm/conversation_template/__init__.py8
LOWpython/mlc_llm/conversation_template/__init__.py8
LOWpython/mlc_llm/conversation_template/__init__.py8
LOWpython/mlc_llm/conversation_template/__init__.py8
LOWpython/mlc_llm/conversation_template/__init__.py8
LOWpython/mlc_llm/conversation_template/__init__.py8
LOWpython/mlc_llm/conversation_template/__init__.py8
LOWpython/mlc_llm/conversation_template/__init__.py8
LOWpython/mlc_llm/conversation_template/__init__.py8
LOWpython/mlc_llm/conversation_template/__init__.py8
LOWpython/mlc_llm/conversation_template/__init__.py8
LOWpython/mlc_llm/conversation_template/__init__.py8
LOWpython/mlc_llm/conversation_template/__init__.py8
LOWpython/mlc_llm/conversation_template/__init__.py8
LOWpython/mlc_llm/conversation_template/__init__.py38
LOWpython/mlc_llm/op/mrope.py3
LOWpython/mlc_llm/op/__init__.py3
LOWpython/mlc_llm/op/__init__.py3
LOWpython/mlc_llm/op/__init__.py4
LOWpython/mlc_llm/op/__init__.py5
LOWpython/mlc_llm/op/__init__.py6
LOWpython/mlc_llm/op/__init__.py6
LOWpython/mlc_llm/op/__init__.py6
LOWpython/mlc_llm/op/__init__.py7
LOWpython/mlc_llm/op/__init__.py8
LOWpython/mlc_llm/op/__init__.py8
LOWpython/mlc_llm/op/__init__.py8
LOWpython/mlc_llm/op/__init__.py8
LOWpython/mlc_llm/op/__init__.py14
LOWpython/mlc_llm/op/__init__.py15
LOWpython/mlc_llm/op/__init__.py15
LOWpython/mlc_llm/compiler_pass/blas_dispatch.py8
LOWpython/mlc_llm/compiler_pass/blas_dispatch.py9
LOWpython/mlc_llm/compiler_pass/__init__.py3
60 more matches not shown…
Deep Nesting106 hits · 106 pts
SeverityFileLineSnippet
LOWversion.py123
LOWpython/setup.py87
LOWpython/mlc_llm/__main__.py11
LOWpython/mlc_llm/json_ffi/engine.py38
LOWpython/mlc_llm/bench/dataset.py283
LOWpython/mlc_llm/bench/dataset.py735
LOWpython/mlc_llm/bench/evaluation/mmlu.py128
LOWpython/mlc_llm/interface/gen_config.py89
LOWpython/mlc_llm/interface/chat.py249
LOWpython/mlc_llm/op/moe_misc.py63
LOWpython/mlc_llm/op/moe_misc.py135
LOWpython/mlc_llm/op/moe_misc.py453
LOWpython/mlc_llm/op/moe_misc.py87
LOWpython/mlc_llm/op/moe_misc.py162
LOWpython/mlc_llm/op/moe_misc.py493
LOWpython/mlc_llm/op/moe_misc.py89
LOWpython/mlc_llm/op/moe_misc.py176
LOWpython/mlc_llm/op/moe_matmul.py12
LOWpython/mlc_llm/op/moe_matmul.py77
LOWpython/mlc_llm/op/moe_matmul.py179
LOWpython/mlc_llm/op/moe_matmul.py298
LOWpython/mlc_llm/op/moe_matmul.py385
LOWpython/mlc_llm/op/moe_matmul.py562
LOWpython/mlc_llm/op/moe_matmul.py50
LOWpython/mlc_llm/op/moe_matmul.py148
LOWpython/mlc_llm/op/moe_matmul.py237
LOWpython/mlc_llm/op/moe_matmul.py261
LOWpython/mlc_llm/op/moe_matmul.py351
LOWpython/mlc_llm/op/moe_matmul.py423
LOWpython/mlc_llm/op/moe_matmul.py633
LOWpython/mlc_llm/op/batch_spec_verify.py8
LOWpython/mlc_llm/op/batch_spec_verify.py59
LOWpython/mlc_llm/op/top_p_pivot.py11
LOWpython/mlc_llm/op/top_p_pivot.py268
LOWpython/mlc_llm/op/top_p_pivot.py53
LOWpython/mlc_llm/op/top_p_pivot.py301
LOWpython/mlc_llm/op/cutlass.py9
LOWpython/mlc_llm/compiler_pass/fuse_add_norm.py14
LOWpython/mlc_llm/compiler_pass/fuse_add_norm.py83
LOWpython/mlc_llm/compiler_pass/fuse_add_norm.py22
LOWpython/mlc_llm/compiler_pass/fuse_add_norm.py91
LOW…thon/mlc_llm/compiler_pass/lift_global_buffer_alloc.py156
LOW…hon/mlc_llm/compiler_pass/pipeline_parallel_rewrite.py35
LOW…hon/mlc_llm/compiler_pass/pipeline_parallel_rewrite.py105
LOWpython/mlc_llm/protocol/conversation_protocol.py120
LOWpython/mlc_llm/cli/delivery.py219
LOWpython/mlc_llm/cli/lib_delivery.py122
LOWpython/mlc_llm/cli/model_metadata.py88
LOWpython/mlc_llm/quantization/ft_quantization.py170
LOWpython/mlc_llm/testing/debug_chat.py98
LOWpython/mlc_llm/support/auto_device.py24
LOWpython/mlc_llm/support/auto_device.py52
LOWpython/mlc_llm/support/download_cache.py127
LOWpython/mlc_llm/loader/huggingface_loader.py208
LOWpython/mlc_llm/loader/huggingface_loader.py102
LOWpython/mlc_llm/loader/utils.py55
LOWpython/mlc_llm/loader/standard_loader.py23
LOWpython/mlc_llm/loader/standard_loader.py69
LOWpython/mlc_llm/model/qwen35/qwen35_loader.py36
LOWpython/mlc_llm/model/qwen35/qwen35_model.py219
46 more matches not shown…
Self-Referential Comments24 hits · 74 pts
SeverityFileLineSnippet
MEDIUMpython/setup.py76 """This class is needed in order to create OS specific wheels."""
MEDIUMpython/mlc_llm/json_ffi/engine.py84 # Create the background engine-driving thread and start the loop.
MEDIUMpython/mlc_llm/bench/request_processor.py85 # Create a new list so that the in-place shuffle does not mutate the input list.
MEDIUMpython/mlc_llm/bench/request_processor.py109 # Create a new list so that the in-place shuffle does not mutate the input list.
MEDIUMpython/mlc_llm/bench/dataset.py254 # Create a dummy ChatCompletionRequest.
MEDIUMpython/mlc_llm/bench/dataset.py576 # Create a dummy ChatCompletionRequest.
MEDIUM…hon/mlc_llm/compiler_pass/pipeline_parallel_rewrite.py164 # Create the param for the shape variables.
MEDIUMpython/mlc_llm/cli/router.py11 # Define a custom argument type for a list of strings
MEDIUMpython/mlc_llm/serve/sync_engine.py236 # Define the callback function for request generation results
MEDIUMpython/mlc_llm/serve/engine.py1343 # Create the request with the given id, input data, generation
MEDIUMpython/mlc_llm/serve/engine.py1350 # Create the unique async request stream of the request.
MEDIUMpython/mlc_llm/serve/engine.py1867 # Create the request with the given id, input data, generation
MEDIUMtests/python/serve/test_serve_engine_spec.py77 # Define the callback function for request generation results
MEDIUMtests/python/serve/test_serve_engine_spec.py141 # Define the callback function for request generation results
MEDIUMtests/python/serve/test_serve_engine_spec.py213 # Define the callback class for request generation results
MEDIUMtests/python/serve/test_serve_engine_spec.py295 # Define the callback class for request generation results
MEDIUMtests/python/serve/test_serve_engine_spec.py477 # Define the callback function for request generation results
MEDIUMtests/python/serve/test_serve_engine_spec.py536 # Define the callback function for request generation results
MEDIUMtests/python/serve/test_serve_engine_spec.py602 # Define the callback function for request generation results
MEDIUMtests/python/serve/test_serve_sync_engine.py75 # Define the callback function for request generation results
MEDIUMtests/python/serve/test_serve_sync_engine.py137 # Define the callback class for request generation results
MEDIUMtests/python/serve/test_serve_sync_engine.py217 # Define the callback class for request generation results
MEDIUMtests/python/serve/test_serve_sync_engine.py297 # Define the callback class for request generation results
MEDIUMtests/python/serve/test_serve_sync_engine.py409 # Define the callback class for request generation results
Slop Phrases12 hits · 39 pts
SeverityFileLineSnippet
MEDIUMtests/python/serve/test_serve_engine_spec.py67 # Hyperparameters for tests (you can try different combinations).
MEDIUMtests/python/serve/test_serve_engine_spec.py131 # Hyperparameters for tests (you can try different combinations).
MEDIUMtests/python/serve/test_serve_engine_spec.py201 # Hyperparameters for tests (you can try different combinations)
MEDIUMtests/python/serve/test_serve_engine_spec.py283 # Hyperparameters for tests (you can try different combinations)
MEDIUMtests/python/serve/test_serve_engine_spec.py467 # Hyperparameters for tests (you can try different combinations).
MEDIUMtests/python/serve/test_serve_engine_spec.py526 # Hyperparameters for tests (you can try different combinations).
MEDIUMtests/python/serve/test_serve_engine_spec.py592 # Hyperparameters for tests (you can try different combinations).
MEDIUMtests/python/serve/test_serve_sync_engine.py65 # Hyperparameters for tests (you can try different combinations).
MEDIUMtests/python/serve/test_serve_sync_engine.py125 # Hyperparameters for tests (you can try different combinations)
MEDIUMtests/python/serve/test_serve_sync_engine.py205 # Hyperparameters for tests (you can try different combinations)
MEDIUMtests/python/serve/test_serve_sync_engine.py284 # Hyperparameters for tests (you can try different combinations)
MEDIUMtests/python/serve/test_serve_sync_engine.py398 # Hyperparameters for tests (you can try different combinations)
Redundant / Tautological Comments18 hits · 27 pts
SeverityFileLineSnippet
LOW…on/mlc_llm/compiler_pass/dispatch_kv_cache_creation.py30 # Check if attn_kind is a single value or a list with length of hidden layers
LOWpython/mlc_llm/serve/embedding_engine.py128 # Check if the post-processor actually appends a special token at the end
LOWpython/mlc_llm/serve/server/popen_server.py147 # Check if the subprocess terminates unexpectedly or
LOWtests/python/json_ffi/test_json_ffi_engine_image.py62 # Print output.
LOWtests/python/json_ffi/test_json_ffi_engine.py81 # Print output.
LOWtests/python/json_ffi/test_json_ffi_engine.py140 # Print output.
LOWtests/python/serve/test_serve_engine_rnn.py45 # Print output.
LOWtests/python/serve/test_serve_engine.py46 # Print output.
LOWtests/python/serve/test_serve_engine.py91 # Print output.
LOWtests/python/serve/test_serve_engine.py135 # Print output.
LOWtests/python/serve/test_serve_engine.py179 # Print output.
LOWtests/python/serve/test_serve_engine.py222 # Print output.
LOWtests/python/serve/test_serve_async_engine_spec.py69 # Print output.
LOWtests/python/serve/test_serve_async_engine.py66 # Print output.
LOWtests/python/serve/test_serve_async_engine.py117 # Print output.
LOWtests/python/serve/test_serve_async_engine.py167 # Print output.
LOWtests/python/serve/test_serve_async_engine.py217 # Print output.
LOWtests/python/serve/test_serve_async_engine.py266 # Print output.
Over-Commented Block26 hits · 26 pts
SeverityFileLineSnippet
LOW.pre-commit-config.yaml1# To use:
LOWpyproject.toml1# Licensed to the Apache Software Foundation (ASF) under one
LOWpython/mlc_llm/interface/router.py81 output_texts = [""] * request.n
LOW…c_llm/compiler_pass/attach_softmax_with_temperature.py101def _get_lse_and_softmax_func(target: tvm.target.Target, chunk_size: int, active_vocab_size: int):
LOWpython/mlc_llm/protocol/conversation_protocol.py41 # the system message below.
LOWpython/mlc_llm/cli/worker.py1# Licensed to the Apache Software Foundation (ASF) under one
LOWpython/mlc_llm/cli/disco_remote_socket_session.py1# Licensed to the Apache Software Foundation (ASF) under one
LOWpython/mlc_llm/model/model_preset.py1581 # "architectures": ["BertModel"],
LOWpython/mlc_llm/model/model_preset.py1981 "vocab_size": 49152,
LOWpython/mlc_llm/model/model_preset.py2001 # "rms_norm_eps": 1e-05,
LOWtests/python/conftest.py1# Licensed to the Apache Software Foundation (ASF) under one
LOWios/MLCSwift/Sources/ObjC/LLMEngine.mm1//
LOW…gineExample/MLCEngineExample/MLCEngineExampleApp.swift1// This is a minimum example App to interact with MLC Engine
LOWcpp/base.h1/*!
LOWcpp/tokenizers/tokenizers.h1/*!
LOWcpp/json_ffi/openai_api_protocol.h1/*!
LOWcpp/json_ffi/conv_template.h1#ifndef MLC_LLM_JSON_FFI_CONV_TEMPLATE_H
LOWcpp/serve/config.h1/*!
LOWcpp/serve/data.h1/*!
LOWcpp/serve/model.h1/*!
LOWcpp/serve/prefix_cache.h1/*!
LOWcpp/serve/request_state.h1/*!
LOWcpp/serve/function_table.h1/*!
LOWexamples/rest/python/sample_langchain.py161
LOWandroid/mlc4j/src/cpp/tvm_runtime.h1#define TVM_USE_LIBBACKTRACE 0
LOWandroid/mlc4j/src/cpp/tvm_runtime.h21#include <runtime/cpu_device_api.cc>
Excessive Try-Catch Wrapping24 hits · 24 pts
SeverityFileLineSnippet
LOWpython/mlc_llm/json_ffi/engine.py70 except Exception as exception:
LOWpython/mlc_llm/bench/api_endpoint.py139 except Exception:
LOWpython/mlc_llm/bench/api_endpoint.py269 except Exception:
LOWpython/mlc_llm/bench/api_endpoint.py383 except Exception:
LOWpython/mlc_llm/bench/__main__.py125 except Exception:
LOWpython/mlc_llm/interface/gen_config.py212 except Exception:
LOWpython/mlc_llm/interface/gen_config.py234 except Exception:
LOWpython/mlc_llm/interface/gen_config.py281 except Exception:
LOW…on/mlc_llm/compiler_pass/dispatch_kv_cache_creation.py236 except Exception as e:
LOWpython/mlc_llm/cli/delivery.py198 except Exception as exc:
LOWpython/mlc_llm/cli/check_device.py13 except Exception:
LOWpython/mlc_llm/cli/model_metadata.py175 except Exception:
LOWpython/mlc_llm/support/auto_device.py40 except Exception as err:
LOWpython/mlc_llm/support/auto_target.py119 except Exception as err:
LOWpython/mlc_llm/serve/engine.py1034 except Exception as err:
LOWpython/mlc_llm/serve/engine.py1233 except Exception as err:
LOWpython/mlc_llm/serve/engine.py1305 except Exception as err:
LOWpython/mlc_llm/serve/engine.py1381 except Exception as exception:
LOWpython/mlc_llm/serve/server/popen_server.py143 except Exception:
LOWpython/mlc_llm/serve/entrypoints/openai_entrypoints.py78 except Exception as exc:
LOWpython/mlc_llm/router/router.py304 except Exception as e:
LOWtests/python/integration/test_model_compile.py147 except Exception:
LOWscripts/check_url_validity.py36 except Exception as e:
MEDIUMscripts/check_url_validity.py37 print(f"Error connecting {url}, error: {e}")
Cross-Language Confusion3 hits · 18 pts
SeverityFileLineSnippet
HIGHpython/mlc_llm/serve/engine.py1354 stream.push(
HIGHpython/mlc_llm/serve/engine_base.py518 stream.push([output])
HIGHpython/mlc_llm/serve/engine_base.py545 stream.push(outputs)
AI Slop Vocabulary7 hits · 13 pts
SeverityFileLineSnippet
MEDIUMversion.py90 # Remove the v prefix, mainly to be robust
MEDIUMpython/setup.py76 """This class is needed in order to create OS specific wheels."""
MEDIUMpython/mlc_llm/interface/chat.py173 # TODO(mlc-team): possibly leverage debug option
LOWpython/mlc_llm/serve/engine.py1032 # for cancelled error, we can simply pass it through
LOWpython/mlc_llm/serve/engine.py1231 # for cancelled error, we can simply pass it through
LOWpython/mlc_llm/serve/engine.py1303 # for cancelled error, we can simply pass it through
LOWpython/mlc_llm/serve/engine.py1379 # for cancelled error, we can simply pass it through
Verbosity Indicators1 hit · 2 pts
SeverityFileLineSnippet
LOW…gineExample/MLCEngineExample/MLCEngineExampleApp.swift35 // Step 0: load the engine