AI Slop Code RIsk Monitor

ModelTC/LightLLM

LightLLM is a Python-based LLM (Large Language Model) inference and serving framework, notable for its lightweight design, easy scalability, and high-speed performance.

21.1 Elevated pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for ModelTC/LightLLM, a Python project with 4,318 GitHub stars. SynthScan examined 198,917 lines of code across 1834 source files, recording 3387 pattern matches distributed across 22 syntactic categories. The legacy adjusted pattern signal is 21.1 (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.

21.1
Adjusted Signal
21.1
Raw Pattern Score
100%
Time Factor
2026-10-11
Last Push
4.3K
Stars
Python
Language
198.9K
Lines of Code
1.8K
Files
3.4K
Pattern Hits
2026-10-12
Scan Date
0.06
HC Hit Rate

Risk Review · v3

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

Cognitive Ownership Risk 42.2/100 · MEDIUM

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

Hallucinated Dependency & Supply Chain Risk 22.6/100 · LOW

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

Agent Over-Engineering Ratio 50.0/100 · MEDIUM

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

PR Review Velocity Impact 65.1/100 · HIGH

Which changes need focused human review? 3387 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 8HIGH 93MEDIUM 133LOW 3153

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 3387 distinct pattern matches across 22 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.

Hyper-Verbose Identifiers1643 hits · 1707 pts
SeverityFileLineSnippetContext
LOWtest/benchmark/static_inference/static_benchmark.py250 def _materialize_context_for_decode(self, case: BenchmarkCase):CODE
LOWtest/benchmark/static_inference/static_benchmark.py315 def _prepare_mtp_prefill_input(CODE
LOWtest/benchmark/static_inference/static_benchmark.py499 def _materialize_cached_prefix(self, req_idx: torch.Tensor, cached_len: int):CODE
LOWtest/benchmark/static_inference/static_benchmark.py683 def _merge_overlap_model_outputs(output0: ModelOutput, output1: ModelOutput) -> ModelOutput:CODE
LOWtest/benchmark/static_inference/static_benchmark.py714 def _build_mtp_decode_index_tensors(self, req_idx: torch.Tensor, step_width: int):CODE
LOWtest/benchmark/static_inference/static_benchmark.py846def prefill_step_tokens_per_req(uncached_len: int, chunked_prefill_size: Optional[int]) -> int:CODE
LOWtest/benchmark/static_inference/static_benchmark.py876def prefill_batch_size_from_batch_max_tokens(CODE
LOWtest/benchmark/static_inference/static_benchmark.py971def decode_profile_batch_divisor(args: SimpleNamespace, case: BenchmarkCase) -> int:CODE
LOWtest/benchmark/static_inference/static_benchmark.py977def resolve_profile_decode_cases(CODE
LOWtest/benchmark/static_inference/static_benchmark.py1012def resolve_batch_max_prefill_cases(CODE
LOWtest/benchmark/static_inference/static_benchmark.py1528def add_static_benchmark_args(parser: argparse.ArgumentParser):CODE
LOWtest/benchmark/service/benchmark_multiturn.py174def gen_session_initial_prompt(CODE
LOWtest/benchmark/service/benchmark_multiturn.py622def run_full_concurrency_level(CODE
LOWtest/benchmark/service/benchmark_multiturn.py691def run_pooled_concurrency_level(CODE
LOW⚡test/benchmark/service/benchmark_qps.py170async def async_post_stream_lightllm(url, prompt, max_new_tokens, session):CODE
LOWtest/benchmark/service/benchmark_qps.py57def gen_random_input_text_with_seed(tokenizer, input_len, seed) -> str:CODE
LOWtest/test_pd_selector/test_pd_node_request_limit.py37def test_pd_node_resource_wait_timeout_is_internal_and_defaults_to_waiting_forever():CODE
LOWtest/test_pd_selector/test_pd_node_request_limit.py49def test_shm_req_partial_allocations_are_released_on_failure():CODE
LOWtest/test_pd_selector/test_pd_node_request_limit.py62def test_shm_req_allocation_waits_forever_when_timeout_is_negative():CODE
LOWtest/test_pd_selector/test_pd_node_request_limit.py75def test_multinode_tp_slave_does_not_apply_shm_req_allocation_timeout():CODE
LOWtest/test_pd_selector/test_pd_node_request_limit.py89def test_high_priority_shm_req_allocation_uses_shorter_backoff_even_with_local_limit():CODE
LOWtest/test_pd_selector/test_pd_node_request_limit.py110def test_shm_req_allocation_uses_master_timeout_independently_of_priority(pd_high_priority_request):CODE
LOWtest/test_pd_selector/test_pd_node_request_limit.py138def test_router_wait_uses_master_timeout_independently_of_priority(CODE
LOWtest/test_pd_selector/test_pd_node_request_limit.py162def test_pd_high_priority_request_is_inserted_before_first_normal_request():CODE
LOWtest/test_pd_selector/test_pd_node_request_limit.py178def test_pd_high_priority_request_group_keeps_fifo_order_while_waiting_for_dp_index():CODE
LOWtest/test_pd_selector/test_pd_master_multi_choice.py34def test_pd_master_expands_n_into_concurrent_single_choice_requests():CODE
LOWtest/test_pd_selector/test_pd_master_multi_choice.py112def test_pd_master_n_one_uses_the_same_choice_merge_path():CODE
LOWtest/test_pd_selector/test_pd_master_multi_choice.py161def test_pd_master_does_not_record_aborted_or_error_request_as_success(failed_finish_status):CODE
LOWtest/test_pd_selector/test_pd_master_multi_choice.py203def test_pd_master_hides_capacity_finish_token_and_continues_next_segment(CODE
LOWtest/test_pd_selector/test_pd_master_multi_choice.py273def test_pd_master_multi_choice_failure_closes_other_generators():CODE
LOWtest/test_pd_selector/test_pd_master_multi_choice.py302def test_pd_master_multi_choice_cancellation_is_not_treated_as_success():CODE
LOWtest/test_pd_selector/test_pd_master_multi_choice.py317def test_pd_master_closing_merged_stream_closes_choice_generators():CODE
LOWtest/test_pd_selector/test_pd_master_multi_choice.py338def test_pd_master_releases_prefill_load_when_generation_fails():CODE
LOWtest/test_pd_selector/test_pd_master_multi_choice.py348 async def failing_wait_to_token_package(*_args, **_kwargs):CODE
LOWtest/test_pd_selector/test_pd_master_multi_choice.py376def test_pd_master_dynamic_split_reuses_nodes_with_remaining_length():CODE
LOWtest/test_pd_selector/test_pd_master_multi_choice.py461def test_pd_master_counts_segment_tokens_without_relying_on_metadata():CODE
LOWtest/test_pd_selector/test_pd_master_multi_choice.py534def test_pd_master_promotes_only_fresh_high_estimated_cache_hit(CODE
LOWtest/test_pd_selector/test_pd_master_multi_choice.py597def test_pd_master_sets_resource_wait_timeout_when_enabled(enable_limit, expected_timeout):CODE
LOWtest/test_pd_selector/test_pd_master_multi_choice.py654def test_pd_master_retries_generate_one_when_node_is_busy():CODE
LOWtest/test_pd_selector/test_pd_master_multi_choice.py690def test_pd_master_stops_busy_retry_when_client_disconnects():CODE
LOWtest/test_pd_selector/test_pd_master_multi_choice.py725def test_pd_master_does_not_retry_busy_error_when_self_limit_is_disabled():CODE
LOWtest/test_pd_selector/test_pd_master_multi_choice.py755def test_pd_master_stops_busy_retry_when_probe_period_expires():CODE
LOWtest/test_pd_selector/test_pd_master_multi_choice.py786def test_pd_master_does_not_retry_busy_error_after_streaming_output():CODE
LOWtest/test_pd_selector/test_pd_master_multi_choice.py818def test_pd_master_releases_prefill_load_when_stream_is_closed():CODE
LOWtest/utils/test_tensor_buffer_manager.py13def test_allocate_different_shapes_and_dtypes_from_one_buffer():CODE
LOWtest/utils/test_tensor_buffer_manager.py31def test_non_byte_backing_tensor_is_used_as_byte_storage():CODE
LOWtest/utils/test_tensor_buffer_manager.py40def test_released_block_is_reused():CODE
LOWtest/utils/test_tensor_buffer_manager.py51def test_adjacent_free_blocks_are_merged():CODE
LOWtest/utils/test_tensor_buffer_manager.py68def test_release_rejects_unknown_and_already_released_tensors():CODE
LOWtest/utils/test_tensor_buffer_manager.py79def test_stale_tensor_cannot_release_reused_address():CODE
LOWtest/utils/test_tensor_buffer_manager.py92def test_allocation_reports_fragmentation_on_failure():CODE
LOWtest/utils/test_tensor_buffer_manager.py106def test_invalid_buffer_is_rejected():CODE
LOWtest/utils/test_tensor_buffer_manager.py117def test_unaligned_buffer_prefix_is_skipped():CODE
LOWtest/utils/test_tensor_buffer_manager.py126def test_empty_tensor_does_not_consume_buffer_space():CODE
LOWtest/test_api/test_seed_validation.py16def test_api_request_seed_range(request_type, request_data):CODE
LOWtest/test_api/test_seed_validation.py34def test_sampling_params_normalizes_and_accepts_seed(seed, expected_seed):CODE
LOWtest/test_api/test_seed_validation.py45def test_sampling_params_rejects_out_of_range_seed(seed):CODE
LOWtest/test_api/test_rl_endpoints.py170def update_weights_from_disk_via_tensor_api(CODE
LOWtest/test_api/test_openai_api.py214 def completions_with_multiple_prompts(self, prompts: List[str], **kwargs) -> Dict[str, Any]:CODE
LOWtest/test_api/test_openai_api.py231 def completions_with_logprobs(self, prompt: str, logprobs: int = 5, **kwargs) -> Dict[str, Any]:CODE
1583 more matches not shown…
Unused Imports878 hits · 864 pts
SeverityFileLineSnippetContext
LOWtest/benchmark/static_inference/profile_demo.py2CODE
LOWtest/benchmark/static_inference/profile_demo.py3CODE
LOWtest/benchmark/static_inference/test_vit.py1CODE
LOWtest/benchmark/static_inference/test_vit.py2CODE
LOWtest/benchmark/static_inference/test_vit.py4CODE
LOWtest/benchmark/static_inference/test_vit.py38CODE
LOWtest/benchmark/service/benchmark_client.py3CODE
LOWtest/benchmark/service/benchmark_qps.py3CODE
LOWtest/benchmark/service/benchmark_qps.py4CODE
LOWtest/benchmark/service/benchmark_qps.py9CODE
LOWtest/benchmark/service/benchmark_qps.py11CODE
LOWtest/benchmark/service/benchmark_mcq.py18CODE
LOWtest/benchmark/service/benchmark_mcq.py29CODE
LOWtest/benchmark/service/benchmark_sharegpt.py28CODE
LOWtest/cpu_cache_kernel/test_speed.py19CODE
LOWtest/test_pd_selector/test_pd_master_multi_choice.py1CODE
LOWtest/test_pd_selector/test_pd_master_multi_choice.py4CODE
LOWtest/format_out/test_xgrammar_constraint.py1CODE
LOWtest/format_out/qabot.py23CODE
LOWtest/format_out/qabot.py24CODE
LOWtest/test_api/test_rl_endpoints.py44CODE
LOWtest/test_api/test_openai_api.py11CODE
LOWtest/test_api/test_openai_api.py12CODE
LOWtest/test_api/test_stream_fc.py24CODE
LOWtest/test_api/test_stream_fc.py24CODE
LOWtest/test_api/test_multimodal_api.py2CODE
LOWtest/test_api/test_abort_request.py43CODE
LOWtest/performance/audio_test.py1CODE
LOWtest/performance/multimodal_test.py3CODE
LOWtest/performance/multimodal_test.py4CODE
LOWtest/performance/multimodal_test.py9CODE
LOWtest/performance/multimodal_test.py11CODE
LOWtest/kernel/moe_sum_reduce_tuning_bf16.py8CODE
LOWtest/kernel/llama_gqa_diverse_decode_stage1_tuning.py2CODE
LOWtest/kernel/deepseekv3_rotary_emb_tuning.py3CODE
LOWtest/kernel/deepseekv3_rotary_emb_tuning.py9CODE
LOWtest/kernel/deepseekv3_fp8_block_gemm_tuning.py5CODE
LOWtest/kernel/llama_gqa_diverse_decode_stage2_tuning.py4CODE
LOWtest/kernel/llama_gqa_decode_vsm_tuning.py2CODE
LOWtest/acc/test_vlm_models.py1CODE
LOWtest/acc/test_vlm_models.py2CODE
LOWtest/acc/test_vlm_models.py3CODE
LOWtest/acc/test_vlm_models.py5CODE
LOWtest/acc/test_vlm_models.py7CODE
LOWtest/acc/test_vlm_models.py8CODE
LOWtest/acc/test_vlm_models.py9CODE
LOWtest/acc/bfcl/eval_bfcl.py33CODE
LOWtest/acc/bfcl/eval_bfcl.py36CODE
LOWunit_tests/server/core/objs/test_shm_array.py5CODE
LOWunit_tests/server/core/objs/test_atomic_array_lock.py4CODE
LOWunit_tests/server/core/objs/test_req.py4CODE
LOW…it_tests/server/core/objs/test_token_ids_validation.py2CODE
LOW…odel_infer/mode_backend/test_paged_side_allocations.py9CODE
LOW…outer/model_infer/mode_backend/test_diverse_backend.py6CODE
LOWunit_tests/utils/test_start_utils.py1CODE
LOWunit_tests/utils/test_custom_kernel_utils.py2CODE
LOWunit_tests/models/qwen3-vl/test_deepstack_emb.py2CODE
LOWunit_tests/models/qwen3-vl/test_deepstack_emb.py3CODE
LOWunit_tests/models/qwen3-vl/test_deepstack_emb.py4CODE
LOWunit_tests/models/deepseek2/test_rope_repeat.py2CODE
818 more matches not shown…
Empty Error Handlers68 hits · 340 pts
SeverityFileLineSnippetContext
HIGHtest/benchmark/static_inference/static_benchmark.py1302except Exception:CODE
HIGHtest/benchmark/service/benchmark_qps.py398except asyncio.CancelledError:CODE
HIGHtest/benchmark/service/benchmark_qps.py155except Exception:CODE
HIGHtest/benchmark/service/benchmark_qps.py203except Exception:CODE
HIGHtest/test_api/test_gsmk.py131except SyntaxError:CODE
HIGHtest/performance/audio_test.py224except json.JSONDecodeError:CODE
HIGHtest/performance/audio_test.py280except json.JSONDecodeError:CODE
HIGHtest/performance/multimodal_test.py366except asyncio.CancelledError:CODE
HIGHtest/acc/test_gsmk.py123except SyntaxError:CODE
HIGHtest/acc/bfcl/eval_bfcl.py246except json.JSONDecodeError:CODE
HIGHtest/acc/bfcl/eval_bfcl.py263except:CODE
HIGHtest/acc/bfcl/eval_bfcl.py273except:CODE
HIGHformat_out/impl.py57except:CODE
HIGHlightllm/distributed/flashinfer_all_reduce.py91except Exception:CODE
HIGHlightllm/server/build_prompt.py61except:CODE
HIGHlightllm/server/build_prompt.py69except:CODE
HIGHlightllm/server/build_prompt.py90except (json.JSONDecodeError, TypeError):CODE
HIGHlightllm/server/function_call_parser.py807except json.JSONDecodeError:CODE
HIGHlightllm/server/function_call_parser.py984except json.JSONDecodeError:CODE
HIGHlightllm/server/function_call_parser.py1162except json.JSONDecodeError:CODE
HIGHlightllm/server/function_call_parser.py1635except json.JSONDecodeError:CODE
HIGHlightllm/server/api_anthropic.py331except OSError:CODE
HIGHlightllm/server/api_anthropic.py335except OSError:CODE
HIGHlightllm/server/api_anthropic.py273except OSError:CODE
HIGHlightllm/server/api_anthropic.py409except OSError:CODE
HIGHlightllm/server/api_anthropic.py486except OSError:CODE
HIGHlightllm/server/api_models.py177except Exception:CODE
HIGHlightllm/server/api_models.py259except Exception:CODE
HIGHlightllm/server/metrics/manager.py73except:CODE
HIGHlightllm/server/core/objs/sampling_params.py422except:CODE
HIGHlightllm/server/core/objs/py_sampling_params.py128except:CODE
HIGHlightllm/server/embed_cache/afs_utils.py53except:CODE
HIGHlightllm/server/httpserver_for_pd_master/manager.py106except:CODE
HIGHlightllm/server/httpserver_for_pd_master/manager.py731except:CODE
HIGHlightllm/server/httpserver_for_pd_master/manager.py736except:CODE
HIGHlightllm/server/httpserver_for_pd_master/manager.py741except:CODE
HIGHlightllm/server/httpserver_for_pd_master/manager.py749except:CODE
HIGHlightllm/server/httpserver_for_pd_master/manager.py847except asyncio.TimeoutError:CODE
HIGHlightllm/server/httpserver_for_pd_master/manager.py789except:CODE
HIGH…rver/visualserver/model_infer/vision_peak_vram_hold.py139except FileNotFoundError:CODE
HIGHlightllm/server/httpserver/pd_loop.py271except asyncio.CancelledError:CODE
HIGHlightllm/server/httpserver/async_queue.py13except asyncio.TimeoutError:CODE
HIGHlightllm/server/httpserver/rl_controller.py248except BaseException:CODE
HIGHlightllm/server/httpserver/manager.py798except asyncio.TimeoutError:CODE
HIGHlightllm/server/httpserver/manager.py955except asyncio.TimeoutError:CODE
HIGHlightllm/server/httpserver/manager.py1011except asyncio.TimeoutError:CODE
HIGH…er/model_infer/mode_backend/pd/base_kv_move_manager.py90except queue.Empty:CODE
HIGH…ter/model_infer/mode_backend/pd/nccl_kv_transporter.py468except Exception:CODE
HIGH…ter/model_infer/mode_backend/pd/nccl_kv_transporter.py526except Exception:CODE
HIGHlightllm/utils/redis_utils.py20except Exception:CODE
HIGHlightllm/utils/petrel_helper.py41except:CODE
HIGHlightllm/utils/shm_utils.py90except:CODE
HIGHlightllm/utils/shm_utils.py118except:CODE
HIGHlightllm/utils/kv_cache_utils.py326except Exception:CODE
HIGHlightllm/utils/device_utils.py302except Exception:CODE
HIGHlightllm/utils/profiler.py218except Exception:CODE
HIGHlightllm/utils/config_utils.py282except:CODE
HIGHlightllm/utils/config_utils.py290except:CODE
HIGHlightllm/utils/config_utils.py325except Exception:CODE
HIGHlightllm/utils/config_utils.py606except:CODE
8 more matches not shown…
Decorative Section Separators78 hits · 291 pts
SeverityFileLineSnippetContext
MEDIUMtest/cpu_cache_kernel/test_speed.py21# ---------------------------------------------------------------------------COMMENT
MEDIUMtest/cpu_cache_kernel/test_speed.py24# ---------------------------------------------------------------------------COMMENT
MEDIUMtest/cpu_cache_kernel/test_speed.py39# ---------------------------------------------------------------------------COMMENT
MEDIUMtest/cpu_cache_kernel/test_speed.py41# ---------------------------------------------------------------------------COMMENT
MEDIUMtest/cpu_cache_kernel/test_speed.py63# ---------------------------------------------------------------------------COMMENT
MEDIUMtest/cpu_cache_kernel/test_speed.py65# ---------------------------------------------------------------------------COMMENT
MEDIUMtest/cpu_cache_kernel/test_speed.py79# ---------------------------------------------------------------------------COMMENT
MEDIUMtest/cpu_cache_kernel/test_speed.py81# ---------------------------------------------------------------------------COMMENT
MEDIUMtest/cpu_cache_kernel/test_speed.py153# ---------------------------------------------------------------------------COMMENT
MEDIUMtest/cpu_cache_kernel/test_speed.py155# ---------------------------------------------------------------------------COMMENT
MEDIUMtest/cpu_cache_kernel/test_speed.py178# ---------------------------------------------------------------------------COMMENT
MEDIUMtest/cpu_cache_kernel/test_speed.py180# ---------------------------------------------------------------------------COMMENT
MEDIUMtest/cpu_cache_kernel/test_speed.py227# ---------------------------------------------------------------------------COMMENT
MEDIUMtest/cpu_cache_kernel/test_speed.py229# ---------------------------------------------------------------------------COMMENT
MEDIUMtest/test_api/test_stream_fc.py28# ──────────────────────────────────────────────COMMENT
MEDIUMtest/test_api/test_stream_fc.py30# ──────────────────────────────────────────────COMMENT
MEDIUM⚡test/test_api/test_stream_fc.py86# ──────────────────────────────────────────────COMMENT
MEDIUM⚡test/test_api/test_stream_fc.py88# ──────────────────────────────────────────────COMMENT
MEDIUMtest/test_api/test_stream_fc.py160# ──────────────────────────────────────────────COMMENT
MEDIUMtest/test_api/test_stream_fc.py162# ──────────────────────────────────────────────COMMENT
MEDIUMtest/test_api/test_stream_fc.py594# ──────────────────────────────────────────────COMMENT
MEDIUMtest/test_api/test_stream_fc.py596# ──────────────────────────────────────────────COMMENT
MEDIUM⚡…del/triton_kernel/linear_att/test_causal_conv1d_mtp.py510# =============================================================================COMMENT
MEDIUM⚡…del/triton_kernel/linear_att/test_causal_conv1d_mtp.py512# =============================================================================COMMENT
MEDIUMlightllm/server/io_struct.py24# ---------------------------------------------------------------------------COMMENT
MEDIUMlightllm/server/io_struct.py26# ---------------------------------------------------------------------------COMMENT
MEDIUMlightllm/server/io_struct.py40# ---------------------------------------------------------------------------COMMENT
MEDIUMlightllm/server/io_struct.py42# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡lightllm/server/api_anthropic.py86# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡lightllm/server/api_anthropic.py88# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡lightllm/server/api_anthropic.py867# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡lightllm/server/api_anthropic.py869# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡lightllm/server/api_anthropic.py1255# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡lightllm/server/api_anthropic.py1257# ---------------------------------------------------------------------------COMMENT
MEDIUMlightllm/server/api_anthropic.py697# ---------------------------------------------------------------------------COMMENT
MEDIUMlightllm/server/api_anthropic.py699# ---------------------------------------------------------------------------COMMENT
MEDIUMlightllm/server/api_anthropic.py1208# ---------------------------------------------------------------------------COMMENT
MEDIUMlightllm/server/api_anthropic.py1210# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡lightllm/server/router/multinode_tp_helper.py22 # ==================================================================COMMENT
MEDIUM⚡lightllm/server/router/multinode_tp_helper.py24 # ==================================================================COMMENT
MEDIUM⚡lightllm/server/router/multinode_tp_helper.py58 # ==================================================================COMMENT
MEDIUM⚡lightllm/server/router/multinode_tp_helper.py60 # ==================================================================COMMENT
MEDIUM⚡lightllm/server/router/multinode_tp_helper.py124 # ==================================================================COMMENT
MEDIUM⚡lightllm/server/router/multinode_tp_helper.py126 # ==================================================================COMMENT
MEDIUM⚡lightllm/server/router/multinode_tp_helper.py147 # ==================================================================COMMENT
MEDIUM⚡lightllm/server/router/multinode_tp_helper.py149 # ==================================================================COMMENT
MEDIUM⚡…er/model_infer/mode_backend/pd/base_kv_move_manager.py56 # ==================================================================================COMMENT
MEDIUM⚡…er/model_infer/mode_backend/pd/base_kv_move_manager.py58 # ==================================================================================COMMENT
MEDIUM⚡…er/model_infer/mode_backend/pd/base_kv_move_manager.py63 # ==================================================================================COMMENT
MEDIUM⚡…er/model_infer/mode_backend/pd/base_kv_move_manager.py65 # ==================================================================================COMMENT
MEDIUM⚡…er/model_infer/mode_backend/pd/base_kv_move_manager.py94 # ==================================================================================COMMENT
MEDIUM⚡…er/model_infer/mode_backend/pd/base_kv_move_manager.py96 # ==================================================================================COMMENT
MEDIUM⚡…er/model_infer/mode_backend/pd/base_kv_move_manager.py103 # ==================================================================================COMMENT
MEDIUM⚡…er/model_infer/mode_backend/pd/base_kv_move_manager.py105 # ==================================================================================COMMENT
MEDIUM…ackend/pd/prefill_node_impl/prefill_kv_move_manager.py54 # ==================================================================================COMMENT
MEDIUM…ackend/pd/prefill_node_impl/prefill_kv_move_manager.py56 # ==================================================================================COMMENT
MEDIUM…_backend/pd/decode_node_impl/decode_kv_move_manager.py74 # ==================================================================================COMMENT
MEDIUM…_backend/pd/decode_node_impl/decode_kv_move_manager.py76 # ==================================================================================COMMENT
MEDIUM…de_backend/pd/decode_node_impl/decode_trans_process.py56 # -------------------------------------------------------------------------COMMENT
MEDIUM…de_backend/pd/decode_node_impl/decode_trans_process.py74 # -------------------------------------------------------------------------COMMENT
18 more matches not shown…
Excessive Try-Catch Wrapping226 hits · 244 pts
SeverityFileLineSnippetContext
LOWtest/compare_with_previous_commit.py59 except Exception:CODE
LOWtest/compare_with_previous_commit.py80 except Exception as e:CODE
LOWtest/benchmark/bench_agents.py150 except Exception as e: # keep the run alive; record failure count onlyCODE
LOWtest/benchmark/static_inference/static_benchmark.py1296 except Exception:CODE
LOWtest/benchmark/static_inference/static_benchmark.py1302 except Exception:CODE
LOWtest/benchmark/service/benchmark_multiturn.py124 except Exception as exc:CODE
LOWtest/benchmark/service/benchmark_multiturn.py306 except Exception:CODE
LOWtest/benchmark/service/benchmark_multiturn.py347 except Exception as e:CODE
MEDIUMtest/benchmark/service/benchmark_qps.py122def async_post_stream_openai(url, prompt, max_new_tokens, session):CODE
MEDIUMtest/benchmark/service/benchmark_qps.py170def async_post_stream_lightllm(url, prompt, max_new_tokens, session):CODE
LOW⚡test/benchmark/service/benchmark_qps.py155 except Exception:CODE
LOW⚡test/benchmark/service/benchmark_qps.py161 except Exception as e:CODE
LOW⚡test/benchmark/service/benchmark_qps.py165 except Exception as e:CODE
LOW⚡test/benchmark/service/benchmark_qps.py203 except Exception:CODE
LOW⚡test/benchmark/service/benchmark_qps.py209 except Exception as e:CODE
LOW⚡test/benchmark/service/benchmark_qps.py213 except Exception as e:CODE
LOWtest/benchmark/service/benchmark_qps.py284 except Exception as e:CODE
LOWtest/benchmark/service/benchmark_qps.py317 except Exception as e:CODE
LOWtest/benchmark/service/benchmark_prompt_cache.py72 except Exception as e:CODE
LOWtest/benchmark/service/benchmark_sharegpt.py129 except Exception:CODE
LOWtest/format_out/gomoku_game.py158 except Exception as e:CODE
LOWtest/format_out/gomoku_game.py184 except Exception as e:CODE
LOWtest/test_api/test_rl_endpoints.py112 except Exception:CODE
LOWtest/test_api/test_abort_chaos.py53 except Exception as e:CODE
LOWtest/test_api/test_openai_api.py373 except Exception as e:CODE
LOWtest/test_api/test_openai_api.py389 except Exception as e:CODE
LOWtest/test_api/test_openai_api.py401 except Exception as e:CODE
LOWtest/test_api/test_openai_api.py419 except Exception as e:CODE
LOWtest/test_api/test_openai_api.py498 except Exception as e:CODE
LOWtest/test_api/test_openai_api.py555 except Exception as e:CODE
LOWtest/test_api/test_openai_api.py572 except Exception as e:CODE
LOWtest/test_api/test_openai_api.py593 except Exception as e:CODE
LOWtest/test_api/test_openai_api.py616 except Exception as e:CODE
LOWtest/test_api/test_openai_api.py638 except Exception as e:CODE
LOWtest/test_api/test_openai_api.py662 except Exception as e:CODE
LOWtest/test_api/test_openai_api.py682 except Exception as e:CODE
LOWtest/test_api/test_openai_api.py748 except Exception as e:CODE
LOWtest/test_api/test_openai_api.py767 except Exception as e:CODE
LOWtest/test_api/test_openai_api.py793 except Exception as e:CODE
LOWtest/test_api/test_stream_fc.py644 except Exception as e:CODE
LOWtest/test_api/test_abort_request.py123 except Exception:CODE
LOWtest/test_api/test_abort_request.py145 except Exception as e:CODE
LOWtest/test_api/test_abort_request.py150 except Exception as e:CODE
LOWtest/test_api/test_abort_request.py408 except Exception as e:CODE
LOWtest/performance/audio_test.py226 except Exception as e:CODE
LOWtest/performance/audio_test.py282 except Exception as e:CODE
LOWtest/performance/multimodal_test.py164 except Exception as e:CODE
LOWtest/performance/multimodal_test.py209 except Exception as e:CODE
LOWtest/performance/multimodal_test.py294 except Exception as e:CODE
LOWtest/kernel/moe_sum_reduce_tuning_bf16.py95 except Exception as ex:CODE
LOWtest/kernel/llama_gqa_diverse_decode_stage1_tuning.py168 except Exception as ex:CODE
LOWtest/kernel/deepseekv3_rotary_emb_tuning.py104 except Exception as ex:CODE
LOWtest/kernel/deepseekv2_gqa_decode_tuning.py159 except Exception as ex:CODE
LOWtest/kernel/deepseekv3_fp8_block_gemm_tuning.py101 except Exception as ex:CODE
LOWtest/kernel/llama_gqa_diverse_decode_stage2_tuning.py137 except Exception as ex:CODE
LOWtest/kernel/llama_gqa_decode_vsm_tuning.py134 except Exception as ex:CODE
LOWtest/acc/bfcl/eval_bfcl.py114 except Exception as e:CODE
MEDIUMtest/acc/bfcl/eval_bfcl.py115 print(f"Error downloading {filename}: {e}")CODE
LOWtest/acc/bfcl/eval_bfcl.py462 except Exception as e:CODE
LOWtest/acc/bfcl/eval_bfcl.py555 except Exception as e:CODE
166 more matches not shown…
Deep Nesting207 hits · 188 pts
SeverityFileLineSnippetContext
LOWtest/benchmark/bench_agents.py94CODE
LOWtest/benchmark/service/benchmark_glm53_flash.py55CODE
LOWtest/benchmark/service/benchmark_multiturn.py233CODE
LOWtest/benchmark/service/benchmark_multiturn.py536CODE
LOWtest/benchmark/service/benchmark_multiturn.py691CODE
LOWtest/benchmark/service/benchmark_qps.py122CODE
LOWtest/benchmark/service/benchmark_qps.py170CODE
LOWtest/benchmark/service/benchmark_qps.py250CODE
LOWtest/benchmark/service/benchmark_prompt_cache.py37CODE
LOWtest/benchmark/kernel/benchmark_fused_moe_triton.py12CODE
LOWtest/format_out/gomoku_game.py49CODE
LOWtest/format_out/qabot.py4CODE
LOWtest/test_api/test_rl_endpoints.py170CODE
LOWtest/test_api/test_openai_api.py406CODE
LOWtest/test_api/test_openai_api.py502CODE
LOWtest/test_api/test_openai_api.py752CODE
LOWtest/test_api/test_openai_api.py41CODE
LOWtest/test_api/test_openai_api.py99CODE
LOWtest/test_api/test_openai_api.py148CODE
LOWtest/test_api/test_anthropic_extra_body.py785CODE
LOWtest/test_api/test_stream_fc.py91CODE
LOWtest/test_api/test_stream_fc.py435CODE
LOWtest/test_api/test_abort_request.py84CODE
LOWtest/performance/audio_test.py180CODE
LOWtest/performance/audio_test.py193CODE
LOWtest/performance/audio_test.py239CODE
LOWtest/performance/multimodal_test.py245CODE
LOWtest/kernel/moe_sum_reduce_tuning_bf16.py127CODE
LOWtest/kernel/llama_gqa_diverse_decode_stage1_tuning.py181CODE
LOWtest/kernel/llama_gqa_diverse_decode_stage1_tuning.py214CODE
LOWtest/kernel/deepseekv3_rotary_emb_tuning.py130CODE
LOWtest/kernel/deepseekv2_gqa_decode_tuning.py167CODE
LOWtest/kernel/deepseekv2_gqa_decode_tuning.py206CODE
LOWtest/kernel/deepseekv3_fp8_block_gemm_tuning.py137CODE
LOWtest/kernel/llama_gqa_diverse_decode_stage2_tuning.py147CODE
LOWtest/kernel/llama_gqa_diverse_decode_stage2_tuning.py179CODE
LOWtest/kernel/llama_gqa_decode_vsm_tuning.py147CODE
LOWtest/kernel/llama_gqa_decode_vsm_tuning.py187CODE
LOWtest/acc/bfcl/eval_bfcl.py119CODE
LOWtest/acc/bfcl/eval_bfcl.py142CODE
LOWtest/acc/bfcl/eval_bfcl.py279CODE
LOWtest/acc/bfcl/eval_bfcl.py306CODE
LOWtest/acc/bfcl/eval_bfcl.py382CODE
LOWtest/acc/bfcl/eval_bfcl.py466CODE
LOWunit_tests/utils/test_atexit_exit_modes.py112CODE
LOWunit_tests/common/kv_trans_kernel/test_nixl_kv_trans.py30CODE
LOWunit_tests/common/fused_moe/test_activation_config.py33CODE
LOWunit_tests/common/fused_moe/test_deepep.py141CODE
LOW…del/triton_kernel/linear_att/test_causal_conv1d_mtp.py9CODE
LOWformat_out/impl.py34CODE
LOWformat_out/grammer/dpda.py406CODE
LOWformat_out/grammer/dpda.py501CODE
LOWformat_out/grammer/core.py320CODE
LOWformat_out/grammer/core.py342CODE
LOWformat_out/grammer/core.py377CODE
LOWformat_out/grammer/core.py228CODE
LOWformat_out/grammer/core.py237CODE
LOWformat_out/grammer/core.py272CODE
LOWlightllm/server/reasoning_parser.py61CODE
LOWlightllm/server/reasoning_parser.py152CODE
147 more matches not shown…
Hallucination Indicators8 hits · 80 pts
SeverityFileLineSnippetContext
CRITICALlightllm/server/visualserver/manager.py54 self.cache_client._channel.stream.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)CODE
CRITICALlightllm/server/visualserver/model_infer/model_rpc.py127 self.cache_client._channel.stream.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)CODE
CRITICALlightllm/server/httpserver/manager.py93 self.cache_client._channel.stream.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)CODE
CRITICALlightllm/server/httpserver/manager.py942 self.router_profiler_client._channel.stream.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)CODE
CRITICALlightllm/server/audioserver/manager.py48 self.cache_client._channel.stream.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)CODE
CRITICALlightllm/server/audioserver/model_infer/model_rpc.py57 self.cache_client._channel.stream.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)CODE
CRITICAL…el_infer/mode_backend/dp_backend/dp_shared_kv_trans.py117 self.backend.model.mem_manager.operator.copy_kv_from_other_dp_ranks(CODE
CRITICAL…on/basemodel/triton_kernel/linear_att/fla/ops/utils.py151 triton.runtime.driver.active.utils.get_device_properties(i)["max_shared_mem"]CODE
Cross-Language Confusion12 hits · 78 pts
SeverityFileLineSnippetContext
HIGH…t_tests/server/core/objs/test_out_token_circlequeue.py19 queue.push("token1", 0, False, 1)CODE
HIGH⚡…t_tests/server/core/objs/test_out_token_circlequeue.py37 queue.push("token1", 0, False, 1)CODE
HIGH⚡…t_tests/server/core/objs/test_out_token_circlequeue.py38 queue.push("token2", 1, False, 2)CODE
HIGH⚡…t_tests/server/core/objs/test_out_token_circlequeue.py39 queue.push("token3", 2, False, 3)CODE
HIGH⚡…t_tests/server/core/objs/test_out_token_circlequeue.py73 queue.push(f"token{i}", i, False, 1)CODE
HIGH⚡…t_tests/server/core/objs/test_out_token_circlequeue.py79 queue.push("token_overflow", LIGHTLLM_OUT_TOKEN_QUEUE_SIZE, False, 1)CODE
HIGH…t_tests/server/core/objs/test_out_token_circlequeue.py95 queue.push(f"token{i}", i, False, i)CODE
HIGH…t_tests/server/core/objs/test_out_token_circlequeue.py107 queue.push("token1", 0, False, 1)CODE
HIGH…t_tests/server/core/objs/test_out_token_circlequeue.py108 queue.push("token2", 1, False, 2)CODE
HIGHlightllm/server/detokenization/manager.py122 decode_req.req.out_tokens_queue.push(new_text, src_index, special, count_output_tokens)CODE
HIGH…m/models/gemma4/layer_infer/transformer_layer_infer.py39 # Some E-series checkpoints leave num_global_key_value_heads = null;COMMENT
HIGH…odels/gemma4/layer_weights/transformer_layer_weight.py27 # Some E-series checkpoints leave num_global_key_value_heads = null;COMMENT
Self-Referential Comments21 hits · 63 pts
SeverityFileLineSnippetContext
MEDIUMgenerate_requirements_musa.sh35# Create the output file with a header commentCOMMENT
MEDIUMtest/acc/bfcl/eval_bfcl.py164 # Create a mapping from id to answerCOMMENT
MEDIUMunit_tests/server/core/objs/test_shm_array.py36 # Create a new instance to link the existing shmCOMMENT
MEDIUMunit_tests/server/core/objs/test_shm_array.py46 # Create a new shm with a different sizeCOMMENT
MEDIUMunit_tests/server/core/objs/test_atomic_array_lock.py11 # Create an instance of AtomicShmArrayLockCOMMENT
MEDIUMlightllm/distributed/pynccl_wrapper.py22# This file is a pure Python wrapper for the NCCL library.COMMENT
MEDIUMlightllm/models/neo_chat_moe/neo_visual.py88 # Create the batch index for each patch (B x patch count)COMMENT
MEDIUM…mon/basemodel/triton_kernel/linear_att/fla/__init__.py5# This file contains code copied from the flash-linear-attention project.COMMENT
MEDIUM…n/basemodel/triton_kernel/linear_att/fla/ops/l2norm.py5# This file contains code copied from the flash-linear-attention project.COMMENT
MEDIUM…semodel/triton_kernel/linear_att/fla/ops/solve_tril.py5# This file contains code copied from the flash-linear-attention project.COMMENT
MEDIUM…on/basemodel/triton_kernel/linear_att/fla/ops/index.py5# This file contains code copied from the flash-linear-attention project.COMMENT
MEDIUM…basemodel/triton_kernel/linear_att/fla/ops/__init__.py5# This file contains code copied from the flash-linear-attention project.COMMENT
MEDIUM…on/basemodel/triton_kernel/linear_att/fla/ops/chunk.py5# This file contains code copied from the flash-linear-attention project.COMMENT
MEDIUM…ommon/basemodel/triton_kernel/linear_att/fla/ops/op.py5# This file contains code copied from the flash-linear-attention project.COMMENT
MEDIUM…on/basemodel/triton_kernel/linear_att/fla/ops/utils.py5# This file contains code copied from the flash-linear-attention project.COMMENT
MEDIUM…/basemodel/triton_kernel/linear_att/fla/ops/chunk_o.py5# This file contains code copied from the flash-linear-attention project.COMMENT
MEDIUM…/basemodel/triton_kernel/linear_att/fla/ops/wy_fast.py5# This file contains code copied from the flash-linear-attention project.COMMENT
MEDIUM…n/basemodel/triton_kernel/linear_att/fla/ops/cumsum.py5# This file contains code copied from the flash-linear-attention project.COMMENT
MEDIUM…iton_kernel/linear_att/fla/ops/chunk_scaled_dot_kkt.py5# This file contains code copied from the flash-linear-attention project.COMMENT
MEDIUM…odel/triton_kernel/linear_att/fla/ops/chunk_delta_h.py5# This file contains code copied from the flash-linear-attention project.COMMENT
MEDIUM…el/triton_kernel/linear_att/fla/ops/fused_recurrent.py5# This file contains code copied from the flash-linear-attention project.COMMENT
Over-Commented Block65 hits · 59 pts
SeverityFileLineSnippetContext
LOWdocker/scripts/build.sh1#!/usr/bin/env bashCOMMENT
LOWtest/benchmark/bench_agents.py1# Example:COMMENT
LOWtest/benchmark/service/benchmark_mcq.py1# Adapted from benchmarks/benchmark_serving.pyCOMMENT
LOWtest/benchmark/service/benchmark_sharegpt.py1# Adapted from benchmarks/benchmark_serving.pyCOMMENT
LOWtest/cpu_cache_kernel/test_speed.py121)COMMENT
LOWtest/performance/multimodal_test.py541# import argparseCOMMENT
LOWtest/performance/multimodal_test.py561# os.environ["PYTHONHASHSEED"] = str(seed)COMMENT
LOWtest/performance/multimodal_test.py581COMMENT
LOWtest/performance/multimodal_test.py601# def get_prompts_from_json(json_path, tokenizer, output_len, range_ratio):COMMENT
LOWtest/performance/multimodal_test.py621# # -------------------- 请求函数 --------------------COMMENT
LOWtest/performance/multimodal_test.py641# start = time.time()COMMENT
LOWtest/performance/multimodal_test.py661COMMENT
LOWtest/performance/multimodal_test.py681# }COMMENT
LOWtest/performance/multimodal_test.py701# # -------------------- 并发控制 --------------------COMMENT
LOWtest/performance/multimodal_test.py721# end = time.time()COMMENT
LOWtest/performance/multimodal_test.py741# args = parser.parse_args()COMMENT
LOWtest/performance/multimodal_test.py761# run_fixed_concurrency_benchmark(async_task, args.url, prompts, max_new_tokens, args.num_concurrent)COMMENT
LOWtest/performance/multimodal_test.py781# final_output_lens.append(len(result))COMMENT
LOWtest/performance/multimodal_test.py801# "Total Throughput": (sum(input_lens) + sum(final_output_lens)) / (end_time - start_time),COMMENT
LOWtest/performance/multimodal_test.py821# with open(args.dump_file, "w") as f:COMMENT
LOWtest/start_scripts/draft.sh21--enable_cpu_cache --cpu_cache_storage_size 66 --cpu_cache_token_page_size 128COMMENT
LOWtest/start_scripts/multi_pd_master/pd_prefill.sh21# if you want to enable microbatch overlap, you can uncomment the following linesCOMMENT
LOWtest/acc/test_deepseekr1_mtp_ep.sh21# 不要写额外的脚本来启动服务,就是单独一个一个的按照上面的描述启动服务,然后再执行评测脚本,然后注意等待服务启动完成,可以20s检测一次其控制台输出,看是否启动完成,还是启动报错。COMMENT
LOWtest/acc/test_qwen2.5_fp8kv_sph.sh1# 先清理掉占用显卡和端口的进程COMMENT
LOWtest/acc/test_pd.sh61--tasks gsm8k --batch_size 1 --confirm_run_unsafe_code --limit 1COMMENT
LOWtest/acc/bfcl/run_bfcl.sh1#!/bin/bashCOMMENT
LOWlightllm/distributed/pynccl_wrapper.py1# Adapted fromCOMMENT
LOWlightllm/distributed/pynccl_wrapper.py21COMMENT
LOWlightllm/distributed/pynccl_wrapper.py181 Function(COMMENT
LOWlightllm/distributed/communication_op.py1# Adapted fromCOMMENT
LOWlightllm/distributed/pynccl.py1# Adapted fromCOMMENT
LOWlightllm/server/api_http.py1# Adapted from vllm/entrypoints/api_server.pyCOMMENT
LOWlightllm/server/reasoning_parser.py1# Adaptive from SGlang [https://github.com/sgl-project/sglang/blob/main/python/sglang/srt/parser/reasoning_parser.py]COMMENT
LOWlightllm/server/function_call_parser.py1# Adaptive from SGlang [https://github.com/sgl-project/sglang/blob/main/python/sglang/srt/function_call_parser.py]COMMENT
LOWlightllm/server/tokenizer.py1# Adapted from vllm/transformers_utils/tokenizer.pyCOMMENT
LOWlightllm/server/core/objs/req.py481 a_len = max(self.input_len + has_out_len + 1, self.shm_cur_kv_len + 1)COMMENT
LOWlightllm/server/visualserver/model_infer/model_rpc.py41 def exposed_init_model(self, kvargs):COMMENT
LOWlightllm/server/httpserver/manager.py421 # PD Prefill 节点上报 prompt ids 后,需要等待 PD master 从 Decode 节点取得COMMENT
LOW…de_backend/pd/decode_node_impl/decode_trans_process.py61 # 上排队,而推理在另一进程的 stream 上执行,彼此无法 cudaStreamWaitEventCOMMENT
LOWlightllm/utils/sgl_utils.py121 # 取模将页编号映射到 [0, num_pages),再整理为每个请求一行、每行 max_pages 个页编号的页表。COMMENT
LOWlightllm/utils/envs_utils.py101def get_lightllm_websocket_max_message_size():COMMENT
LOWlightllm/utils/dist_utils.py1import torch.distributed as distCOMMENT
LOWlightllm/utils/dist_utils.py21# +------+--------------+----------------+-------------+--------------+------------------+COMMENT
LOWlightllm/utils/dist_utils.py61 # "device_id": device_id,COMMENT
LOWlightllm/utils/rl/bucketed_weight_transfer.py1# Copyright 2025 Bytedance Ltd. and/or its affiliatesCOMMENT
LOW…llm/models/qwen3_omni_moe_thinker/qwen3_omni_visual.py1# coding=utf-8COMMENT
LOW…/models/neo_chat_moe/triton_kernel/get_neo_position.py161 # .unsqueeze(0)COMMENT
LOWlightllm/models/qwen2_vl/qwen2_visual.py1# coding=utf-8COMMENT
LOWlightllm/models/whisper/modeling_whisper.py1# Copyright 2025 The HuggingFace Inc. team.COMMENT
LOWlightllm/models/qwen3_vl/qwen3_visual.py1# coding=utf-8COMMENT
LOWlightllm/common/cuda_wrapper.py1# Adapted fromCOMMENT
LOWlightllm/common/basemodel/infer_struct.py81 self.max_q_seq_len: int = NoneCOMMENT
LOWlightllm/common/basemodel/batch_objs.py21 b_mtp_index: torch.Tensor = NoneCOMMENT
LOWlightllm/common/basemodel/batch_objs.py121class ModelMtpOutputCollector:COMMENT
LOW…/common/basemodel/triton_kernel/flashinfer_mla_plan.py1import torchCOMMENT
LOW…emodel/triton_kernel/fused_moe/grouped_fused_moe_ep.py281 combined_x = NoneCOMMENT
LOW…basemodel/triton_kernel/fused_moe/grouped_fused_moe.py1"""Fused MoE kernel."""COMMENT
LOW…ommon/basemodel/triton_kernel/fused_moe/topk_select.py1# Adapted fromCOMMENT
LOW…/triton_kernel/alibi_att/token_flashattention_nopad.py121 returnCOMMENT
LOW…/triton_kernel/alibi_att/token_flashattention_nopad.py141# o,COMMENT
5 more matches not shown…
Modern Structural Boilerplate52 hits · 53 pts
SeverityFileLineSnippetContext
LOWdocs/CN/source/conf.py22logger = logging.getLogger(__name__)CODE
LOWdocs/EN/source/conf.py22logger = logging.getLogger(__name__)CODE
LOWlightllm/distributed/pynccl_wrapper.py53logger = logging.getLogger(__name__)CODE
LOWlightllm/distributed/pynccl_wrapper.py394__all__ = [CODE
LOWlightllm/distributed/pynccl.py45logger = logging.getLogger(__name__)CODE
LOWlightllm/server/reasoning_parser.py954 def update_reasoning_token_count(self, token_id: int) -> None:CODE
LOWlightllm/server/function_call_parser.py32logger = logging.getLogger(__name__)CODE
LOW⚡lightllm/server/embed_cache/impl/naive_memory_cache.py251 def set_items_data(self, ids: list[int]) -> None:CODE
LOW⚡lightllm/server/embed_cache/impl/naive_memory_cache.py258 def set_items_embed(self, ids: list[int]) -> None:CODE
LOW…er/httpserver_for_pd_master/pd_selector/cache_aware.py73 def update_config(self, config: CacheAwareConfig) -> None:CODE
LOW…ver/multi_level_kv_cache/cache_placement_controller.py56 def set_req_cache_way(self, reqs: Sequence["InferReq"]) -> None:CODE
LOW…ver/multi_level_kv_cache/cache_placement_controller.py63 def set_req_cache_way(self, reqs: Sequence["InferReq"]) -> None:CODE
LOW…ver/multi_level_kv_cache/cache_placement_controller.py79 def set_req_cache_way(self, reqs: Sequence["InferReq"]) -> None:CODE
LOW…ver/multi_level_kv_cache/cache_placement_controller.py123 def set_req_cache_way(self, reqs: Sequence["InferReq"]) -> None:CODE
LOWlightllm/server/multi_level_kv_cache/__init__.py11__all__ = [CODE
LOW…/server/router/model_infer/mtp_speculative/__init__.py5__all__ = ["DPOverlapSpecEngine", "SpecEngine"]CODE
LOW…outer/model_infer/mtp_speculative/dp_overlap_engine.py186__all__ = ["DPOverlapSpecEngine"]CODE
LOW…llm/server/router/model_infer/mtp_speculative/utils.py96__all__ = [CODE
LOW…uter/model_infer/mtp_speculative/proposers/__init__.py43__all__ = [CODE
LOW…router/model_infer/mtp_speculative/planner/__init__.py7__all__ = [CODE
LOW…r/router/model_infer/mtp_speculative/planner/dspark.py86 def _update_confidence_probs(self, confidence_probs, req_num: int) -> None:CODE
LOW…infer/mtp_speculative/dp_overlap_proposers/__init__.py48__all__ = ["build_dp_overlap_spec_proposer"]CODE
LOWlightllm/utils/infer_utils.py85def set_random_seed(seed: int) -> None:CODE
LOWlightllm/models/__init__.py8__all__ = ["get_model", "get_model_class", "get_draft_model_class", *MODEL_CLASS_PATHS]CODE
LOWlightllm/models/qwen3_dspark/__init__.py3__all__ = ["Qwen3DSparkModel"]CODE
LOWlightllm/models/qwen3_dspark/layer_weights/__init__.py5__all__ = ["Qwen3DSparkPreAndPostLayerWeight"]CODE
LOWlightllm/models/glm4_moe_lite_mtp/__init__.py3__all__ = ["Glm4MoeLiteMTPModel"]CODE
LOW…llm/models/glm4_moe_lite_mtp/layer_weights/__init__.py5__all__ = ["Glm4MoeLiteMTPPreAndPostLayerWeight"]CODE
LOWlightllm/models/qwen3_dflash/__init__.py3__all__ = ["Qwen3DFlashModel"]CODE
LOWlightllm/models/qwen3_dflash/layer_weights/__init__.py8__all__ = [CODE
LOWlightllm/models/glm4_moe_lite/__init__.py4__all__ = ["Glm4MoeLiteTpPartModel", "Glm4MoeLiteInferStateInfo"]CODE
LOWlightllm/models/glm4_moe_lite/layer_infer/__init__.py3__all__ = ["Glm4MoeLiteTransformerLayerInfer"]CODE
LOWlightllm/models/glm4_moe_lite/layer_weights/__init__.py3__all__ = ["Glm4MoeLiteTransformerLayerWeight"]CODE
LOWlightllm/models/qwen3_5_dflash/__init__.py3__all__ = ["Qwen3_5DFlashModel"]CODE
LOW…ghtllm/models/qwen3_5_dflash/layer_weights/__init__.py5__all__ = ["Qwen35DFlashPreAndPostLayerWeight"]CODE
LOWlightllm/models/qwen2_vl/qwen2_visual.py111 def update_freqs_cache(self, seqlen: int) -> None:CODE
LOWlightllm/models/qwen3_5_dspark/__init__.py3__all__ = ["Qwen3_5DSparkModel"]CODE
LOWlightllm/models/qwen3_5/__init__.py13__all__ = [CODE
LOWlightllm/models/qwen3next/__init__.py3__all__ = ["Qwen3NextTpPartModel"]CODE
LOWlightllm/models/qwen3_5_moe_mtp/__init__.py3__all__ = ["Qwen3_5MoeMTPModel"]CODE
LOW…htllm/models/qwen3_5_moe_mtp/layer_weights/__init__.py5__all__ = ["Qwen3_5MoeMTPTransformerLayerWeight"]CODE
LOWlightllm/common/basemodel/__init__.py15__all__ = [CODE
LOWlightllm/common/basemodel/attention/linear/__init__.py9__all__ = [CODE
LOWlightllm/common/basemodel/attention/nsa/__init__.py14__all__ = [CODE
LOWlightllm/common/basemodel/triton_kernel/mhc/__init__.py38__all__ = [CODE
LOW…/common/basemodel/triton_kernel/linear_att/__init__.py10__all__ = [CODE
LOW…basemodel/triton_kernel/linear_att/fla/ops/__init__.py12__all__ = [CODE
LOW…on/basemodel/triton_kernel/linear_att/fla/ops/utils.py22logger = logging.getLogger(__name__)CODE
LOW…iton_kernel/att/decode_att/gqa/mtp_diverse/__init__.py10__all__ = [CODE
LOWlightllm/common/kv_cache_mem_manager/__init__.py13__all__ = [CODE
LOWlightllm/common/cpu_cache/__init__.py3__all__ = ["CpuCacheCreator", "CpuCacheTensorSpec"]CODE
LOWlightllm/common/req_manager/__init__.py7__all__ = [CODE
AI Structural Patterns54 hits · 52 pts
SeverityFileLineSnippetContext
LOWunit_tests/models/qwen2_vl/test_rotary_pos_emb.py22CODE
LOW…kernel/linear_att/test_mtp_fused_recurrent_autotune.py37CODE
LOW…tt/int8kv/test_int8kv_flash_decoding_diverse_stage1.py8CODE
LOWlightllm/server/pd_io_struct.py269CODE
LOWlightllm/server/metrics/manager.py63CODE
LOWlightllm/server/core/objs/py_sampling_params.py28CODE
LOWlightllm/server/core/objs/out_token_circlequeue.py103CODE
LOWlightllm/server/embed_cache/utils.py19CODE
LOWlightllm/utils/sgl_utils.py148CODE
LOWlightllm/utils/dist_utils.py326CODE
LOW…/models/gpt_oss/layer_infer/transformer_layer_infer.py28CODE
LOW…/models/gpt_oss/layer_infer/transformer_layer_infer.py33CODE
LOW…emma4/triton_kernel/context_attention_fwd_gemma4_mm.py347CODE
LOWlightllm/models/glm5_next/glm5_next_visual.py101CODE
LOWlightllm/models/qwen_vl/qwen_visual.py241CODE
LOWlightllm/models/qwen2_5_vl/qwen2_5_visual.py139CODE
LOW…tllm/models/vit/layer_infer/transformer_layer_infer.py40CODE
LOW…tllm/models/vit/layer_infer/transformer_layer_infer.py54CODE
LOWlightllm/models/tarsier2/tarsier2_visual.py153CODE
LOWlightllm/models/qwen3_omni_moe_thinker/audio_process.py18CODE
LOWlightllm/models/qwen3_omni_moe_thinker/audio_process.py106CODE
LOW…tllm/models/qwen3_omni_moe_thinker/qwen3_omni_audio.py150CODE
LOW…llm/models/qwen3_omni_moe_thinker/qwen3_omni_visual.py124CODE
LOWlightllm/models/neo_chat_moe/neo_visual.py107CODE
LOW…odels/deepseek2/layer_infer/transformer_layer_infer.py115CODE
LOW…eepseek2/triton_kernel/context_flashattention_nopad.py438CODE
LOWlightllm/models/qwen2_vl/qwen2_visual.py179CODE
LOWlightllm/models/qwen2_vl/vision_process.py81CODE
LOW…odels/qwen3next/layer_infer/transformer_layer_infer.py326CODE
LOWlightllm/models/whisper/modeling_whisper.py51CODE
LOWlightllm/models/qwen3_vl/qwen3_visual.py120CODE
LOWlightllm/common/quantization/w8a8gx.py115CODE
LOWlightllm/common/basemodel/basemodel.py495CODE
LOWlightllm/common/basemodel/attention/triton/fp.py249CODE
LOWlightllm/common/basemodel/attention/triton/mla.py159CODE
LOW…emodel/triton_kernel/fused_moe/grouped_fused_moe_ep.py248CODE
LOW…basemodel/triton_kernel/fused_moe/grouped_fused_moe.py479CODE
LOW…basemodel/triton_kernel/fused_moe/grouped_fused_moe.py1001CODE
LOW…basemodel/triton_kernel/fused_moe/grouped_fused_moe.py1129CODE
LOW…basemodel/triton_kernel/fused_moe/grouped_fused_moe.py1171CODE
LOW…basemodel/triton_kernel/fused_moe/grouped_fused_moe.py1202CODE
LOW…basemodel/triton_kernel/fused_moe/grouped_fused_moe.py1244CODE
LOW…basemodel/triton_kernel/fused_moe/grouped_fused_moe.py1275CODE
LOW…iton_kernel/alibi_att/token_attention_nopad_reduceV.py108CODE
LOW…riton_kernel/alibi_att/context_flashattention_nopad.py196CODE
LOW…mmon/basemodel/triton_kernel/linear_att/fla/ops/kda.py1002CODE
LOW…odel/triton_kernel/linear_att/fla/ops/chunk_delta_h.py273CODE
LOW…el/triton_kernel/linear_att/fla/ops/fused_recurrent.py250CODE
LOW…el/triton_kernel/linear_att/fla/ops/fused_recurrent.py432CODE
LOW…el/triton_kernel/linear_att/fla/ops/fused_recurrent.py385CODE
LOW…mha/stage3_decode_att/token_attention_nopad_reduceV.py110CODE
LOW…on_kernel/att/prefill_att/context_attention_fwd_neo.py274CODE
LOW…yer_weights/meta_weights/fused_moe/impl/triton_impl.py144CODE
LOW…r_weights/meta_weights/fused_moe/impl/deepgemm_impl.py97CODE
Cross-File Repetition9 hits · 45 pts
SeverityFileLineSnippetContext
HIGHtest/benchmark/service/benchmark_client.py0gets a tokenizer for the given model name via huggingface.STRING
HIGHtest/benchmark/service/benchmark_qps.py0gets a tokenizer for the given model name via huggingface.STRING
HIGHtest/benchmark/service/benchmark_mcq.py0gets a tokenizer for the given model name via huggingface.STRING
HIGHtest/benchmark/service/benchmark_sharegpt.py0gets a tokenizer for the given model name via huggingface.STRING
HIGHtest/performance/multimodal_test.py0gets a tokenizer for the given model name via huggingface.STRING
HIGHlightllm/server/tokenizer.py0gets a tokenizer for the given model name via huggingface.STRING
HIGH…server/router/model_infer/mode_backend/base_backend.py0将错误请求从 req_ids 中过滤出来, 然后让 _get_classed_reqs 进行处理。 该函数 主要用于在 nixl pd 分离模式下, 由子类继承重载, prefill 和 decode 节点过滤 kv 传输错误,或者 kv STRING
HIGH…nfer/mode_backend/pd/prefill_node_impl/prefill_impl.py0将错误请求从 req_ids 中过滤出来, 然后让 _get_classed_reqs 进行处理。 该函数 主要用于在 nixl pd 分离模式下, 由子类继承重载, prefill 和 decode 节点过滤 kv 传输错误,或者 kv STRING
HIGH…_infer/mode_backend/pd/decode_node_impl/decode_impl.py0将错误请求从 req_ids 中过滤出来, 然后让 _get_classed_reqs 进行处理。 该函数 主要用于在 nixl pd 分离模式下, 由子类继承重载, prefill 和 decode 节点过滤 kv 传输错误,或者 kv STRING
Redundant / Tautological Comments26 hits · 41 pts
SeverityFileLineSnippetContext
LOWgenerate_requirements_musa.sh55 # Check if this is a CUDA package to skipCOMMENT
LOWgenerate_requirements_musa.sh69 # Check if this is a torch-related package (remove version pin)COMMENT
LOWtest/test_api/test_gsmk.py58 # Check if the cache file already existsCOMMENT
LOWtest/test_api/test_gsmk.py233 # Print resultsCOMMENT
LOWtest/test_api/test_anthropic_extra_body.py908 # Set logger to DEBUG so caplog can capture itCOMMENT
LOWtest/acc/test_gsmk.py42 # Check if the cache file already existsCOMMENT
LOWtest/acc/test_gsmk.py215 # Print resultsCOMMENT
LOWtest/acc/bfcl/run_bfcl.sh23# Check if server is runningCOMMENT
LOWtest/acc/bfcl/eval_bfcl.py409 # Check if it's already in standard format {"name": ..., "arguments": ...}COMMENT
LOWlightllm/server/reasoning_parser.py164 # Check if this might be incompleteCOMMENT
LOWlightllm/server/reasoning_parser.py171 # Check if this might be commentary filler between blocksCOMMENT
LOWlightllm/server/reasoning_parser.py201 # Check if this might be commentary filler between blocksCOMMENT
LOWlightllm/server/reasoning_parser.py379 # Check if we have CALL -> TEXT("commentary") -> CHANNEL patternCOMMENT
LOWlightllm/server/reasoning_parser.py524 # Check if we should start filtering commentary (after <|call|> token or tool_call event)COMMENT
LOWlightllm/server/reasoning_parser.py535 # Check if we're in a commentary filtering stateCOMMENT
LOWlightllm/server/api_openai.py832 # Check if it's a list of integers (token IDs)COMMENT
LOW⚡lightllm/server/function_call_parser.py729 # Check if we have a tool call (either the start token or individual tool call)COMMENT
LOW⚡lightllm/server/function_call_parser.py911 # Check if we have a tool call (either the start token or individual tool call)COMMENT
LOW⚡lightllm/server/function_call_parser.py1089 # Check if we have a tool call (either the start token or individual tool call)COMMENT
LOWlightllm/server/function_call_parser.py447 # Check if buffer contains complete end token (without leading newline)COMMENT
LOWlightllm/server/function_call_parser.py454 # Check if buffer might contain partial end token at the endCOMMENT
LOWlightllm/server/function_call_parser.py1485 # Check if we're inside a function_calls block or starting oneCOMMENT
LOWlightllm/server/function_call_parser.py1503 # Check if function_calls block has endedCOMMENT
LOWlightllm/utils/device_utils.py148 # Check if the output contains 'NVLink'COMMENT
LOWlightllm/utils/device_utils.py163 # Check if the output contains 'MTLink'COMMENT
LOW…/meta_weights/fused_moe/gpt_oss_fused_moe_weight_tp.py200 # Check if blocks and scales are on CPU, and move to GPU if soCOMMENT
Dead Code13 hits · 26 pts
SeverityFileLineSnippetContext
MEDIUMtest/test_pd_selector/test_pd_master_multi_choice.py291CODE
MEDIUMtest/test_pd_selector/test_pd_master_multi_choice.py308CODE
MEDIUMtest/test_pd_selector/test_pd_master_multi_choice.py350CODE
MEDIUMtest/test_pd_selector/test_pd_master_multi_choice.py699CODE
MEDIUMtest/test_pd_selector/test_pd_master_multi_choice.py735CODE
MEDIUMtest/test_pd_selector/test_pd_master_multi_choice.py766CODE
MEDIUMunit_tests/server/httpserver/test_pd_generate_error.py24CODE
MEDIUMunit_tests/server/httpserver/test_pd_generate_error.py32CODE
MEDIUMunit_tests/server/httpserver/test_pd_generate_error.py47CODE
MEDIUMunit_tests/server/httpserver/test_pd_generate_error.py59CODE
MEDIUMunit_tests/server/httpserver/test_pd_generate_error.py67CODE
MEDIUMunit_tests/server/httpserver/test_pd_generate_error.py381CODE
MEDIUMformat_out/impl.py61CODE
Structural Annotation Overuse11 hits · 24 pts
SeverityFileLineSnippetContext
LOW⚡test/performance/multimodal_test.py21 # Step 1: Generate a random image (RGB)COMMENT
LOW⚡test/performance/multimodal_test.py24 # Step 2: Convert NumPy array to PIL ImageCOMMENT
LOW⚡test/performance/multimodal_test.py27 # Step 3: Save the image to a BytesIO bufferCOMMENT
LOW⚡test/performance/multimodal_test.py31 # Step 4: Encode the image bytes to Base64COMMENT
LOW⚡test/start_scripts/README.md70# Step 1: Start PD MasterCOMMENT
LOW⚡test/start_scripts/README.md73# Step 2: Start Prefill serviceCOMMENT
LOW⚡test/start_scripts/README.md76# Step 3: Start Decode serviceCOMMENT
LOW⚡test/start_scripts/README.md83# Step 1: Start configuration serverCOMMENT
LOW⚡test/start_scripts/README.md86# Step 2: Start multiple PD MastersCOMMENT
LOW⚡test/start_scripts/README.md90# Step 3: Start Prefill and Decode services with the prefill/decode run modes.COMMENT
LOWlightllm/models/deepseek3_2/encoding_dsv32.py380# NOTE: This function is designed to parse only correctlyCOMMENT
Docstring Block Structure4 hits · 20 pts
SeverityFileLineSnippetContext
HIGHlightllm/utils/shm_utils.py55 Args: name: logical name of the shared memory; the current service prefix is added here expected_siSTRING
HIGH…htllm/models/deepseek2/triton_kernel/weight_dequant.py10 Dequantizes the given weight tensor using the provided scale tensor. Args: x (torch.Tensor): The quantSTRING
HIGH…on/basemodel/triton_kernel/linear_att/fla/ops/chunk.py123 Args: q (torch.Tensor): queries of shape `[B, T, H, K]` if `head_first=False` else `[B, H, T, KSTRING
HIGH…el/triton_kernel/linear_att/fla/ops/fused_recurrent.py453 Args: q (torch.Tensor): queries of shape `[B, T, H, K]`. k (torch.Tensor): STRING
Verbosity Indicators4 hits · 9 pts
SeverityFileLineSnippetContext
LOW⚡test/performance/multimodal_test.py21 # Step 1: Generate a random image (RGB)COMMENT
LOW⚡test/performance/multimodal_test.py24 # Step 2: Convert NumPy array to PIL ImageCOMMENT
LOW⚡test/performance/multimodal_test.py27 # Step 3: Save the image to a BytesIO bufferCOMMENT
LOW⚡test/performance/multimodal_test.py31 # Step 4: Encode the image bytes to Base64COMMENT
Modern AI Meta-Vocabulary2 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMtest/test_api/test_gsmk.py181 # Test questions should start after few-shot examplesCOMMENT
MEDIUMtest/acc/test_gsmk.py163 # Test questions should start after few-shot examplesCOMMENT
AI Slop Vocabulary2 hits · 6 pts
SeverityFileLineSnippetContext
LOWlightllm/server/reasoning_parser.py484 # If no emit, just return the held contentCOMMENT
MEDIUM⚡…emma4/triton_kernel/context_attention_fwd_gemma4_mm.py267# Reference implementation + standalone test harnessCOMMENT
Slop Phrases1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMlightllm/server/tokenizer.py65 # you can try pip install protobuf==3.20.0 to try repairCOMMENT
Overly Generic Function Names3 hits · 3 pts
SeverityFileLineSnippetContext
LOWlightllm/server/visualserver/proxy_manager.py121 def run_task(self, conn: rpyc.Connection, images: List[ImageItem]):CODE
LOW…lm/server/visualserver/model_infer/model_rpc_client.py34 async def run_task(self, images: List[ImageItem], ref_event_list: List[threading.Event]):CODE
LOW…llm/server/audioserver/model_infer/model_rpc_client.py31 async def run_task(self, audios: List[AudioItem], ref_event_list: List[threading.Event]):CODE