AI Slop Code RIsk Monitor

mlc-ai/mlc-llm

Universal LLM Deployment Engine with ML Compilation

20.6 Elevated pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for mlc-ai/mlc-llm, a Python project with 23,229 GitHub stars. SynthScan examined 90,104 lines of code across 572 source files, recording 958 pattern matches distributed across 19 syntactic categories. The legacy adjusted pattern signal is 20.6 (Elevated pattern signal); it is not an authorship estimate.

Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.

20.6
Adjusted Signal
20.6
Raw Pattern Score
100%
Time Factor
2026-10-06
Last Push
23.2K
Stars
Python
Language
90.1K
Lines of Code
572
Files
958
Pattern Hits
2026-10-12
Scan Date
0.25
HC Hit Rate

Risk Review · v3

Use each vector to guide manual verification of the underlying findings.

Cognitive Ownership Risk 30.1/100 · MEDIUM

Can maintainers explain intent, assumptions, and trade-offs? 515 finding(s).

Hallucinated Dependency & Supply Chain Risk 15.6/100 · LOW

Are imports declared and package/API names verified? 156 finding(s).

Agent Over-Engineering Ratio 48.6/100 · MEDIUM

Are wrappers, guards, and repeated structures necessary? 579 finding(s).

PR Review Velocity Impact 64.5/100 · HIGH

Which changes need focused human review? 958 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.

Severity Breakdown

Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.

CRITICAL 0HIGH 141MEDIUM 102LOW 715

Directory Score Breakdown

This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.

Pattern Findings

The scanner identified 958 distinct pattern matches across 19 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.

Cross-File Repetition107 hits · 535 pts
SeverityFileLineSnippetContext
HIGHpython/mlc_llm/nn/__init__.py0common `nn.modules` used to define llms in this project.STRING
HIGHpython/mlc_llm/model/phi3/__init__.py0common `nn.modules` used to define llms in this project.STRING
HIGHpython/mlc_llm/model/vision/__init__.py0common `nn.modules` used to define llms in this project.STRING
HIGHpython/mlc_llm/quantization/group_quantization.py0quantize model with awq quantization. parameters ---------- model : nn.module the non-quantized nn.module. quant_map : qSTRING
HIGHpython/mlc_llm/quantization/ft_quantization.py0quantize model with awq quantization. parameters ---------- model : nn.module the non-quantized nn.module. quant_map : qSTRING
HIGHpython/mlc_llm/quantization/block_scale_quantization.py0quantize model with awq quantization. parameters ---------- model : nn.module the non-quantized nn.module. quant_map : qSTRING
HIGHpython/mlc_llm/quantization/awq_quantization.py0quantize model with awq quantization. parameters ---------- model : nn.module the non-quantized nn.module. quant_map : qSTRING
HIGHpython/mlc_llm/quantization/group_quantization.py0the visiting method for fastertransformer quantization of nn.module nodes. parameters ---------- name : str the name of STRING
HIGHpython/mlc_llm/quantization/per_tensor_quantization.py0the visiting method for fastertransformer quantization of nn.module nodes. parameters ---------- name : str the name of STRING
HIGHpython/mlc_llm/quantization/ft_quantization.py0the visiting method for fastertransformer quantization of nn.module nodes. parameters ---------- name : str the name of STRING
HIGHpython/mlc_llm/quantization/group_quantization.py0forward method for per-tensor quantized embedding layer. parameters ---------- x : nn.tensor the input tensor. returns -STRING
HIGHpython/mlc_llm/quantization/per_tensor_quantization.py0forward method for per-tensor quantized embedding layer. parameters ---------- x : nn.tensor the input tensor. returns -STRING
HIGHpython/mlc_llm/quantization/ft_quantization.py0forward method for per-tensor quantized embedding layer. parameters ---------- x : nn.tensor the input tensor. returns -STRING
HIGHpython/mlc_llm/quantization/awq_quantization.py0forward method for per-tensor quantized embedding layer. parameters ---------- x : nn.tensor the input tensor. returns -STRING
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 wheSTRING
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 wheSTRING
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 wheSTRING
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 wheSTRING
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 wheSTRING
HIGHpython/mlc_llm/model/llama4/llama4_model.py0the embedding module that can be shared with the final lm_head. from qwen2embedding.STRING
HIGHpython/mlc_llm/model/olmo/olmo_model.py0the embedding module that can be shared with the final lm_head. from qwen2embedding.STRING
HIGHpython/mlc_llm/model/llama/llama_model.py0the embedding module that can be shared with the final lm_head. from qwen2embedding.STRING
HIGHpython/mlc_llm/model/llama4/llama4_model.py0the lm_head forwarding, which transposes the weight and multiplies with the input tensor.STRING
HIGHpython/mlc_llm/model/ministral3/ministral3_model.py0the lm_head forwarding, which transposes the weight and multiplies with the input tensor.STRING
HIGHpython/mlc_llm/model/cohere/cohere_model.py0the lm_head forwarding, which transposes the weight and multiplies with the input tensor.STRING
HIGHpython/mlc_llm/model/gemma/gemma_model.py0the lm_head forwarding, which transposes the weight and multiplies with the input tensor.STRING
HIGHpython/mlc_llm/model/olmo2/olmo2_model.py0the lm_head forwarding, which transposes the weight and multiplies with the input tensor.STRING
HIGHpython/mlc_llm/model/olmo/olmo_model.py0the lm_head forwarding, which transposes the weight and multiplies with the input tensor.STRING
HIGHpython/mlc_llm/model/phi3/phi3_model.py0the lm_head forwarding, which transposes the weight and multiplies with the input tensor.STRING
HIGHpython/mlc_llm/model/qwen2/qwen2_model.py0the lm_head forwarding, which transposes the weight and multiplies with the input tensor.STRING
HIGHpython/mlc_llm/model/minicpm/minicpm_model.py0the lm_head forwarding, which transposes the weight and multiplies with the input tensor.STRING
HIGHpython/mlc_llm/model/qwen3/qwen3_model.py0the lm_head forwarding, which transposes the weight and multiplies with the input tensor.STRING
HIGHpython/mlc_llm/model/nemotron/nemotron_model.py0the lm_head forwarding, which transposes the weight and multiplies with the input tensor.STRING
HIGHpython/mlc_llm/model/llama/llama_model.py0the lm_head forwarding, which transposes the weight and multiplies with the input tensor.STRING
HIGHpython/mlc_llm/model/llama4/llama4_loader.py0this file specifies how mlc's rwkv6 parameter maps from other formats, for example huggingface pytorch, huggingface safeSTRING
HIGHpython/mlc_llm/model/llama/llama_loader.py0this file specifies how mlc's rwkv6 parameter maps from other formats, for example huggingface pytorch, huggingface safeSTRING
HIGHpython/mlc_llm/model/ministral3/ministral3_loader.py0this file specifies how mlc's rwkv6 parameter maps from other formats, for example huggingface pytorch, huggingface safeSTRING
HIGHpython/mlc_llm/model/cohere/cohere_loader.py0this file specifies how mlc's rwkv6 parameter maps from other formats, for example huggingface pytorch, huggingface safeSTRING
HIGHpython/mlc_llm/model/starcoder2/starcoder2_loader.py0this file specifies how mlc's rwkv6 parameter maps from other formats, for example huggingface pytorch, huggingface safeSTRING
HIGHpython/mlc_llm/model/gemma/gemma_loader.py0this file specifies how mlc's rwkv6 parameter maps from other formats, for example huggingface pytorch, huggingface safeSTRING
HIGHpython/mlc_llm/model/olmo2/olmo2_loader.py0this file specifies how mlc's rwkv6 parameter maps from other formats, for example huggingface pytorch, huggingface safeSTRING
HIGHpython/mlc_llm/model/internlm/internlm_loader.py0this file specifies how mlc's rwkv6 parameter maps from other formats, for example huggingface pytorch, huggingface safeSTRING
HIGHpython/mlc_llm/model/gpt_neox/gpt_neox_loader.py0this file specifies how mlc's rwkv6 parameter maps from other formats, for example huggingface pytorch, huggingface safeSTRING
HIGHpython/mlc_llm/model/gemma2/gemma2_loader.py0this file specifies how mlc's rwkv6 parameter maps from other formats, for example huggingface pytorch, huggingface safeSTRING
HIGHpython/mlc_llm/model/mixtral/mixtral_loader.py0this file specifies how mlc's rwkv6 parameter maps from other formats, for example huggingface pytorch, huggingface safeSTRING
HIGHpython/mlc_llm/model/olmo/olmo_loader.py0this file specifies how mlc's rwkv6 parameter maps from other formats, for example huggingface pytorch, huggingface safeSTRING
HIGHpython/mlc_llm/model/phi3/phi3_loader.py0this file specifies how mlc's rwkv6 parameter maps from other formats, for example huggingface pytorch, huggingface safeSTRING
HIGHpython/mlc_llm/model/phi3v/phi3v_loader.py0this file specifies how mlc's rwkv6 parameter maps from other formats, for example huggingface pytorch, huggingface safeSTRING
HIGHpython/mlc_llm/model/phi/phi_loader.py0this file specifies how mlc's rwkv6 parameter maps from other formats, for example huggingface pytorch, huggingface safeSTRING
HIGHpython/mlc_llm/model/gemma3/gemma3v_loader.py0this file specifies how mlc's rwkv6 parameter maps from other formats, for example huggingface pytorch, huggingface safeSTRING
HIGHpython/mlc_llm/model/gemma3/gemma3_loader.py0this file specifies how mlc's rwkv6 parameter maps from other formats, for example huggingface pytorch, huggingface safeSTRING
HIGHpython/mlc_llm/model/qwen2/qwen2_loader.py0this file specifies how mlc's rwkv6 parameter maps from other formats, for example huggingface pytorch, huggingface safeSTRING
HIGHpython/mlc_llm/model/qwen3/qwen3_loader.py0this file specifies how mlc's rwkv6 parameter maps from other formats, for example huggingface pytorch, huggingface safeSTRING
HIGHpython/mlc_llm/model/qwen2_moe/qwen2_moe_loader.py0this file specifies how mlc's rwkv6 parameter maps from other formats, for example huggingface pytorch, huggingface safeSTRING
HIGHpython/mlc_llm/model/qwen3_moe/qwen3_moe_loader.py0this file specifies how mlc's rwkv6 parameter maps from other formats, for example huggingface pytorch, huggingface safeSTRING
HIGHpython/mlc_llm/model/minicpm/minicpm_loader.py0this file specifies how mlc's rwkv6 parameter maps from other formats, for example huggingface pytorch, huggingface safeSTRING
HIGHpython/mlc_llm/model/stable_lm/stablelm_loader.py0this file specifies how mlc's rwkv6 parameter maps from other formats, for example huggingface pytorch, huggingface safeSTRING
HIGHpython/mlc_llm/model/medusa/medusa_loader.py0this file specifies how mlc's rwkv6 parameter maps from other formats, for example huggingface pytorch, huggingface safeSTRING
HIGHpython/mlc_llm/model/orion/orion_loader.py0this file specifies how mlc's rwkv6 parameter maps from other formats, for example huggingface pytorch, huggingface safeSTRING
HIGHpython/mlc_llm/model/eagle/eagle_loader.py0this file specifies how mlc's rwkv6 parameter maps from other formats, for example huggingface pytorch, huggingface safeSTRING
47 more matches not shown…
Hyper-Verbose Identifiers254 hits · 267 pts
SeverityFileLineSnippetContext
LOWpython/mlc_llm/__init__.py14def _create_socket_session_local_workers(num_workers):CODE
LOWpython/mlc_llm/base.py26def _debug_cuda_profiler_start() -> None:CODE
LOWpython/mlc_llm/base.py35def _debug_cuda_profiler_stop() -> None:CODE
LOWpython/mlc_llm/json_ffi/engine.py26 def get_request_stream_callback(self) -> Callable[[str], None]:CODE
LOWpython/mlc_llm/json_ffi/engine.py34 def _sync_request_stream_callback(self, chat_completion_stream_responses_json_str: str) -> None:CODE
LOWpython/mlc_llm/bench/request_processor.py71 def _sample_from_plain_request_records(CODE
LOWpython/mlc_llm/bench/request_processor.py94 def _sample_from_grouped_request_records(CODE
LOWpython/mlc_llm/bench/request_processor.py274 def generate_fake_warmup_requests(CODE
LOWpython/mlc_llm/bench/__main__.py34def _parse_num_concurrent_requests(num_str: Optional[str]) -> Optional[List[int]]: # noqa: UP006CODE
LOWpython/mlc_llm/bench/request_record.py116def _compute_metrics_statistics(CODE
LOWpython/mlc_llm/interface/gen_config.py32def apply_system_defaults_for_missing_fields(mlc_chat_config: MLCChatConfig) -> None:CODE
LOWpython/mlc_llm/interface/compile.py63def _apply_preproc_to_params_and_check_pipeline(CODE
LOWpython/mlc_llm/interface/calibrate.py106async def send_calibration_requests(CODE
LOWpython/mlc_llm/interface/convert_weight.py74def _merge_lora_adapter_with_base_model(base_source: Path, lora_adapter: Path) -> Iterator[Path]:CODE
LOWpython/mlc_llm/interface/router.py66 async def completion_stream_generator() -> AsyncGenerator[str, None]:CODE
LOWpython/mlc_llm/op/triton.py483def _compute_expert_id_per_block(CODE
LOWpython/mlc_llm/op/triton.py515 def tir_compute_expert_id_per_block(CODE
LOWpython/mlc_llm/op/moe_misc.py36def _gating_topk_init_local_top_k(k_val, dtype, local_top_k, local_top_k_index):CODE
LOWpython/mlc_llm/op/moe_misc.py43def _gating_topk_process_value(k_val, x, local_top_k, local_top_k_index, vi, vk):CODE
LOWpython/mlc_llm/op/moe_misc.py161 def _get_topk_softmax_norm_func(k_val: int):CODE
LOWpython/mlc_llm/op/moe_misc.py235def group_limited_greedy_topk(CODE
LOWpython/mlc_llm/op/moe_misc.py303 def group_limited_mask_scores(CODE
LOWpython/mlc_llm/op/mrope.py30def _split_indices_from_sizes(sizes: Sequence[int]) -> List[int]: # noqa: UP006CODE
LOWpython/mlc_llm/op/mrope.py123def apply_multimodal_rotary_pos_emb(CODE
LOWpython/mlc_llm/op/mrope.py263def _build_sequence_position_ids(CODE
LOWpython/mlc_llm/op/ft_gemm.py11def faster_transformer_dequantize_gemm(CODE
LOWpython/mlc_llm/op/ft_gemm.py95def faster_transformer_moe_gemm(CODE
LOWpython/mlc_llm/compiler_pass/fuse_add_norm.py86def _get_add_rms_norm_prefill(hidden_size: int, eps: float, TX: int, in_dtype: str):CODE
LOWpython/mlc_llm/compiler_pass/attach_logit_processor.py42def _get_apply_logit_bias_inplace_cpu():CODE
LOWpython/mlc_llm/compiler_pass/attach_logit_processor.py48 def _apply_logit_bias_inplace(CODE
LOWpython/mlc_llm/compiler_pass/attach_logit_processor.py69def _get_apply_logit_bias_inplace(target: tvm.target.Target):CODE
LOWpython/mlc_llm/compiler_pass/attach_logit_processor.py80 def _apply_logit_bias_inplace(CODE
LOWpython/mlc_llm/compiler_pass/attach_logit_processor.py105def _get_apply_penalty_inplace_cpu():CODE
LOWpython/mlc_llm/compiler_pass/attach_logit_processor.py143def _get_apply_penalty_inplace(target: tvm.target.Target):CODE
LOWpython/mlc_llm/compiler_pass/attach_logit_processor.py191def _get_apply_bitmask_inplace_cpu():CODE
LOWpython/mlc_llm/compiler_pass/attach_logit_processor.py224def _get_apply_bitmask_inplace(target: tvm.target.Target):CODE
LOWpython/mlc_llm/compiler_pass/attach_sampler.py70def _attach_multinomial_sampling_func(bb: relax.BlockBuilder):CODE
LOWpython/mlc_llm/compiler_pass/attach_sampler.py153def _attach_sample_with_top_p(bb: relax.BlockBuilder):CODE
LOWpython/mlc_llm/compiler_pass/attach_sampler.py231def _attach_renormalize_by_top_p(bb: relax.BlockBuilder, target: tvm.target.Target):CODE
LOW…/mlc_llm/compiler_pass/attach_spec_decode_aux_funcs.py79def _add_scatter_hidden_states(bb: BlockBuilder, tensor_parallel_shards: int, dtype: str):CODE
LOW…/mlc_llm/compiler_pass/attach_spec_decode_aux_funcs.py105def _add_gather_hidden_states(bb: BlockBuilder, tensor_parallel_shards: int, dtype: str):CODE
LOW…c_llm/compiler_pass/attach_softmax_with_temperature.py102def _get_lse_and_softmax_func(target: tvm.target.Target, chunk_size: int, active_vocab_size: int):CODE
LOW…hon/mlc_llm/compiler_pass/pipeline_parallel_rewrite.py250 def _prepare_stage_func_params_and_args(CODE
LOW…hon/mlc_llm/compiler_pass/pipeline_parallel_rewrite.py373def _analyze_required_func_params(CODE
LOW…on/mlc_llm/compiler_pass/dispatch_kv_cache_creation.py153 def create_tir_paged_kv_cache(CODE
LOW…on/mlc_llm/compiler_pass/dispatch_kv_cache_creation.py191 def create_flashinfer_paged_kv_cache(CODE
LOWpython/mlc_llm/protocol/conversation_protocol.py247def _strip_reasoning_in_history(CODE
LOWpython/mlc_llm/protocol/conversation_protocol.py273def _combine_consecutive_messages(messages: List[Any]) -> List[Any]: # noqa: UP006CODE
LOWpython/mlc_llm/protocol/mlc_chat_config.py65 def get_system_defaults_for_missing_fields(self) -> Dict[str, Any]: # noqa: UP006CODE
LOWpython/mlc_llm/protocol/artifact_manifest.py145 def _validate_parameter_schema_id(cls, value: str) -> str:CODE
LOWpython/mlc_llm/protocol/artifact_manifest.py211 def _omit_empty_adapter_dtypes(self, handler: SerializerFunctionWrapHandler):CODE
LOWpython/mlc_llm/protocol/artifact_manifest.py220 def _validate_token_generation_roles(self):CODE
LOWpython/mlc_llm/protocol/artifact_manifest.py342def compute_parameter_schema_id(named_parameters: Iterable[tuple[str, Any]]) -> str:CODE
LOWpython/mlc_llm/protocol/artifact_manifest.py366def build_model_package_manifest(CODE
LOWpython/mlc_llm/protocol/artifact_manifest.py382def build_compiled_program_artifact(CODE
LOWpython/mlc_llm/protocol/artifact_manifest.py420def dump_model_package_manifest(manifest: ModelPackageManifest, output: Path) -> Path:CODE
LOWpython/mlc_llm/protocol/openai_api_protocol.py366 def check_function_call_usage(self, conv_template: Conversation) -> None:CODE
LOWpython/mlc_llm/protocol/openai_api_protocol.py450def openai_api_get_unsupported_fields(CODE
LOWpython/mlc_llm/protocol/error_protocol.py33async def bad_request_error_handler(_request: fastapi.Request, e: BadRequestError):CODE
LOWpython/mlc_llm/cli/package.py26 def _parse_mlc_llm_source_dir(path: str) -> Path:CODE
194 more matches not shown…
Decorative Section Separators56 hits · 202 pts
SeverityFileLineSnippetContext
MEDIUMversion.py16# ---------------------------------------------------COMMENT
MEDIUMversion.py27# ---------------------------------------------------COMMENT
MEDIUMpython/mlc_llm/op/triton.py174 # -----------------------------------------------------------COMMENT
MEDIUMpython/mlc_llm/op/triton.py187 # ----------------------------------------------------------COMMENT
MEDIUMpython/mlc_llm/op/triton.py219 # -----------------------------------------------------------COMMENT
MEDIUMpython/mlc_llm/op/triton.py262 # -----------------------------------------------------------COMMENT
MEDIUM⚡python/mlc_llm/model/qwen35/qwen35_model.py217# ============================================================================COMMENT
MEDIUM⚡python/mlc_llm/model/qwen35/qwen35_model.py219# ============================================================================COMMENT
MEDIUMpython/mlc_llm/model/qwen35/qwen35_model.py359# ============================================================================COMMENT
MEDIUMpython/mlc_llm/model/qwen35/qwen35_model.py361# ============================================================================COMMENT
MEDIUMpython/mlc_llm/model/qwen35/qwen35_model.py587# ============================================================================COMMENT
MEDIUMpython/mlc_llm/model/qwen35/qwen35_model.py589# ============================================================================COMMENT
MEDIUM⚡tests/python/serve/test_embedding_engine.py65# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/python/serve/test_embedding_engine.py67# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/python/serve/test_embedding_engine.py76# ===================================================================COMMENT
MEDIUM⚡tests/python/serve/test_embedding_engine.py78# ===================================================================COMMENT
MEDIUM⚡tests/python/serve/test_embedding_engine.py94# ===================================================================COMMENT
MEDIUM⚡tests/python/serve/test_embedding_engine.py96# ===================================================================COMMENT
MEDIUM⚡tests/python/serve/test_embedding_engine.py114# ===================================================================COMMENT
MEDIUM⚡tests/python/serve/test_embedding_engine.py116# ===================================================================COMMENT
MEDIUM⚡tests/python/serve/test_embedding_engine.py147# ===================================================================COMMENT
MEDIUM⚡tests/python/serve/test_embedding_engine.py149# ===================================================================COMMENT
MEDIUM⚡tests/python/serve/test_embedding_engine.py169# ===================================================================COMMENT
MEDIUM⚡tests/python/serve/test_embedding_engine.py171# ===================================================================COMMENT
MEDIUM⚡tests/python/serve/test_embedding_engine.py183# ===================================================================COMMENT
MEDIUM⚡tests/python/serve/test_embedding_engine.py185# ===================================================================COMMENT
MEDIUM⚡tests/python/serve/test_embedding_engine.py222# ===================================================================COMMENT
MEDIUM⚡tests/python/serve/test_embedding_engine.py224# ===================================================================COMMENT
MEDIUMtests/python/serve/test_embedding_engine.py26# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/python/serve/test_embedding_engine.py28# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/python/serve/test_embedding_engine.py204# ===================================================================COMMENT
MEDIUMtests/python/serve/test_embedding_engine.py206# ===================================================================COMMENT
MEDIUMtests/python/serve/test_embedding_engine.py334# ===================================================================COMMENT
MEDIUMtests/python/serve/test_embedding_engine.py336# ===================================================================COMMENT
MEDIUM⚡tests/python/serve/server/test_embedding_server.py217# ===================================================================COMMENT
MEDIUM⚡tests/python/serve/server/test_embedding_server.py219# ===================================================================COMMENT
MEDIUM⚡tests/python/serve/server/test_embedding_server.py229# ===================================================================COMMENT
MEDIUM⚡tests/python/serve/server/test_embedding_server.py231# ===================================================================COMMENT
MEDIUM⚡tests/python/serve/server/test_embedding_server.py254# ===================================================================COMMENT
MEDIUM⚡tests/python/serve/server/test_embedding_server.py256# ===================================================================COMMENT
MEDIUM⚡tests/python/serve/server/test_embedding_server.py277# ===================================================================COMMENT
MEDIUM⚡tests/python/serve/server/test_embedding_server.py279# ===================================================================COMMENT
MEDIUM⚡tests/python/serve/server/test_embedding_server.py322# ===================================================================COMMENT
MEDIUM⚡tests/python/serve/server/test_embedding_server.py324# ===================================================================COMMENT
MEDIUMtests/python/serve/server/test_embedding_server.py39# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/python/serve/server/test_embedding_server.py41# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/python/serve/server/test_embedding_server.py66# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/python/serve/server/test_embedding_server.py68# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/python/serve/server/test_embedding_server.py121# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/python/serve/server/test_embedding_server.py123# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/python/serve/server/test_embedding_server.py203# ===================================================================COMMENT
MEDIUMtests/python/serve/server/test_embedding_server.py205# ===================================================================COMMENT
MEDIUMtests/python/serve/server/test_embedding_server.py297# ===================================================================COMMENT
MEDIUMtests/python/serve/server/test_embedding_server.py299# ===================================================================COMMENT
MEDIUMtests/python/serve/server/test_embedding_server.py344# ===================================================================COMMENT
MEDIUMtests/python/serve/server/test_embedding_server.py346# ===================================================================COMMENT
Cross-Language Confusion (JS/TS)22 hits · 162 pts
SeverityFileLineSnippetContext
HIGH⚡examples/rest/nodejs/sample_client.js28 print('\n');CODE
HIGH⚡examples/rest/nodejs/sample_client.js32print(color.BOLD + "Without streaming:" + color.END);CODE
HIGH⚡examples/rest/nodejs/sample_client.js37print(color.GREEN + r.body.choices[0].message.content + color.END);CODE
HIGH⚡examples/rest/nodejs/sample_client.js38print('\n');CODE
HIGH⚡examples/rest/nodejs/sample_client.js41print(color.BOLD + "Reset chat" + color.END);CODE
HIGH⚡examples/rest/nodejs/sample_client.js52print( color.BOLD + "With streaming:" + color.END);CODE
HIGH⚡examples/rest/nodejs/sample_client.js62 print(color.GREEN + jsData.choices[0].delta.content + color.END);CODE
HIGH⚡examples/rest/nodejs/sample_client.js68 print(color.BOLD + "Runtime stats:" + color.END + txtresp.body);CODE
HIGHexamples/rest/nodejs/sample_langchain.ts26 print('\n');CODE
HIGH⚡examples/rest/nodejs/sample_langchain.ts51 print(color.BOLD + input + "..." + color.END);CODE
HIGH⚡examples/rest/nodejs/sample_langchain.ts55 print(color.GREEN + res.text + color.END);CODE
HIGH⚡examples/rest/nodejs/sample_langchain.ts58 print(color.BOLD + input + "..." + color.END);CODE
HIGH⚡examples/rest/nodejs/sample_langchain.ts62 print(color.GREEN + res.text + color.END);CODE
HIGH⚡examples/rest/nodejs/sample_langchain.ts71print(color.BOLD + "Query: " + color.END + color.BLUE + query + color.END);CODE
HIGH⚡examples/rest/nodejs/sample_langchain.ts74print(color.BOLD + "Response: " + color.END + color.GREEN + result.text + color.END);CODE
HIGH⚡examples/rest/nodejs/sample_openai.js32 print('\n');CODE
HIGH⚡examples/rest/nodejs/sample_openai.js37print(color.BOLD + "OpenAI chat completion example without streaming:" + color.END);CODE
HIGH⚡examples/rest/nodejs/sample_openai.js46print(color.GREEN + completion.data.choices[0].message.content + color.END)CODE
HIGH⚡examples/rest/nodejs/sample_openai.js53print(color.BOLD + "OpenAI chat completion example with streaming:" + color.END);CODE
HIGH⚡examples/rest/nodejs/sample_openai.js63 print(color.GREEN + parsed.choices[0].delta.content + color.END);CODE
HIGH⚡examples/rest/nodejs/sample_openai.js70 print(color.BOLD + "OpenAI completion example:" + color.END)CODE
HIGH⚡examples/rest/nodejs/sample_openai.js73 print(color.GREEN + res.data.choices[0].text + color.END);CODE
Unused Imports131 hits · 126 pts
SeverityFileLineSnippetContext
LOWpython/mlc_llm/__init__.py8CODE
LOWpython/mlc_llm/__init__.py8CODE
LOWpython/mlc_llm/__init__.py9CODE
LOWpython/mlc_llm/__init__.py10CODE
LOWpython/mlc_llm/__init__.py10CODE
LOWpython/mlc_llm/tokenizers/__init__.py3CODE
LOWpython/mlc_llm/tokenizers/__init__.py3CODE
LOWpython/mlc_llm/tokenizers/__init__.py4CODE
LOWpython/mlc_llm/json_ffi/__init__.py8CODE
LOWpython/mlc_llm/nn/__init__.py3CODE
LOWpython/mlc_llm/nn/__init__.py4CODE
LOWpython/mlc_llm/nn/__init__.py4CODE
LOWpython/mlc_llm/conversation_template/__init__.py8CODE
LOWpython/mlc_llm/conversation_template/__init__.py8CODE
LOWpython/mlc_llm/conversation_template/__init__.py8CODE
LOWpython/mlc_llm/conversation_template/__init__.py8CODE
LOWpython/mlc_llm/conversation_template/__init__.py8CODE
LOWpython/mlc_llm/conversation_template/__init__.py8CODE
LOWpython/mlc_llm/conversation_template/__init__.py8CODE
LOWpython/mlc_llm/conversation_template/__init__.py8CODE
LOWpython/mlc_llm/conversation_template/__init__.py8CODE
LOWpython/mlc_llm/conversation_template/__init__.py8CODE
LOWpython/mlc_llm/conversation_template/__init__.py8CODE
LOWpython/mlc_llm/conversation_template/__init__.py8CODE
LOWpython/mlc_llm/conversation_template/__init__.py8CODE
LOWpython/mlc_llm/conversation_template/__init__.py8CODE
LOWpython/mlc_llm/conversation_template/__init__.py8CODE
LOWpython/mlc_llm/conversation_template/__init__.py8CODE
LOWpython/mlc_llm/conversation_template/__init__.py8CODE
LOWpython/mlc_llm/conversation_template/__init__.py8CODE
LOWpython/mlc_llm/conversation_template/__init__.py8CODE
LOWpython/mlc_llm/conversation_template/__init__.py8CODE
LOWpython/mlc_llm/conversation_template/__init__.py8CODE
LOWpython/mlc_llm/conversation_template/__init__.py8CODE
LOWpython/mlc_llm/conversation_template/__init__.py8CODE
LOWpython/mlc_llm/conversation_template/__init__.py8CODE
LOWpython/mlc_llm/conversation_template/__init__.py8CODE
LOWpython/mlc_llm/conversation_template/__init__.py8CODE
LOWpython/mlc_llm/conversation_template/__init__.py8CODE
LOWpython/mlc_llm/conversation_template/__init__.py8CODE
LOWpython/mlc_llm/conversation_template/__init__.py38CODE
LOWpython/mlc_llm/op/mrope.py3CODE
LOWpython/mlc_llm/op/__init__.py3CODE
LOWpython/mlc_llm/op/__init__.py3CODE
LOWpython/mlc_llm/op/__init__.py4CODE
LOWpython/mlc_llm/op/__init__.py5CODE
LOWpython/mlc_llm/op/__init__.py6CODE
LOWpython/mlc_llm/op/__init__.py6CODE
LOWpython/mlc_llm/op/__init__.py6CODE
LOWpython/mlc_llm/op/__init__.py7CODE
LOWpython/mlc_llm/op/__init__.py8CODE
LOWpython/mlc_llm/op/__init__.py8CODE
LOWpython/mlc_llm/op/__init__.py8CODE
LOWpython/mlc_llm/op/__init__.py8CODE
LOWpython/mlc_llm/op/__init__.py14CODE
LOWpython/mlc_llm/op/__init__.py15CODE
LOWpython/mlc_llm/op/__init__.py15CODE
LOWpython/mlc_llm/compiler_pass/blas_dispatch.py8CODE
LOWpython/mlc_llm/compiler_pass/blas_dispatch.py9CODE
LOWpython/mlc_llm/compiler_pass/__init__.py3CODE
71 more matches not shown…
Deep Nesting109 hits · 107 pts
SeverityFileLineSnippetContext
LOWversion.py123CODE
LOWpython/setup.py87CODE
LOWpython/mlc_llm/__main__.py11CODE
LOWpython/mlc_llm/json_ffi/engine.py38CODE
LOWpython/mlc_llm/bench/dataset.py283CODE
LOWpython/mlc_llm/bench/dataset.py735CODE
LOWpython/mlc_llm/bench/evaluation/mmlu.py128CODE
LOWpython/mlc_llm/interface/gen_config.py93CODE
LOWpython/mlc_llm/interface/chat.py249CODE
LOWpython/mlc_llm/op/moe_misc.py64CODE
LOWpython/mlc_llm/op/moe_misc.py134CODE
LOWpython/mlc_llm/op/moe_misc.py438CODE
LOWpython/mlc_llm/op/moe_misc.py88CODE
LOWpython/mlc_llm/op/moe_misc.py161CODE
LOWpython/mlc_llm/op/moe_misc.py481CODE
LOWpython/mlc_llm/op/moe_misc.py92CODE
LOWpython/mlc_llm/op/moe_misc.py177CODE
LOWpython/mlc_llm/op/moe_matmul.py13CODE
LOWpython/mlc_llm/op/moe_matmul.py78CODE
LOWpython/mlc_llm/op/moe_matmul.py180CODE
LOWpython/mlc_llm/op/moe_matmul.py299CODE
LOWpython/mlc_llm/op/moe_matmul.py386CODE
LOWpython/mlc_llm/op/moe_matmul.py560CODE
LOWpython/mlc_llm/op/moe_matmul.py51CODE
LOWpython/mlc_llm/op/moe_matmul.py149CODE
LOWpython/mlc_llm/op/moe_matmul.py238CODE
LOWpython/mlc_llm/op/moe_matmul.py262CODE
LOWpython/mlc_llm/op/moe_matmul.py352CODE
LOWpython/mlc_llm/op/moe_matmul.py426CODE
LOWpython/mlc_llm/op/moe_matmul.py633CODE
LOWpython/mlc_llm/op/batch_spec_verify.py9CODE
LOWpython/mlc_llm/op/batch_spec_verify.py63CODE
LOWpython/mlc_llm/op/top_p_pivot.py12CODE
LOWpython/mlc_llm/op/top_p_pivot.py265CODE
LOWpython/mlc_llm/op/top_p_pivot.py57CODE
LOWpython/mlc_llm/op/top_p_pivot.py301CODE
LOWpython/mlc_llm/op/cutlass.py9CODE
LOWpython/mlc_llm/compiler_pass/fuse_add_norm.py15CODE
LOWpython/mlc_llm/compiler_pass/fuse_add_norm.py86CODE
LOWpython/mlc_llm/compiler_pass/fuse_add_norm.py25CODE
LOWpython/mlc_llm/compiler_pass/fuse_add_norm.py96CODE
LOW…thon/mlc_llm/compiler_pass/lift_global_buffer_alloc.py153CODE
LOW…hon/mlc_llm/compiler_pass/pipeline_parallel_rewrite.py36CODE
LOW…hon/mlc_llm/compiler_pass/pipeline_parallel_rewrite.py106CODE
LOWpython/mlc_llm/protocol/conversation_protocol.py122CODE
LOWpython/mlc_llm/protocol/artifact_manifest.py347CODE
LOWpython/mlc_llm/cli/delivery.py219CODE
LOWpython/mlc_llm/cli/lib_delivery.py122CODE
LOWpython/mlc_llm/cli/model_metadata.py88CODE
LOWpython/mlc_llm/quantization/ft_quantization.py170CODE
LOWpython/mlc_llm/testing/debug_chat.py98CODE
LOWpython/mlc_llm/support/auto_device.py24CODE
LOWpython/mlc_llm/support/auto_device.py52CODE
LOWpython/mlc_llm/support/download_cache.py127CODE
LOWpython/mlc_llm/loader/huggingface_loader.py208CODE
LOWpython/mlc_llm/loader/huggingface_loader.py102CODE
LOWpython/mlc_llm/loader/utils.py55CODE
LOWpython/mlc_llm/loader/standard_loader.py23CODE
LOWpython/mlc_llm/loader/standard_loader.py69CODE
LOWpython/mlc_llm/model/qwen35/qwen35v_loader.py26CODE
49 more matches not shown…
Modern Structural Boilerplate91 hits · 92 pts
SeverityFileLineSnippetContext
LOWpython/mlc_llm/bench/request_processor.py27logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/bench/api_endpoint.py15logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/bench/__main__.py31logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/bench/request_record.py11logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/interface/package.py16logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/interface/compiler_flags.py11logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/interface/jit.py30logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/interface/gen_config.py25logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/interface/serve.py21logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/interface/compile.py25logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/interface/convert_weight.py33logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/op/attention.py13logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/compiler_pass/dispatch_triton_kernel.py15logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/compiler_pass/estimate_memory_usage.py13logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/compiler_pass/pipeline.py45logger = logging.getLogger(__name__)CODE
LOW…on/mlc_llm/compiler_pass/dispatch_kv_cache_creation.py13logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/cli/delivery.py19logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/cli/lib_delivery.py19logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/cli/model_metadata.py16logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/contrib/embeddings/openai.py15logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/quantization/group_quantization.py24logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/quantization/per_tensor_quantization.py27logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/quantization/ft_quantization.py25logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/quantization/block_scale_quantization.py20logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/support/config.py21logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/support/config.py111__all__ = ["ConfigBase", "ConfigOverrideBase"]CODE
LOWpython/mlc_llm/support/auto_config.py16logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/support/auto_device.py21logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/support/auto_weight.py10logger = logging.getLogger(__name__)CODE
LOW⚡python/mlc_llm/support/download_cache.py24logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/support/tqdm.py39__all__ = ["redirect", "tqdm"]CODE
LOWpython/mlc_llm/support/auto_target.py22logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/loader/huggingface_loader.py23logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/loader/huggingface_loader.py231__all__ = ["HuggingFaceLoader"]CODE
LOWpython/mlc_llm/loader/utils.py17logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/loader/stats.py10logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/loader/mapping.py102__all__ = ["ExternMapping", "QuantizeMapping"]CODE
LOWpython/mlc_llm/model/qwen35/qwen35_model.py26logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/model/llama4/llama4_model.py23logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/model/ministral3/ministral3_model.py22logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/model/cohere/cohere_model.py20logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/model/starcoder2/starcoder2_model.py20logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/model/gemma/gemma_model.py18logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/model/olmo2/olmo2_model.py21logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/model/internlm/internlm_model.py20logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/model/gpt_neox/gpt_neox_model.py20logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/model/gemma2/gemma2_model.py19logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/model/mixtral/mixtral_model.py21logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/model/olmo/olmo_model.py22logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/model/phi3/phi3_model.py20logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/model/gemma3/gemma3v_model.py20logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/model/gemma3/gemma3_model.py19logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/model/gemma4/gemma4_config.py11logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/model/gemma4/__init__.py6__all__ = [CODE
LOWpython/mlc_llm/model/gemma4/gemma4_loader.py131__all__ = ["huggingface"]CODE
LOWpython/mlc_llm/model/gemma4/gemma4_model.py643__all__ = [CODE
LOWpython/mlc_llm/model/gemma4/gemma4_audio.py450__all__ = [CODE
LOWpython/mlc_llm/model/qwen2/qwen2_model.py21logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/model/minicpm/minicpm_model.py23logger = logging.getLogger(__name__)CODE
LOWpython/mlc_llm/model/stable_lm/stablelm_model.py20logger = logging.getLogger(__name__)CODE
31 more matches not shown…
Self-Referential Comments24 hits · 74 pts
SeverityFileLineSnippetContext
MEDIUMpython/setup.py76 """This class is needed in order to create OS specific wheels."""STRING
MEDIUMpython/mlc_llm/json_ffi/engine.py84 # Create the background engine-driving thread and start the loop.COMMENT
MEDIUMpython/mlc_llm/bench/request_processor.py85 # Create a new list so that the in-place shuffle does not mutate the input list.COMMENT
MEDIUMpython/mlc_llm/bench/request_processor.py109 # Create a new list so that the in-place shuffle does not mutate the input list.COMMENT
MEDIUMpython/mlc_llm/bench/dataset.py254 # Create a dummy ChatCompletionRequest.COMMENT
MEDIUMpython/mlc_llm/bench/dataset.py576 # Create a dummy ChatCompletionRequest.STRING
MEDIUM…hon/mlc_llm/compiler_pass/pipeline_parallel_rewrite.py165 # Create the param for the shape variables.COMMENT
MEDIUMpython/mlc_llm/cli/router.py11 # Define a custom argument type for a list of stringsCOMMENT
MEDIUMpython/mlc_llm/serve/sync_engine.py236 # Define the callback function for request generation resultsCOMMENT
MEDIUM⚡python/mlc_llm/serve/engine.py1343 # Create the request with the given id, input data, generationCOMMENT
MEDIUM⚡python/mlc_llm/serve/engine.py1350 # Create the unique async request stream of the request.COMMENT
MEDIUMpython/mlc_llm/serve/engine.py1867 # Create the request with the given id, input data, generationCOMMENT
MEDIUMtests/python/serve/test_serve_engine_spec.py77 # Define the callback function for request generation resultsCOMMENT
MEDIUMtests/python/serve/test_serve_engine_spec.py141 # Define the callback function for request generation resultsCOMMENT
MEDIUMtests/python/serve/test_serve_engine_spec.py213 # Define the callback class for request generation resultsCOMMENT
MEDIUMtests/python/serve/test_serve_engine_spec.py295 # Define the callback class for request generation resultsCOMMENT
MEDIUMtests/python/serve/test_serve_engine_spec.py477 # Define the callback function for request generation resultsCOMMENT
MEDIUM⚡tests/python/serve/test_serve_engine_spec.py536 # Define the callback function for request generation resultsCOMMENT
MEDIUM⚡tests/python/serve/test_serve_engine_spec.py602 # Define the callback function for request generation resultsCOMMENT
MEDIUMtests/python/serve/test_serve_sync_engine.py75 # Define the callback function for request generation resultsCOMMENT
MEDIUMtests/python/serve/test_serve_sync_engine.py137 # Define the callback class for request generation resultsCOMMENT
MEDIUMtests/python/serve/test_serve_sync_engine.py217 # Define the callback class for request generation resultsCOMMENT
MEDIUMtests/python/serve/test_serve_sync_engine.py297 # Define the callback class for request generation resultsCOMMENT
MEDIUMtests/python/serve/test_serve_sync_engine.py409 # Define the callback class for request generation resultsCOMMENT
Empty Error Handlers9 hits · 45 pts
SeverityFileLineSnippetContext
HIGHpython/mlc_llm/bench/__main__.py125except Exception:CODE
HIGHpython/mlc_llm/compiler_pass/blas_dispatch.py10except ImportError:CODE
HIGHpython/mlc_llm/cli/worker.py56except (OSError, KeyboardInterrupt):CODE
HIGHpython/mlc_llm/contrib/embeddings/openai.py73except ImportError:CODE
HIGHpython/mlc_llm/contrib/embeddings/openai.py99except ImportError:CODE
HIGHpython/mlc_llm/serve/server/popen_server.py183except OSError:CODE
HIGHpython/mlc_llm/serve/server/popen_server.py189except subprocess.TimeoutExpired:CODE
HIGHpython/mlc_llm/serve/server/popen_server.py175except psutil.NoSuchProcess:CODE
HIGHtests/python/serve/server/test_embedding_server.py176except requests.RequestException:CODE
Slop Phrases12 hits · 39 pts
SeverityFileLineSnippetContext
MEDIUMtests/python/serve/test_serve_engine_spec.py67 # Hyperparameters for tests (you can try different combinations).COMMENT
MEDIUMtests/python/serve/test_serve_engine_spec.py131 # Hyperparameters for tests (you can try different combinations).COMMENT
MEDIUMtests/python/serve/test_serve_engine_spec.py201 # Hyperparameters for tests (you can try different combinations)COMMENT
MEDIUMtests/python/serve/test_serve_engine_spec.py283 # Hyperparameters for tests (you can try different combinations)COMMENT
MEDIUMtests/python/serve/test_serve_engine_spec.py467 # Hyperparameters for tests (you can try different combinations).COMMENT
MEDIUM⚡tests/python/serve/test_serve_engine_spec.py526 # Hyperparameters for tests (you can try different combinations).COMMENT
MEDIUM⚡tests/python/serve/test_serve_engine_spec.py592 # Hyperparameters for tests (you can try different combinations).COMMENT
MEDIUMtests/python/serve/test_serve_sync_engine.py65 # Hyperparameters for tests (you can try different combinations).COMMENT
MEDIUMtests/python/serve/test_serve_sync_engine.py125 # Hyperparameters for tests (you can try different combinations)COMMENT
MEDIUMtests/python/serve/test_serve_sync_engine.py205 # Hyperparameters for tests (you can try different combinations)COMMENT
MEDIUMtests/python/serve/test_serve_sync_engine.py284 # Hyperparameters for tests (you can try different combinations)COMMENT
MEDIUMtests/python/serve/test_serve_sync_engine.py398 # Hyperparameters for tests (you can try different combinations)COMMENT
AI Structural Patterns38 hits · 32 pts
SeverityFileLineSnippetContext
LOWpython/mlc_llm/json_ffi/engine.py117CODE
LOWpython/mlc_llm/nn/kv_cache.py18CODE
LOWpython/mlc_llm/nn/rnn_state.py73CODE
LOWpython/mlc_llm/op/attention.py100CODE
LOWpython/mlc_llm/compiler_pass/pipeline.py82CODE
LOWpython/mlc_llm/contrib/embeddings/embeddings.py173CODE
LOWpython/mlc_llm/quantization/model_quantization.py20CODE
LOWpython/mlc_llm/loader/standard_loader.py23CODE
LOWpython/mlc_llm/model/vision/image_processing.py91CODE
LOWpython/mlc_llm/model/vision/image_processing.py150CODE
LOWpython/mlc_llm/model/vision/image_processing.py194CODE
LOWpython/mlc_llm/model/vision/image_processing.py250CODE
LOWpython/mlc_llm/model/vision/image_processing.py325CODE
LOWpython/mlc_llm/model/chatglm3/chatglm3_model.py162CODE
LOWpython/mlc_llm/model/phi3v/phi3v_image.py121CODE
LOWpython/mlc_llm/model/phi3v/phi3v_image.py166CODE
LOWpython/mlc_llm/model/phi3v/phi3v_image.py205CODE
LOWpython/mlc_llm/model/bert/bert_model.py110CODE
LOWpython/mlc_llm/model/nemotron/nemotron_model.py91CODE
LOWpython/mlc_llm/serve/engine.py58CODE
LOWpython/mlc_llm/serve/engine.py113CODE
LOWpython/mlc_llm/serve/engine.py167CODE
LOWpython/mlc_llm/serve/engine.py252CODE
LOWpython/mlc_llm/serve/engine.py307CODE
LOWpython/mlc_llm/serve/engine.py359CODE
LOWpython/mlc_llm/serve/engine.py444CODE
LOWpython/mlc_llm/serve/engine.py499CODE
LOWpython/mlc_llm/serve/engine.py551CODE
LOWpython/mlc_llm/serve/engine.py636CODE
LOWpython/mlc_llm/serve/engine.py691CODE
LOWpython/mlc_llm/serve/engine.py743CODE
LOWpython/mlc_llm/serve/engine.py911CODE
LOWpython/mlc_llm/serve/engine.py1053CODE
LOWpython/mlc_llm/serve/engine.py1483CODE
LOWpython/mlc_llm/serve/engine.py1615CODE
LOWpython/mlc_llm/serve/engine_base.py1151CODE
LOWpython/mlc_llm/serve/server/popen_server.py25CODE
LOWpython/mlc_llm/serve/entrypoints/debug_entrypoints.py102CODE
Redundant / Tautological Comments18 hits · 27 pts
SeverityFileLineSnippetContext
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 layersCOMMENT
LOWpython/mlc_llm/serve/embedding_engine.py128 # Check if the post-processor actually appends a special token at the endCOMMENT
LOWpython/mlc_llm/serve/server/popen_server.py147 # Check if the subprocess terminates unexpectedly orCOMMENT
LOWtests/python/json_ffi/test_json_ffi_engine_image.py62 # Print output.COMMENT
LOWtests/python/json_ffi/test_json_ffi_engine.py81 # Print output.COMMENT
LOWtests/python/json_ffi/test_json_ffi_engine.py140 # Print output.COMMENT
LOWtests/python/serve/test_serve_engine_rnn.py45 # Print output.COMMENT
LOWtests/python/serve/test_serve_engine.py46 # Print output.COMMENT
LOWtests/python/serve/test_serve_engine.py91 # Print output.COMMENT
LOWtests/python/serve/test_serve_engine.py135 # Print output.COMMENT
LOWtests/python/serve/test_serve_engine.py179 # Print output.COMMENT
LOWtests/python/serve/test_serve_engine.py222 # Print output.COMMENT
LOWtests/python/serve/test_serve_async_engine_spec.py69 # Print output.COMMENT
LOWtests/python/serve/test_serve_async_engine.py66 # Print output.COMMENT
LOWtests/python/serve/test_serve_async_engine.py117 # Print output.COMMENT
LOWtests/python/serve/test_serve_async_engine.py167 # Print output.COMMENT
LOWtests/python/serve/test_serve_async_engine.py217 # Print output.COMMENT
LOWtests/python/serve/test_serve_async_engine.py266 # Print output.COMMENT
Over-Commented Block26 hits · 26 pts
SeverityFileLineSnippetContext
LOW.pre-commit-config.yaml1# To use:COMMENT
LOWpyproject.toml1# Licensed to the Apache Software Foundation (ASF) under oneCOMMENT
LOWpython/mlc_llm/interface/router.py81 output_texts = [""] * request.nCOMMENT
LOW…c_llm/compiler_pass/attach_softmax_with_temperature.py101COMMENT
LOWpython/mlc_llm/protocol/conversation_protocol.py61 # The conversation history messages.COMMENT
LOWpython/mlc_llm/cli/worker.py1# Licensed to the Apache Software Foundation (ASF) under oneCOMMENT
LOWpython/mlc_llm/cli/disco_remote_socket_session.py1# Licensed to the Apache Software Foundation (ASF) under oneCOMMENT
LOWpython/mlc_llm/model/model_preset.py1581 # "architectures": ["BertModel"],COMMENT
LOWpython/mlc_llm/model/model_preset.py1981 "vocab_size": 49152,COMMENT
LOWpython/mlc_llm/model/model_preset.py2001 # "rms_norm_eps": 1e-05,COMMENT
LOWtests/python/conftest.py1# Licensed to the Apache Software Foundation (ASF) under oneCOMMENT
LOWios/MLCSwift/Sources/ObjC/LLMEngine.mm1//COMMENT
LOW…gineExample/MLCEngineExample/MLCEngineExampleApp.swift1// This is a minimum example App to interact with MLC EngineCOMMENT
LOWcpp/base.h1/*!COMMENT
LOWcpp/tokenizers/tokenizers.h1/*!COMMENT
LOWcpp/json_ffi/openai_api_protocol.h1/*!COMMENT
LOWcpp/json_ffi/conv_template.h1#ifndef MLC_LLM_JSON_FFI_CONV_TEMPLATE_HCOMMENT
LOWcpp/serve/config.h1/*!COMMENT
LOWcpp/serve/data.h1/*!COMMENT
LOWcpp/serve/model.h1/*!COMMENT
LOWcpp/serve/prefix_cache.h1/*!COMMENT
LOWcpp/serve/request_state.h1/*!COMMENT
LOWcpp/serve/function_table.h1/*!COMMENT
LOWexamples/rest/python/sample_langchain.py161COMMENT
LOWandroid/mlc4j/src/cpp/tvm_runtime.h1#define TVM_USE_LIBBACKTRACE 0COMMENT
LOWandroid/mlc4j/src/cpp/tvm_runtime.h21#include <runtime/cpu_device_api.cc>COMMENT
Excessive Try-Catch Wrapping24 hits · 24 pts
SeverityFileLineSnippetContext
LOWpython/mlc_llm/json_ffi/engine.py70 except Exception as exception:CODE
LOWpython/mlc_llm/bench/api_endpoint.py139 except Exception:CODE
LOWpython/mlc_llm/bench/api_endpoint.py269 except Exception:CODE
LOWpython/mlc_llm/bench/api_endpoint.py383 except Exception:CODE
LOWpython/mlc_llm/bench/__main__.py125 except Exception:CODE
LOWpython/mlc_llm/interface/gen_config.py216 except Exception:CODE
LOWpython/mlc_llm/interface/gen_config.py238 except Exception:CODE
LOWpython/mlc_llm/interface/gen_config.py285 except Exception:CODE
LOW…on/mlc_llm/compiler_pass/dispatch_kv_cache_creation.py238 except Exception as e:CODE
LOWpython/mlc_llm/cli/delivery.py198 except Exception as exc:CODE
LOWpython/mlc_llm/cli/check_device.py13 except Exception:CODE
LOWpython/mlc_llm/cli/model_metadata.py175 except Exception:STRING
LOWpython/mlc_llm/support/auto_device.py40 except Exception as err:CODE
LOWpython/mlc_llm/support/auto_target.py119 except Exception as err:CODE
LOWpython/mlc_llm/serve/engine.py1034 except Exception as err:CODE
LOWpython/mlc_llm/serve/engine.py1233 except Exception as err:CODE
LOWpython/mlc_llm/serve/engine.py1305 except Exception as err:CODE
LOWpython/mlc_llm/serve/engine.py1381 except Exception as exception:CODE
LOWpython/mlc_llm/serve/server/popen_server.py143 except Exception:CODE
LOWpython/mlc_llm/serve/entrypoints/openai_entrypoints.py78 except Exception as exc:CODE
LOWpython/mlc_llm/router/router.py304 except Exception as e:CODE
LOWtests/python/integration/test_model_compile.py147 except Exception:CODE
LOWscripts/check_url_validity.py36 except Exception as e:CODE
MEDIUMscripts/check_url_validity.py37 print(f"Error connecting {url}, error: {e}")CODE
Structural Annotation Overuse11 hits · 23 pts
SeverityFileLineSnippetContext
LOW⚡python/mlc_llm/model/gemma3/gemma3v_model.py200 # Step 1: PreprocessCOMMENT
LOW⚡python/mlc_llm/model/gemma3/gemma3v_model.py203 # Step 2: Cast to model dtypeCOMMENT
LOW⚡python/mlc_llm/model/gemma3/gemma3v_model.py206 # Step 3: Vision encoder -> (1, 4096, 1152)COMMENT
LOW⚡python/mlc_llm/model/gemma3/gemma3v_model.py209 # Step 4: Reshape for average poolingCOMMENT
LOW⚡python/mlc_llm/model/gemma3/gemma3v_model.py216 # Step 5: AvgPool2d(4,4) -> (1, 1152, 16, 16)COMMENT
LOW⚡python/mlc_llm/model/gemma3/gemma3v_model.py219 # Step 6: Reshape back to sequence formatCOMMENT
LOW⚡python/mlc_llm/model/gemma3/gemma3v_model.py225 # Step 7: Multimodal projector (RMSNorm + Linear)COMMENT
LOW⚡python/mlc_llm/model/gemma3/gemma3v_model.py228 # Step 8: Compensate for Gemma's embedding scaling.COMMENT
LOW⚡python/mlc_llm/model/gemma3/gemma3v_model.py235 # Step 9: Reshape to 2D for C++ runtime (requires ndim == 2)COMMENT
LOWpython/mlc_llm/serve/engine_base.py486 # NOTE: This function causes GIL during execution.COMMENT
LOW…gineExample/MLCEngineExample/MLCEngineExampleApp.swift35 // Step 0: load the engineCOMMENT
Verbosity Indicators10 hits · 22 pts
SeverityFileLineSnippetContext
LOW⚡python/mlc_llm/model/gemma3/gemma3v_model.py200 # Step 1: PreprocessCOMMENT
LOW⚡python/mlc_llm/model/gemma3/gemma3v_model.py203 # Step 2: Cast to model dtypeCOMMENT
LOW⚡python/mlc_llm/model/gemma3/gemma3v_model.py206 # Step 3: Vision encoder -> (1, 4096, 1152)COMMENT
LOW⚡python/mlc_llm/model/gemma3/gemma3v_model.py209 # Step 4: Reshape for average poolingCOMMENT
LOW⚡python/mlc_llm/model/gemma3/gemma3v_model.py216 # Step 5: AvgPool2d(4,4) -> (1, 1152, 16, 16)COMMENT
LOW⚡python/mlc_llm/model/gemma3/gemma3v_model.py219 # Step 6: Reshape back to sequence formatCOMMENT
LOW⚡python/mlc_llm/model/gemma3/gemma3v_model.py225 # Step 7: Multimodal projector (RMSNorm + Linear)COMMENT
LOW⚡python/mlc_llm/model/gemma3/gemma3v_model.py228 # Step 8: Compensate for Gemma's embedding scaling.COMMENT
LOW⚡python/mlc_llm/model/gemma3/gemma3v_model.py235 # Step 9: Reshape to 2D for C++ runtime (requires ndim == 2)COMMENT
LOW…gineExample/MLCEngineExample/MLCEngineExampleApp.swift35 // Step 0: load the engineCOMMENT
Cross-Language Confusion3 hits · 18 pts
SeverityFileLineSnippetContext
HIGH⚡python/mlc_llm/serve/engine.py1354 stream.push(CODE
HIGHpython/mlc_llm/serve/engine_base.py518 stream.push([output])CODE
HIGHpython/mlc_llm/serve/engine_base.py545 stream.push(outputs)CODE
Modern AI Meta-Vocabulary6 hits · 16 pts
SeverityFileLineSnippetContext
MEDIUMpython/mlc_llm/interface/serve.py89 # Set up embedding model if specifiedCOMMENT
MEDIUMpython/mlc_llm/cli/model_metadata.py99 # Compute KV cache size per token of context window.COMMENT
MEDIUMpython/mlc_llm/model/gemma2/gemma2_model.py37 # NOTE: override the context window size with the Gemma2 sliding window size,COMMENT
MEDIUMpython/mlc_llm/model/gemma3/gemma3_model.py91 # NOTE: override the context window size with the Gemma2 sliding window size,COMMENT
MEDIUMpython/mlc_llm/model/rwkv5/rwkv5_model.py43 context_window_size: int = -1 # RWKV does not have context window limitation.CODE
MEDIUMpython/mlc_llm/model/rwkv6/rwkv6_model.py43 context_window_size: int = -1 # RWKV does not have context window limitation.CODE
AI Slop Vocabulary7 hits · 13 pts
SeverityFileLineSnippetContext
MEDIUMversion.py90 # Remove the v prefix, mainly to be robustCOMMENT
MEDIUMpython/setup.py76 """This class is needed in order to create OS specific wheels."""STRING
MEDIUMpython/mlc_llm/interface/chat.py173 # TODO(mlc-team): possibly leverage debug optionCOMMENT
LOWpython/mlc_llm/serve/engine.py1032 # for cancelled error, we can simply pass it throughCOMMENT
LOWpython/mlc_llm/serve/engine.py1231 # for cancelled error, we can simply pass it throughCOMMENT
LOWpython/mlc_llm/serve/engine.py1303 # for cancelled error, we can simply pass it throughCOMMENT
LOWpython/mlc_llm/serve/engine.py1379 # for cancelled error, we can simply pass it throughCOMMENT