Repository Analysis

InternLM/lmdeploy

LMDeploy is a toolkit for compressing, deploying, and serving LLMs.

16.8 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of InternLM/lmdeploy, a Python project with 8,031 GitHub stars. SynthScan v2.0 examined 313,878 lines of code across 1552 source files, recording 4106 pattern matches distributed across 21 syntactic categories. The overall adjusted score of 16.8 places this repository in the Moderate AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

16.8
Adjusted Score
16.8
Raw Score
100%
Time Factor
2026-08-28
Last Push
8.0K
Stars
Python
Language
313.9K
Lines of Code
1.6K
Files
4.1K
Pattern Hits
2026-08-29
Scan Date
0.08
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 125MEDIUM 348LOW 3633

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 4106 distinct pattern matches across 21 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. 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 diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Hyper-Verbose Identifiers2179 hits · 2073 pts
SeverityFileLineSnippetContext
LOWbenchmark/benchmark_chat_completion.py175def _dataset_longest_prefix_match(dataset: str, selected: Sequence[str]) -> str | None:CODE
LOWbenchmark/benchmark_chat_completion.py360def _cached_tokens_from_usage(usage: dict[str, Any] | None) -> int:CODE
LOWbenchmark/profile_restful_api.py159async def async_request_openai_completions(CODE
LOWbenchmark/profile_restful_api.py237async def async_request_openai_chat_completions(CODE
LOWbenchmark/profile_restful_api.py345async def async_request_sglang_generate(CODE
LOWbenchmark/profile_restful_api.py847 def _gen_random_image_data_uri(width: int = width, height: int = height) -> tuple[Image.Image, str, int]:CODE
LOWlmdeploy/deepseek_v4_encoding.py114def tool_calls_from_openai_format(tool_calls):CODE
LOWlmdeploy/deepseek_v4_encoding.py125def tool_calls_to_openai_format(tool_calls):CODE
LOWlmdeploy/deepseek_v4_encoding.py469def sort_tool_results_by_call_order(messages: list[dict[str, Any]]) -> list[dict[str, Any]]:CODE
LOWlmdeploy/deepseek_v4_encoding.py694def parse_message_from_completion_text(text: str, thinking_mode: str) -> dict[str, Any]:CODE
LOWlmdeploy/tokenizer.py70 def _check_transformers_version(self, model_dir: str, trust_remote_code: bool = False):CODE
LOWlmdeploy/tokenizer.py234 def _convert_tokens_to_string_with_added_encoders(CODE
LOWlmdeploy/utils.py638def init_custom_process_group(backend=None,CODE
LOWlmdeploy/messages.py197 def convert_stop_bad_words_to_ids(self, tokenizer: Tokenizer):CODE
LOWlmdeploy/deepseek_v32_encoding.py73def tool_calls_from_openai_format(tool_calls):CODE
LOWlmdeploy/deepseek_v32_encoding.py82def tool_calls_to_openai_format(tool_calls):CODE
LOWlmdeploy/deepseek_v32_encoding.py357def parse_message_from_completion_text(text: str, thinking_mode: str):CODE
LOWlmdeploy/metrics/metrics_processor.py101 def increase_succeeded_requests(self):CODE
LOWlmdeploy/metrics/metrics_processor.py114 def increase_api_routed_requests(self):CODE
LOWlmdeploy/metrics/metrics_processor.py118 def decrease_api_routed_requests(self):CODE
LOWlmdeploy/metrics/stats.py90 def update_from_schedule_metrics(self, scheduled_metrics: ScheduleMetrics):CODE
LOWlmdeploy/lite/apis/calibrate.py184def make_compatible_internvl_config(model_path):CODE
LOWlmdeploy/lite/apis/calibrate.py194 def _get_non_default_generation_parameters(self):CODE
LOWlmdeploy/lite/utils/calib_dataloader.py250def get_neuralmagic_calibration(dataset, tokenizer, nsamples, seed, seqlen):CODE
LOWlmdeploy/lite/utils/memory_efficient.py45def find_modules_by_return_value(model: nn.Module, value: str) -> list[nn.Module]:CODE
LOWlmdeploy/lite/utils/memory_efficient.py197def memory_efficient_inference(model: nn.Module, offload: bool = True, device: str = 'cuda') -> None:CODE
LOWlmdeploy/lite/utils/cal_qparams.py20def cal_qparams_per_channel_absmax(w: torch.Tensor, n_bits: int, return_stats: bool = False) -> QParams:CODE
LOWlmdeploy/lite/utils/cal_qparams.py36def cal_qparams_per_channel_minmax(w: torch.Tensor, n_bits: int, return_stats: bool = False) -> QParams:CODE
LOWlmdeploy/lite/utils/cal_qparams.py58def cal_qparams_per_group_absmax(w: torch.Tensor, n_bits: int, group_size: int, return_stats: bool = False) -> QParams:CODE
LOWlmdeploy/lite/utils/cal_qparams.py79def cal_qparams_per_group_minmax(w: torch.Tensor, n_bits: int, group_size: int, return_stats: bool = False) -> QParams:CODE
LOWlmdeploy/lite/utils/cal_qparams.py105def cal_qparams_per_tensor_minmax(w: torch.Tensor, n_bits: int, return_stats: bool = False) -> QParams:CODE
LOWlmdeploy/lite/utils/cal_qparams.py125def cal_qparams_per_tensor_absmax(w: torch.Tensor, n_bits: int, return_stats: bool = False) -> QParams:CODE
LOWlmdeploy/lite/utils/batch_split.py7def split_decoder_layer_inputs(batch_size, *args: torch.Tensor | Any,CODE
LOWlmdeploy/lite/utils/batch_split.py64def concat_decoder_layer_outputs(batch_outputs: list[Any]) -> Any:CODE
LOWlmdeploy/lite/quantization/calibration.py407 def _wrap_decoder_layers_for_search(self):CODE
LOWlmdeploy/cli/utils.py503 def allow_terminate_by_client(parser):CODE
LOWlmdeploy/cli/utils.py590 def prefix_cache_state_budget(parser):CODE
LOWlmdeploy/cli/utils.py601 def prefix_cache_decode_state_interval(parser):CODE
LOWlmdeploy/cli/utils.py645 def cudagraph_capture_batch_sizes(parser):CODE
LOWlmdeploy/cli/utils.py783 def dllm_confidence_threshold(parser):CODE
LOWlmdeploy/cli/utils.py791 def enable_return_routed_experts(parser):CODE
LOWlmdeploy/cli/utils.py821 def distributed_executor_backend(parser):CODE
LOWlmdeploy/vl/engine.py15def _get_hf_config_mm_feature_dtype(hf_config) -> torch.dtype | None:CODE
LOWlmdeploy/vl/engine.py44def _resolve_mm_feature_dtype(hf_config, backend_config) -> torch.dtype | None:CODE
LOWlmdeploy/vl/engine.py63def _raise_exception_on_finish(task: asyncio.Task) -> None:CODE
LOWlmdeploy/vl/model/internvl.py21def find_closest_aspect_ratio(aspect_ratio, target_ratios, width, height, image_size):CODE
LOWlmdeploy/vl/model/preprocess_utils.py77def _expand_bundled_image_items(item: dict, token_id: int) -> list[dict]:CODE
LOWlmdeploy/vl/model/preprocess_utils.py107def _expand_bundled_video_items(item: dict, token_id: int) -> list[dict]:CODE
LOWlmdeploy/vl/model/preprocess_utils.py189def _expand_bundled_audio_items(item: dict, token_id: int) -> list[dict]:CODE
LOWlmdeploy/vl/model/llava.py30def _clip_vision_tower_load_model(self, **kwargs):CODE
LOWlmdeploy/vl/model/utils.py11def disable_transformers_logging():CODE
LOWlmdeploy/vl/model/deepseek.py14def check_deepseek_vl_install():CODE
LOWlmdeploy/vl/model/base.py383 def to_pytorch_with_input_ids(self, messages):CODE
LOWlmdeploy/vl/media/video.py46 def _get_video_loader_backend(self) -> VideoLoader:CODE
LOWlmdeploy/turbomind/tokenizer_info.py119 def _is_sentencepiece_tokenizer(tokenizer: PreTrainedTokenizerBase) -> bool:STRING
LOWlmdeploy/turbomind/converter.py95def _validate_quant_group_size(model_format: str | None, group_size: int | None) -> int | None:CODE
LOWlmdeploy/turbomind/turbomind.py42def _construct_stop_or_bad_words(words: list[int] = None):CODE
LOWlmdeploy/turbomind/turbomind.py621 def _get_extra_output_processors(self, outputs: dict[str, torch.Tensor], gen_config: GenerationConfig,CODE
LOWlmdeploy/turbomind/models/internvl.py122def _validate_legacy_internvl_chat(cfg):CODE
LOWlmdeploy/turbomind/models/qwen2_vl.py112 def _vision_intermediate_size(self, cfg):CODE
2119 more matches not shown…
Decorative Section Separators302 hits · 1017 pts
SeverityFileLineSnippetContext
MEDIUMlmdeploy/deepseek_v4_encoding.py97# ============================================================COMMENT
MEDIUMlmdeploy/deepseek_v4_encoding.py99# ============================================================COMMENT
MEDIUMlmdeploy/deepseek_v4_encoding.py14# ============================================================COMMENT
MEDIUMlmdeploy/deepseek_v4_encoding.py16# ============================================================COMMENT
MEDIUMlmdeploy/deepseek_v4_encoding.py39# ============================================================COMMENT
MEDIUMlmdeploy/deepseek_v4_encoding.py41# ============================================================COMMENT
MEDIUMlmdeploy/deepseek_v4_encoding.py223# ============================================================COMMENT
MEDIUMlmdeploy/deepseek_v4_encoding.py225# ============================================================COMMENT
MEDIUMlmdeploy/deepseek_v4_encoding.py405# ============================================================COMMENT
MEDIUMlmdeploy/deepseek_v4_encoding.py407# ============================================================COMMENT
MEDIUMlmdeploy/deepseek_v4_encoding.py510# ============================================================COMMENT
MEDIUMlmdeploy/deepseek_v4_encoding.py512# ============================================================COMMENT
MEDIUMlmdeploy/deepseek_v4_encoding.py609# ============================================================COMMENT
MEDIUMlmdeploy/deepseek_v4_encoding.py611# ============================================================COMMENT
MEDIUMlmdeploy/turbomind/linear.py29# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/linear.py31# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/linear.py67# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/linear.py69# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/linear.py104# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/linear.py106# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/linear.py221# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/linear.py223# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/weight_format.py42# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/weight_format.py44# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/weight_format.py83# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/weight_format.py85# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/weight_format.py172# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/weight_format.py174# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/weight_format.py426# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/weight_format.py428# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/_base.py10# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/_base.py12# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/_base.py26# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/_base.py28# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/_base.py45# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/_base.py47# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/_base.py116# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/_base.py118# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/_base.py216 # ------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/_base.py218 # ------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/_base.py234 # ------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/_base.py236 # ------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/_base.py250 # ------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/_base.py252 # ------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/_base.py350 # ------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/_base.py352 # ------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/_base.py365 # ------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/_base.py367 # ------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/_base.py422 # ------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/_base.py424 # ------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/attention.py17# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/attention.py19# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/attention.py79# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/attention.py81# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/ffn.py26# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/ffn.py28# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/ffn.py68# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/ffn.py70# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/ffn.py173# ---------------------------------------------------------------------------COMMENT
MEDIUMlmdeploy/turbomind/builders/ffn.py175# ---------------------------------------------------------------------------COMMENT
242 more matches not shown…
Unused Imports582 hits · 573 pts
SeverityFileLineSnippetContext
LOWbenchmark/benchmark_parser.py9CODE
LOWbenchmark/benchmark_parser.py19CODE
LOWbenchmark/benchmark_parser.py22CODE
LOWbenchmark/benchmark_chat_completion.py14CODE
LOWbenchmark/benchmark_generate.py21CODE
LOWlmdeploy/__init__.py3CODE
LOWlmdeploy/__init__.py3CODE
LOWlmdeploy/__init__.py3CODE
LOWlmdeploy/__init__.py4CODE
LOWlmdeploy/__init__.py4CODE
LOWlmdeploy/__init__.py4CODE
LOWlmdeploy/__init__.py4CODE
LOWlmdeploy/__init__.py4CODE
LOWlmdeploy/__init__.py5CODE
LOWlmdeploy/__init__.py6CODE
LOWlmdeploy/__init__.py7CODE
LOWlmdeploy/__init__.py8CODE
LOWlmdeploy/__init__.py8CODE
LOWlmdeploy/api.py2CODE
LOWlmdeploy/utils.py511CODE
LOWlmdeploy/utils.py519CODE
LOWlmdeploy/utils.py470CODE
LOWlmdeploy/pipeline.py2CODE
LOWlmdeploy/lite/__init__.py2CODE
LOWlmdeploy/lite/__init__.py3CODE
LOWlmdeploy/lite/__init__.py4CODE
LOWlmdeploy/lite/utils/__init__.py3CODE
LOWlmdeploy/lite/utils/__init__.py3CODE
LOWlmdeploy/lite/utils/__init__.py4CODE
LOWlmdeploy/lite/utils/__init__.py4CODE
LOWlmdeploy/lite/utils/__init__.py4CODE
LOWlmdeploy/lite/utils/__init__.py4CODE
LOWlmdeploy/lite/utils/__init__.py4CODE
LOWlmdeploy/lite/utils/__init__.py4CODE
LOWlmdeploy/lite/utils/__init__.py4CODE
LOWlmdeploy/lite/utils/__init__.py4CODE
LOWlmdeploy/lite/utils/__init__.py14CODE
LOWlmdeploy/lite/utils/__init__.py15CODE
LOWlmdeploy/lite/utils/__init__.py15CODE
LOWlmdeploy/lite/utils/__init__.py15CODE
LOWlmdeploy/lite/utils/__init__.py16CODE
LOWlmdeploy/lite/utils/__init__.py17CODE
LOWlmdeploy/lite/quantization/__init__.py2CODE
LOWlmdeploy/lite/quantization/__init__.py2CODE
LOWlmdeploy/lite/quantization/__init__.py3CODE
LOWlmdeploy/lite/quantization/__init__.py3CODE
LOWlmdeploy/lite/quantization/__init__.py4CODE
LOWlmdeploy/lite/quantization/weight/__init__.py2CODE
LOWlmdeploy/lite/quantization/activation/__init__.py2CODE
LOWlmdeploy/lite/quantization/activation/__init__.py2CODE
LOWlmdeploy/lite/quantization/modules/__init__.py2CODE
LOWlmdeploy/lite/model/__init__.py3CODE
LOWlmdeploy/lite/model/__init__.py3CODE
LOWlmdeploy/lite/model/__init__.py7CODE
LOWlmdeploy/cli/__init__.py2CODE
LOWlmdeploy/vl/__init__.py2CODE
LOWlmdeploy/vl/__init__.py2CODE
LOWlmdeploy/vl/__init__.py2CODE
LOWlmdeploy/vl/__init__.py2CODE
LOWlmdeploy/vl/__init__.py2CODE
522 more matches not shown…
Excessive Try-Catch Wrapping276 hits · 317 pts
SeverityFileLineSnippetContext
LOWbenchmark/benchmark_chat_completion.py35except Exception: # noqa: BLE001 - tqdm is optional for CLI progress display.CODE
LOWbenchmark/benchmark_chat_completion.py531 except Exception as e: # noqa: BLE001 - record and keep consuming SSE.CODE
LOWbenchmark/benchmark_chat_completion.py537 except Exception as e: # noqa: BLE001 - benchmark should record failures and continue.CODE
LOWbenchmark/benchmark_chat_completion.py772 except Exception as e:CODE
LOWbenchmark/benchmark_pipeline.py58 except Exception as e:CODE
LOWbenchmark/benchmark_throughput.py58 except Exception as e:CODE
LOWbenchmark/benchmark_serving.py87 except Exception as e:CODE
LOWbenchmark/benchmark_serving.py146 except Exception as e:CODE
LOWbenchmark/benchmark_generate.py56except Exception: # noqa: BLE001CODE
LOWbenchmark/benchmark_generate.py274 except Exception as e: # noqa: BLE001CODE
MEDIUMbenchmark/profile_restful_api.py747 print(f'Error applying chat template: {e}, fallback to <image> tag')CODE
MEDIUMbenchmark/profile_restful_api.py1115 print(f'Error running benchmark for request rate: {request_rate}')CODE
LOWbenchmark/profile_restful_api.py148 except Exception:CODE
LOWbenchmark/profile_restful_api.py227 except Exception:CODE
LOWbenchmark/profile_restful_api.py335 except Exception:CODE
LOWbenchmark/profile_restful_api.py412 except Exception:CODE
LOWbenchmark/profile_restful_api.py744 except Exception as e:CODE
LOWbenchmark/profile_restful_api.py775 except Exception:CODE
LOWbenchmark/profile_restful_api.py1181 except Exception as e:CODE
LOWbenchmark/profile_restful_api.py1244 except Exception as e:CODE
LOWlmdeploy/deepseek_v4_encoding.py105 except Exception:CODE
LOWlmdeploy/deepseek_v4_encoding.py158 except Exception:CODE
LOWlmdeploy/model.py653 except Exception:CODE
LOWlmdeploy/model.py660 except Exception:CODE
LOWlmdeploy/model.py707 except Exception:CODE
LOWlmdeploy/model.py714 except Exception:CODE
LOWlmdeploy/model.py777 except Exception as e:CODE
LOWlmdeploy/model.py793 except Exception as e:CODE
LOWlmdeploy/model.py864 except Exception:CODE
LOWlmdeploy/model.py872 except Exception:CODE
LOWlmdeploy/utils.py471 except Exception as e:CODE
LOWlmdeploy/utils.py512 except Exception:CODE
LOWlmdeploy/utils.py520 except Exception:CODE
MEDIUMlmdeploy/utils.py509def is_deep_ep_installed():CODE
MEDIUMlmdeploy/utils.py517def is_deep_gemm_installed():CODE
LOWlmdeploy/pipeline.py408 except Exception:CODE
LOWlmdeploy/deepseek_v32_encoding.py67 except Exception:CODE
LOWlmdeploy/metrics/metrics_processor.py81 except Exception as e:CODE
LOWlmdeploy/hf_configs/__init__.py25 except Exception as error:CODE
LOWlmdeploy/hf_configs/__init__.py41 except Exception:CODE
LOWlmdeploy/lite/apis/gptq.py43 except Exception:CODE
MEDIUMlmdeploy/cli/chat.py173 print(f'Error: {exc}')CODE
LOWlmdeploy/cli/cli.py130 except Exception:CODE
LOWlmdeploy/vl/engine.py69 except Exception as e:CODE
LOWlmdeploy/vl/model/builder.py81 except Exception as e:CODE
LOWlmdeploy/vl/model/utils.py44 except Exception:CODE
LOWlmdeploy/vl/model/base.py101 except Exception as e:CODE
LOWlmdeploy/vl/media/time_series.py42 except Exception as e:CODE
LOWlmdeploy/vl/media/connection.py53 except Exception as e:CODE
LOWlmdeploy/turbomind/turbomind.py818 except Exception as e:CODE
LOWlmdeploy/serve/parsers/_openai_harmony.py128 except Exception:CODE
LOW…/serve/parsers/tool_parser/deepseek_v32_tool_parser.py78 except Exception:CODE
LOWlmdeploy/serve/core/health.py114 except Exception as e:CODE
LOWlmdeploy/serve/core/async_engine.py316 except Exception:CODE
LOWlmdeploy/serve/core/async_engine.py328 except Exception as e:CODE
LOWlmdeploy/serve/core/async_engine.py453 except Exception:CODE
LOWlmdeploy/serve/core/async_engine.py469 except Exception as e:CODE
LOWlmdeploy/serve/core/async_engine.py606 except Exception as e:CODE
LOWlmdeploy/serve/proxy/streaming_response.py54 except Exception:CODE
LOWlmdeploy/serve/proxy/proxy.py200 except Exception as e: # noqaCODE
216 more matches not shown…
Cross-File Repetition63 hits · 315 pts
SeverityFileLineSnippetContext
HIGHlmdeploy/vl/model/molmo.py0build the vision part of a vlm model when backend is turbomind, or load the whole vlm model when `self.with_llm==true`STRING
HIGHlmdeploy/vl/model/llama4.py0build the vision part of a vlm model when backend is turbomind, or load the whole vlm model when `self.with_llm==true`STRING
HIGHlmdeploy/vl/model/llava.py0build the vision part of a vlm model when backend is turbomind, or load the whole vlm model when `self.with_llm==true`STRING
HIGHlmdeploy/vl/model/deepseek.py0build the vision part of a vlm model when backend is turbomind, or load the whole vlm model when `self.with_llm==true`STRING
HIGHlmdeploy/vl/model/llava_hf.py0build the vision part of a vlm model when backend is turbomind, or load the whole vlm model when `self.with_llm==true`STRING
HIGHlmdeploy/vl/model/llava_next.py0build the vision part of a vlm model when backend is turbomind, or load the whole vlm model when `self.with_llm==true`STRING
HIGHlmdeploy/vl/model/gemma3_vl.py0build the vision part of a vlm model when backend is turbomind, or load the whole vlm model when `self.with_llm==true`STRING
HIGHlmdeploy/vl/model/minicpmv.py0build the vision part of a vlm model when backend is turbomind, or load the whole vlm model when `self.with_llm==true`STRING
HIGHlmdeploy/vl/model/deepseek_vl2.py0build the vision part of a vlm model when backend is turbomind, or load the whole vlm model when `self.with_llm==true`STRING
HIGHlmdeploy/vl/model/molmo.py0extract image feature. only implement it when the backend is turbomind engine. args: messages(list[dict]): the outputs oSTRING
HIGHlmdeploy/vl/model/llama4.py0extract image feature. only implement it when the backend is turbomind engine. args: messages(list[dict]): the outputs oSTRING
HIGHlmdeploy/vl/model/llava.py0extract image feature. only implement it when the backend is turbomind engine. args: messages(list[dict]): the outputs oSTRING
HIGHlmdeploy/vl/model/deepseek.py0extract image feature. only implement it when the backend is turbomind engine. args: messages(list[dict]): the outputs oSTRING
HIGHlmdeploy/vl/model/llava_hf.py0extract image feature. only implement it when the backend is turbomind engine. args: messages(list[dict]): the outputs oSTRING
HIGHlmdeploy/vl/model/llava_next.py0extract image feature. only implement it when the backend is turbomind engine. args: messages(list[dict]): the outputs oSTRING
HIGHlmdeploy/vl/model/gemma3_vl.py0extract image feature. only implement it when the backend is turbomind engine. args: messages(list[dict]): the outputs oSTRING
HIGHlmdeploy/vl/model/minicpmv.py0extract image feature. only implement it when the backend is turbomind engine. args: messages(list[dict]): the outputs oSTRING
HIGHlmdeploy/vl/model/deepseek_vl2.py0extract image feature. only implement it when the backend is turbomind engine. args: messages(list[dict]): the outputs oSTRING
HIGHlmdeploy/serve/openai/protocol.py0tear down a previously initialized weights-update group.STRING
HIGHlmdeploy/pytorch/engine/engine.py0tear down a previously initialized weights-update group.STRING
HIGHlmdeploy/pytorch/engine/mp_engine/base_worker.py0tear down a previously initialized weights-update group.STRING
HIGHlmdeploy/pytorch/engine/mp_engine/base.py0tear down a previously initialized weights-update group.STRING
HIGHlmdeploy/pytorch/engine/executor/base_worker.py0tear down a previously initialized weights-update group.STRING
HIGHlmdeploy/pytorch/engine/executor/ray_executor.py0tear down a previously initialized weights-update group.STRING
HIGHlmdeploy/pytorch/engine/executor/base.py0tear down a previously initialized weights-update group.STRING
HIGHlmdeploy/serve/openai/endpoints/management.py0tear down a previously initialized weights-update group.STRING
HIGHlmdeploy/pytorch/messages.py0update token ids, old token ids will be added to history.STRING
HIGHlmdeploy/pytorch/strategies/dllm/sequence.py0update token ids, old token ids will be added to history.STRING
HIGHlmdeploy/pytorch/strategies/ar_spec/sequence.py0update token ids, old token ids will be added to history.STRING
HIGHlmdeploy/pytorch/strategies/ar/sequence.py0update token ids, old token ids will be added to history.STRING
HIGHlmdeploy/pytorch/strategies/dllm/step_inputs.py0shrink batch — keep only sequences at delta.indices.STRING
HIGHlmdeploy/pytorch/strategies/ar_spec/step_inputs.py0shrink batch — keep only sequences at delta.indices.STRING
HIGHlmdeploy/pytorch/strategies/ar/step_inputs.py0shrink batch — keep only sequences at delta.indices.STRING
HIGHlmdeploy/pytorch/strategies/base/step_inputs.py0shrink batch — keep only sequences at delta.indices.STRING
HIGHlmdeploy/pytorch/backends/cuda/attention/fa3.py0describe metadata required by this selected implementation.STRING
HIGHlmdeploy/pytorch/backends/cuda/attention/default.py0describe metadata required by this selected implementation.STRING
HIGHlmdeploy/pytorch/backends/cuda/attention/mla.py0describe metadata required by this selected implementation.STRING
HIGHlmdeploy/pytorch/models/deepseek_v4.py0we might change the number of layers so we can debug the model with less gpus.STRING
HIGHlmdeploy/pytorch/models/kimi_k2_language.py0we might change the number of layers so we can debug the model with less gpus.STRING
HIGHlmdeploy/pytorch/models/qwen3_5.py0we might change the number of layers so we can debug the model with less gpus.STRING
HIGHlmdeploy/pytorch/models/qwen3_5_moe.py0we might change the number of layers so we can debug the model with less gpus.STRING
HIGHlmdeploy/pytorch/models/interns2_mobius.py0we might change the number of layers so we can debug the model with less gpus.STRING
HIGHlmdeploy/pytorch/models/meta_moe.py0we might change the number of layers so we can debug the model with less gpus.STRING
HIGHlmdeploy/pytorch/models/qwen3_next.py0we might change the number of layers so we can debug the model with less gpus.STRING
HIGHlmdeploy/pytorch/models/deepseek_v2.py0we might change the number of layers so we can debug the model with less gpus.STRING
HIGH…/pytorch/paging/block_manager/default_block_manager.py0return if physical block can be allocated for given message.STRING
HIGH…y/pytorch/paging/block_manager/window_block_manager.py0return if physical block can be allocated for given message.STRING
HIGH…loy/pytorch/paging/block_manager/base_block_manager.py0return if physical block can be allocated for given message.STRING
HIGH…/pytorch/paging/block_manager/default_block_manager.py0allocate physical blocks for given message according to logical blocks.STRING
HIGH…y/pytorch/paging/block_manager/window_block_manager.py0allocate physical blocks for given message according to logical blocks.STRING
HIGH…loy/pytorch/paging/block_manager/base_block_manager.py0allocate physical blocks for given message according to logical blocks.STRING
HIGHlmdeploy/pytorch/engine/engine.py0receive weights through the disaggregated process group.STRING
HIGHlmdeploy/pytorch/engine/mp_engine/base_worker.py0receive weights through the disaggregated process group.STRING
HIGHlmdeploy/pytorch/engine/mp_engine/base.py0receive weights through the disaggregated process group.STRING
HIGHlmdeploy/pytorch/engine/executor/base_worker.py0receive weights through the disaggregated process group.STRING
HIGHlmdeploy/pytorch/engine/executor/ray_executor.py0receive weights through the disaggregated process group.STRING
HIGHlmdeploy/pytorch/engine/executor/base.py0receive weights through the disaggregated process group.STRING
HIGHlmdeploy/pytorch/engine/base.py0drop connection. 1. drop engine connection (zmq connection) 2. todo(jimyma) drop rdma connection.STRING
HIGHlmdeploy/pytorch/engine/mp_engine/base_worker.py0drop connection. 1. drop engine connection (zmq connection) 2. todo(jimyma) drop rdma connection.STRING
HIGHlmdeploy/pytorch/engine/mp_engine/base.py0drop connection. 1. drop engine connection (zmq connection) 2. todo(jimyma) drop rdma connection.STRING
3 more matches not shown…
Magic Placeholder Names58 hits · 288 pts
SeverityFileLineSnippetContext
HIGH…/interface/restful/test_restful_chat_completions_v1.py643 client = OpenAI(api_key='YOUR_API_KEY', base_url=f'{BASE_URL}/v1')CODE
HIGH…/interface/restful/test_restful_chat_completions_v1.py659 client = OpenAI(api_key='YOUR_API_KEY', base_url=f'{BASE_URL}/v1')CODE
HIGH…/interface/restful/test_restful_chat_completions_v1.py680 client = OpenAI(api_key='YOUR_API_KEY', base_url=f'{BASE_URL}/v1')CODE
HIGH…/interface/restful/test_restful_chat_completions_v1.py699 client = OpenAI(api_key='YOUR_API_KEY', base_url=f'{BASE_URL}/v1')CODE
HIGH…/interface/restful/test_restful_chat_completions_v1.py723 client = OpenAI(api_key='YOUR_API_KEY', base_url=f'{BASE_URL}/v1')CODE
HIGH…/interface/restful/test_restful_chat_completions_v1.py745 client = OpenAI(api_key='YOUR_API_KEY', base_url=f'{BASE_URL}/v1')CODE
HIGH…/interface/restful/test_restful_chat_completions_v1.py772 client = OpenAI(api_key='YOUR_API_KEY', base_url=f'{BASE_URL}/v1')CODE
HIGH…/interface/restful/test_restful_chat_completions_v1.py794 client = OpenAI(api_key='YOUR_API_KEY', base_url=f'{BASE_URL}/v1')CODE
HIGH…/interface/restful/test_restful_chat_completions_v1.py822 client = OpenAI(api_key='YOUR_API_KEY', base_url=f'{BASE_URL}/v1')CODE
HIGH…/interface/restful/test_restful_chat_completions_v1.py837 client = OpenAI(api_key='YOUR_API_KEY', base_url=f'{BASE_URL}/v1')CODE
HIGH…/interface/restful/test_restful_chat_completions_v1.py853 client = OpenAI(api_key='YOUR_API_KEY', base_url=f'{BASE_URL}/v1')CODE
HIGH…/interface/restful/test_restful_chat_completions_v1.py872 client = OpenAI(api_key='YOUR_API_KEY', base_url=f'{BASE_URL}/v1')CODE
HIGH…/interface/restful/test_restful_chat_completions_v1.py898 client = OpenAI(api_key='YOUR_API_KEY', base_url=f'{BASE_URL}/v1')CODE
HIGH…/interface/restful/test_restful_chat_completions_v1.py914 client = OpenAI(api_key='YOUR_API_KEY', base_url=f'{BASE_URL}/v1')CODE
HIGH…/interface/restful/test_restful_chat_completions_v1.py931 client = OpenAI(api_key='YOUR_API_KEY', base_url=f'{BASE_URL}/v1')CODE
HIGH…/interface/restful/test_restful_chat_completions_v1.py948 client = OpenAI(api_key='YOUR_API_KEY', base_url=f'{BASE_URL}/v1')CODE
HIGH…/interface/restful/test_restful_chat_completions_v1.py979 client = OpenAI(api_key='YOUR_API_KEY', base_url=f'{BASE_URL}/v1')CODE
HIGH…/interface/restful/test_restful_chat_completions_v1.py1000 client = OpenAI(api_key='YOUR_API_KEY', base_url=f'{BASE_URL}/v1')CODE
HIGH…/interface/restful/test_restful_chat_completions_v1.py1031 client = OpenAI(api_key='YOUR_API_KEY', base_url=f'{BASE_URL}/v1')CODE
HIGH…/interface/restful/test_restful_chat_completions_v1.py1064 client = OpenAI(api_key='YOUR_API_KEY', base_url=f'{BASE_URL}/v1')CODE
HIGHautotest/utils/anthropic_messages.py380 api_key=os.getenv('ANTHROPIC_API_KEY', 'YOUR_API_KEY'),CODE
HIGHautotest/utils/tool_reasoning_definitions.py206 client = OpenAI(api_key='YOUR_API_KEY', base_url=f'{url}/v1')CODE
HIGHautotest/utils/tool_reasoning_definitions.py949 'Authorization': 'Bearer YOUR_API_KEY',CODE
HIGHautotest/utils/tool_reasoning_definitions.py1106 'Authorization': 'Bearer YOUR_API_KEY',CODE
HIGHautotest/utils/run_restful_chat.py181 client = OpenAI(api_key='YOUR_API_KEY', base_url=f'{url}/v1')CODE
HIGHautotest/utils/run_restful_chat.py510 client = OpenAI(api_key='YOUR_API_KEY', base_url=http_url + '/v1')CODE
HIGHautotest/utils/run_restful_chat.py851 client = OpenAI(api_key='YOUR_API_KEY', base_url=http_url + '/v1')CODE
HIGHautotest/utils/run_restful_chat.py1142 client = OpenAI(api_key='YOUR_API_KEY', base_url=http_url + '/v1')CODE
HIGHdocs/zh_cn/llm/api_server.md90 api_key='YOUR_API_KEY',CODE
HIGHdocs/zh_cn/llm/api_server.md113 client = AsyncOpenAI(api_key='YOUR_API_KEY',CODE
HIGHdocs/zh_cn/llm/codellama.md149 api_key='YOUR_API_KEY',STRING
HIGHdocs/zh_cn/llm/api_server_tools.md39client = OpenAI(api_key='YOUR_API_KEY',base_url='http://0.0.0.0:23333/v1')CODE
HIGHdocs/zh_cn/llm/api_server_tools.md112client = OpenAI(api_key='YOUR_API_KEY', base_url='http://0.0.0.0:23333/v1')CODE
HIGHdocs/zh_cn/llm/api_server_tools.md186 client = OpenAI(api_key='YOUR_API_KEY',CODE
HIGHdocs/zh_cn/llm/api_server_tools.md357client = OpenAI(api_key='YOUR_API_KEY', base_url='http://0.0.0.0:23333/v1')CODE
HIGHdocs/zh_cn/llm/api_server_lora.md77 api_key='YOUR_API_KEY',CODE
HIGHdocs/zh_cn/advance/structed_output.md99client = OpenAI(api_key='YOUR_API_KEY', base_url='http://0.0.0.0:23333/v1')CODE
HIGHdocs/zh_cn/advance/spec_decoding.md186 client = OpenAI(api_key='YOUR_API_KEY', base_url='http://0.0.0.0:24545/v1')CODE
HIGHdocs/zh_cn/get_started/get_started.md131 api_key='YOUR_API_KEY',CODE
HIGHdocs/zh_cn/get_started/get_started.md165client = OpenAI(api_key='YOUR_API_KEY', # A dummy api_key is requiredCODE
HIGHdocs/zh_cn/multi_modal/api_server_vl.md60client = OpenAI(api_key='YOUR_API_KEY', base_url='http://0.0.0.0:23333/v1')CODE
HIGHdocs/zh_cn/multi_modal/phi3.md55client = OpenAI(api_key='YOUR_API_KEY', base_url='http://0.0.0.0:23333/v1')CODE
HIGHdocs/en/llm/api_server.md71 api_key='YOUR_API_KEY',CODE
HIGHdocs/en/llm/api_server.md94 client = AsyncOpenAI(api_key='YOUR_API_KEY',CODE
HIGHdocs/en/llm/codellama.md149 api_key='YOUR_API_KEY',STRING
HIGHdocs/en/llm/api_server_tools.md39client = OpenAI(api_key='YOUR_API_KEY',base_url='http://0.0.0.0:23333/v1')CODE
HIGHdocs/en/llm/api_server_tools.md112client = OpenAI(api_key='YOUR_API_KEY', base_url='http://0.0.0.0:23333/v1')CODE
HIGHdocs/en/llm/api_server_tools.md186 client = OpenAI(api_key='YOUR_API_KEY',CODE
HIGHdocs/en/llm/api_server_tools.md357client = OpenAI(api_key='YOUR_API_KEY', base_url='http://0.0.0.0:23333/v1')CODE
HIGHdocs/en/llm/api_server_lora.md77 api_key='YOUR_API_KEY',CODE
HIGHdocs/en/advance/structed_output.md99client = OpenAI(api_key='YOUR_API_KEY', base_url='http://0.0.0.0:23333/v1')CODE
HIGHdocs/en/advance/spec_decoding.md187 client = OpenAI(api_key='YOUR_API_KEY', base_url='http://0.0.0.0:24545/v1')CODE
HIGHdocs/en/get_started/get_started.md134 api_key='YOUR_API_KEY',CODE
HIGHdocs/en/get_started/get_started.md169client = OpenAI(api_key='YOUR_API_KEY', base_url='http://0.0.0.0:23333/v1')CODE
HIGHdocs/en/multi_modal/api_server_vl.md83client = OpenAI(api_key='YOUR_API_KEY', base_url='http://0.0.0.0:23333/v1')CODE
HIGHdocs/en/multi_modal/phi3.md56client = OpenAI(api_key='YOUR_API_KEY', base_url='http://0.0.0.0:23333/v1')CODE
HIGHeval/config.py57 key='YOUR_API_KEY',CODE
HIGHeval/eval.py121 client = OpenAI(api_key='YOUR_API_KEY', base_url=f'{server}/v1')CODE
Deep Nesting263 hits · 248 pts
SeverityFileLineSnippetContext
LOWsetup.py63CODE
LOWsetup.py79CODE
LOWsetup.py120CODE
LOWbenchmark/benchmark_parser.py81CODE
LOWbenchmark/benchmark_chat_completion.py266CODE
LOWbenchmark/benchmark_chat_completion.py448CODE
LOWbenchmark/benchmark_chat_completion.py1005CODE
LOWbenchmark/benchmark_guided.py527CODE
LOWbenchmark/benchmark_generate.py203CODE
LOWbenchmark/benchmark_generate.py280CODE
LOWbenchmark/profile_restful_api.py159CODE
LOWbenchmark/profile_restful_api.py237CODE
LOWbenchmark/profile_restful_api.py345CODE
LOWbenchmark/profile_restful_api.py1186CODE
LOWlmdeploy/deepseek_v4_encoding.py227CODE
LOWlmdeploy/deepseek_v4_encoding.py409CODE
LOWlmdeploy/deepseek_v4_encoding.py469CODE
LOWlmdeploy/model.py649CODE
LOWlmdeploy/model.py703CODE
LOWlmdeploy/tokenizer.py152CODE
LOWlmdeploy/utils.py394CODE
LOWlmdeploy/utils.py420CODE
LOWlmdeploy/utils.py542CODE
LOWlmdeploy/deepseek_v32_encoding.py143CODE
LOWlmdeploy/archs.py54CODE
LOWlmdeploy/archs.py93CODE
LOWlmdeploy/archs.py166CODE
LOWlmdeploy/metrics/metrics_processor.py45CODE
LOWlmdeploy/metrics/stats.py146CODE
LOWlmdeploy/lite/apis/auto_awq.py18CODE
LOWlmdeploy/lite/apis/smooth_quant.py18CODE
LOWlmdeploy/lite/apis/calibrate.py201CODE
LOWlmdeploy/lite/apis/calibrate.py233CODE
LOWlmdeploy/lite/utils/calib_dataloader.py14CODE
LOWlmdeploy/lite/utils/memory_efficient.py197CODE
LOWlmdeploy/lite/utils/batch_split.py7CODE
LOWlmdeploy/cli/entrypoint.py10CODE
LOWlmdeploy/cli/chat.py146CODE
LOWlmdeploy/cli/utils.py14CODE
LOWlmdeploy/cli/utils.py856CODE
LOWlmdeploy/vl/model/internvl.py21CODE
LOWlmdeploy/vl/model/internvl.py173CODE
LOWlmdeploy/vl/model/molmo.py129CODE
LOWlmdeploy/vl/model/molmo.py151CODE
LOWlmdeploy/vl/model/preprocess_utils.py207CODE
LOWlmdeploy/vl/model/llava.py305CODE
LOWlmdeploy/vl/model/builder.py36CODE
LOWlmdeploy/vl/model/utils.py29CODE
LOWlmdeploy/vl/model/qwen2.py47CODE
LOWlmdeploy/vl/model/base.py123CODE
LOWlmdeploy/vl/model/base.py363CODE
LOWlmdeploy/vl/model/minicpmv.py200CODE
LOWlmdeploy/vl/media/time_series.py31CODE
LOWlmdeploy/turbomind/checkpoint.py188CODE
LOWlmdeploy/turbomind/tokenizer_info.py133CODE
LOWlmdeploy/turbomind/linear.py109CODE
LOWlmdeploy/turbomind/linear.py160CODE
LOWlmdeploy/turbomind/linear.py121CODE
LOWlmdeploy/turbomind/linear.py171CODE
LOWlmdeploy/turbomind/converter.py29CODE
203 more matches not shown…
AI Structural Patterns153 hits · 150 pts
SeverityFileLineSnippetContext
LOWbenchmark/profile_restful_api.py1166CODE
LOWlmdeploy/model.py117CODE
LOWlmdeploy/model.py204CODE
LOWlmdeploy/model.py726CODE
LOWlmdeploy/api.py86CODE
LOWlmdeploy/utils.py638CODE
LOWlmdeploy/lite/apis/auto_awq.py41CODE
LOWlmdeploy/lite/apis/smooth_quant.py18CODE
LOWlmdeploy/lite/apis/gptq.py11CODE
LOWlmdeploy/lite/apis/calibrate.py283CODE
LOWlmdeploy/lite/utils/memory_efficient.py124CODE
LOWlmdeploy/vl/model/base.py238CODE
LOWlmdeploy/turbomind/models/utils.py225CODE
LOWlmdeploy/serve/core/async_engine.py119CODE
LOWlmdeploy/serve/core/async_engine.py478CODE
LOWlmdeploy/serve/proxy/proxy.py889CODE
LOWlmdeploy/serve/proxy/proxy.py325CODE
LOWlmdeploy/serve/openai/api_server.py257CODE
LOWlmdeploy/serve/openai/api_client.py90CODE
LOWlmdeploy/serve/openai/api_client.py175CODE
LOWlmdeploy/pytorch/config.py519CODE
LOWlmdeploy/pytorch/model_inputs.py206CODE
LOWlmdeploy/pytorch/model_inputs.py300CODE
LOWlmdeploy/pytorch/model_inputs.py438CODE
LOWlmdeploy/pytorch/messages.py368CODE
LOWlmdeploy/pytorch/messages.py485CODE
LOWlmdeploy/pytorch/kernels/cuda/pagedattention.py772CODE
LOWlmdeploy/pytorch/kernels/cuda/v4_flatten_kv.py201CODE
LOWlmdeploy/pytorch/kernels/cuda/fused_lora.py159CODE
LOWlmdeploy/pytorch/kernels/cuda/flashattention.py463CODE
LOWlmdeploy/pytorch/kernels/cuda/utils.py46CODE
LOW…eploy/pytorch/kernels/cuda/compressed_tensors_w4a16.py479CODE
LOWlmdeploy/pytorch/kernels/cuda/gated_delta_rule.py256CODE
LOWlmdeploy/pytorch/kernels/cuda/gated_delta_rule.py575CODE
LOWlmdeploy/pytorch/kernels/cuda/w8a8_triton_kernels.py379CODE
LOWlmdeploy/pytorch/kernels/cuda/causal_conv1d.py212CODE
LOWlmdeploy/pytorch/kernels/cuda/rms_norm.py18CODE
LOWlmdeploy/pytorch/kernels/cuda/flatten_kv_cache.py397CODE
LOWlmdeploy/pytorch/kernels/cuda/moe/blocked_fp8.py160CODE
LOWlmdeploy/pytorch/kernels/cuda/moe/blocked_fp8.py396CODE
LOWlmdeploy/pytorch/kernels/cuda/moe/blocked_fp8.py820CODE
LOWlmdeploy/pytorch/kernels/cuda/moe/fused_moe.py545CODE
LOWlmdeploy/pytorch/kernels/cuda/moe/fused_moe.py1137CODE
LOWlmdeploy/pytorch/kernels/cuda/moe/w8a8.py341CODE
LOWlmdeploy/pytorch/kernels/cuda/moe/v4_fp4.py228CODE
LOWlmdeploy/pytorch/kernels/cuda/moe/v4_fp4.py425CODE
LOWlmdeploy/pytorch/kernels/cuda/moe/v4_fp4.py341CODE
LOWlmdeploy/pytorch/nn/attention.py24CODE
LOWlmdeploy/pytorch/nn/norm.py31CODE
LOWlmdeploy/pytorch/nn/rotary_embedding.py177CODE
LOWlmdeploy/pytorch/nn/nsa.py47CODE
LOWlmdeploy/pytorch/nn/linear/blocked_fp8.py19CODE
LOWlmdeploy/pytorch/nn/linear/blocked_fp8.py169CODE
LOWlmdeploy/pytorch/nn/linear/blocked_fp8.py277CODE
LOWlmdeploy/pytorch/nn/linear/__init__.py29CODE
LOWlmdeploy/pytorch/nn/linear/__init__.py128CODE
LOWlmdeploy/pytorch/nn/linear/__init__.py172CODE
LOWlmdeploy/pytorch/nn/linear/__init__.py209CODE
LOWlmdeploy/pytorch/nn/linear/__init__.py296CODE
LOWlmdeploy/pytorch/nn/linear/default.py18CODE
93 more matches not shown…
Over-Commented Block120 hits · 120 pts
SeverityFileLineSnippetContext
LOWCMakeLists.txt1# Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved.COMMENT
LOWbenchmark/benchmark_decode.py61if __name__ == '__main__':COMMENT
LOWbenchmark/benchmark_decode.py81 # Decoded 15991314 tokens in 242.7 seconds, 65893.38488718234 tokens/s.COMMENT
LOWlmdeploy/pytorch/utils.py161 # When using `remote_code` in HF components like tokenizer or configCOMMENT
LOWlmdeploy/pytorch/kernels/cuda/v4_compressor.py1121COMMENT
LOWlmdeploy/pytorch/kernels/cuda/flashattention.py141 k1_ptrs = tl.advance(k1_ptrs, (0, BLOCK_N))COMMENT
LOWlmdeploy/pytorch/strategies/dllm/step_inputs.py1# Copyright (c) OpenMMLab. All rights reserved.COMMENT
LOWlmdeploy/pytorch/strategies/ar_spec/step_inputs.py1# Copyright (c) OpenMMLab. All rights reserved.COMMENT
LOWlmdeploy/pytorch/strategies/ar/step_inputs.py1# Copyright (c) OpenMMLab. All rights reserved.COMMENT
LOWlmdeploy/pytorch/models/kimi_k25_vision.py1# Copyright (c) OpenMMLab. All rights reserved.COMMENT
LOWlmdeploy/pytorch/models/kimi_k25_vision.py21# See the License for the specific language governing permissions andCOMMENT
LOWtests/test_lmdeploy/test_model.py281# @pytest.mark.parametrize('has_user_sys', [True, False])COMMENT
LOWtests/test_lmdeploy/test_model.py301# 'role': 'user',COMMENT
LOWtests/pytorch/test_internvl_lora.py21COMMENT
LOWdocs/zh_cn/conf.py1#COMMENT
LOWdocs/zh_cn/conf.py121master_doc = 'index'COMMENT
LOWdocs/zh_cn/conf.py161 'use_edit_page_button': True,COMMENT
LOWdocs/zh_cn/conf.py201#COMMENT
LOWdocs/zh_cn/conf.py221 # The font size ('10pt', '11pt' or '12pt').COMMENT
LOWdocs/en/conf.py1#COMMENT
LOWdocs/en/conf.py121master_doc = 'index'COMMENT
LOWdocs/en/conf.py161 'use_source_button': True,COMMENT
LOWdocs/en/conf.py201# The default sidebars (for documents that don't match any pattern) areCOMMENT
LOWdocs/en/conf.py221 #COMMENT
LOWsrc/CMakeLists.txt1# Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved.COMMENT
LOWsrc/turbomind/turbomind.h1// Copyright (c) OpenMMLab. All rights reserved.COMMENT
LOWsrc/turbomind/CMakeLists.txt1# Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved.COMMENT
LOWsrc/turbomind/kernels/CMakeLists.txt1# Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved.COMMENT
LOWsrc/turbomind/kernels/attention/impl_simt.h1// Copyright (c) OpenMMLab. All rights reserved.COMMENT
LOWsrc/turbomind/kernels/attention/iterator_sm80.h1// Copyright (c) OpenMMLab. All rights reserved.COMMENT
LOWsrc/turbomind/kernels/attention/impl_884.h41 static constexpr int V_N = HeadDim / OP_N; // 8COMMENT
LOWsrc/turbomind/kernels/core/floating_point.h141// FloatingPoint<5, 2>::max_denormal;COMMENT
LOWsrc/turbomind/kernels/core/common.h1// Copyright (c) OpenMMLab. All rights reserved.COMMENT
LOWsrc/turbomind/kernels/core/common.h21#endifCOMMENT
LOWsrc/turbomind/kernels/core/common.h41#if defined(__CUDACC_RTC__) || (defined(__clang__) && defined(__CUDA__))COMMENT
LOWsrc/turbomind/kernels/core/common.h61#define TM_HOST __forceinline__ __host__COMMENT
LOWsrc/turbomind/kernels/gemm/iterator_sm70.h1// Copyright (c) OpenMMLab. All rights reserved.COMMENT
LOWsrc/turbomind/kernels/gemm/tiled_mma.h1// Copyright (c) OpenMMLab. All rights reserved.COMMENT
LOWsrc/turbomind/kernels/gemm/kernel_impl.h1// Copyright (c) OpenMMLab. All rights reserved.COMMENT
LOWsrc/turbomind/kernels/gemm/moe_gate_python_bind.cpp1// src/turbomind/kernels/gemm/moe_gate_python_bind.cppCOMMENT
LOWsrc/turbomind/kernels/gemm/gmma_fp8_sm90.h1#pragma onceCOMMENT
LOWsrc/turbomind/kernels/gemm/gemm_universal_sm90_v3.h1#pragma onceCOMMENT
LOWsrc/turbomind/kernels/gemm/gemm_universal_sm90_v3.h21#include "cutlass/pipeline/sm90_pipeline.hpp"COMMENT
LOWsrc/turbomind/kernels/gemm/mainloop_sm80_v2.h1// Copyright (c) OpenMMLab. All rights reserved.COMMENT
LOWsrc/turbomind/kernels/gemm/gemm_universal.h1// Copyright (c) OpenMMLab. All rights reserved.COMMENT
LOWsrc/turbomind/kernels/gemm/iterator_sm80.h1// Copyright (c) OpenMMLab. All rights reserved.COMMENT
LOW…urbomind/kernels/gemm/prepare_moe_tma_descs_sm90_fp8.h1#pragma onceCOMMENT
LOWsrc/turbomind/kernels/gemm/matrix_ptr.h101COMMENT
LOWsrc/turbomind/kernels/gemm/gemm_universal_sm90_bf16.h61#include "cute/arch/cluster_sm90.hpp"COMMENT
LOWsrc/turbomind/kernels/gemm/gemm_universal_sm90_bf16.h81#include "src/turbomind/kernels/gemm/cp_async.h"COMMENT
LOWsrc/turbomind/kernels/gemm/moe_utils_v2.h1// Copyright (c) OpenMMLab. All rights reserved.COMMENT
LOWsrc/turbomind/kernels/gemm/smem_copy.h181 }COMMENT
LOWsrc/turbomind/kernels/gemm/gemm_universal_sm90_fp8_wa.h1#pragma onceCOMMENT
LOWsrc/turbomind/kernels/gemm/gemm_universal_sm90_fp8_wa.h21#include "cutlass/pipeline/sm90_pipeline.hpp"COMMENT
LOWsrc/turbomind/kernels/gemm/gemm_universal_sm90.h1#pragma onceCOMMENT
LOWsrc/turbomind/kernels/gemm/gemm_universal_sm90_v5.h1#pragma onceCOMMENT
LOWsrc/turbomind/kernels/gemm/gemm_universal_sm90_v5.h21COMMENT
LOWsrc/turbomind/kernels/gemm/mainloop_sm70.h1// Copyright (c) OpenMMLab. All rights reserved.COMMENT
LOWsrc/turbomind/kernels/gemm/kernel_impl_sm90_bf16.h1// Copyright (c) OpenMMLab. All rights reserved.COMMENT
LOWsrc/turbomind/kernels/gemm/sm90_bf16_traits.h1#pragma onceCOMMENT
60 more matches not shown…
Modern Structural Boilerplate58 hits · 58 pts
SeverityFileLineSnippetContext
LOWlmdeploy/__init__.py10__all__ = [CODE
LOWlmdeploy/lite/utils/__init__.py19__all__ = [CODE
LOWlmdeploy/lite/quantization/__init__.py6__all__ = ['WeightQuantizer', 'ActivationObserver', 'KVCacheObserver', 'CalibrationContext', 'CalibrationContextV2']CODE
LOWlmdeploy/lite/quantization/weight/__init__.py4__all__ = ['WeightQuantizer']CODE
LOWlmdeploy/lite/quantization/activation/__init__.py4__all__ = ['ActivationObserver', 'KVCacheObserver']CODE
LOWlmdeploy/lite/quantization/modules/__init__.py4__all__ = ['WeightOnlyQLinear']CODE
LOWlmdeploy/lite/model/__init__.py9__all__ = ['MODELS']CODE
LOWlmdeploy/cli/__init__.py4__all__ = ['run']CODE
LOWlmdeploy/vl/__init__.py13__all__ = [CODE
LOWlmdeploy/turbomind/tokenizer_info.py23logger = logging.getLogger(__name__)CODE
LOWlmdeploy/turbomind/__init__.py54__all__ = ['TurboMind', 'update_parallel_config']CODE
LOWlmdeploy/turbomind/builders/ffn.py18__all__ = [CODE
LOWlmdeploy/turbomind/builders/__init__.py17__all__ = [CODE
LOWlmdeploy/serve/__init__.py6__all__ = [CODE
LOWlmdeploy/serve/parsers/__init__.py6__all__ = ['ResponseParser', 'ResponseParserManager', 'GptOssResponseParser', 'validate_parser_names']CODE
LOWlmdeploy/serve/parsers/response_parser.py654 def _update_reasoning_tokens(self, token_ids: list[int]) -> None:CODE
LOWlmdeploy/serve/parsers/tool_parser/__init__.py15__all__ = [CODE
LOWlmdeploy/serve/parsers/reasoning_parser/__init__.py7__all__ = [CODE
LOWlmdeploy/serve/core/__init__.py7__all__ = [CODE
LOWlmdeploy/serve/managers/__init__.py4__all__ = ['Session', 'SessionManager']CODE
LOWlmdeploy/serve/processors/__init__.py4__all__ = ['MultimodalProcessor']CODE
LOWlmdeploy/serve/anthropic/__init__.py6__all__ = ['create_anthropic_router']CODE
LOWlmdeploy/serve/openai/endpoints/__init__.py7__all__ = ['create_openai_router']CODE
LOWlmdeploy/serve/openai/responses/__init__.py13__all__ = [CODE
LOWlmdeploy/serve/openai/chat_completions/__init__.py13__all__ = ['register']CODE
LOWlmdeploy/pytorch/prefix_cache_state.py134 def set_fresh_block_range(self, start_block_idx: int, end_block_idx: int) -> None:CODE
LOWlmdeploy/pytorch/configurations/__init__.py7__all__ = []CODE
LOWlmdeploy/pytorch/kernels/__init__.py10__all__ = [CODE
LOWlmdeploy/pytorch/kernels/cuda/__init__.py14__all__ = [CODE
LOWlmdeploy/pytorch/kernels/cuda/turbo_quant.py14logger = logging.getLogger(__name__)CODE
LOWlmdeploy/pytorch/kernels/default/__init__.py5__all__ = [CODE
LOWlmdeploy/pytorch/kernels/dlinfer/__init__.py13__all__ = [CODE
LOWlmdeploy/pytorch/kv_connector/__init__.py15__all__ = [CODE
LOWlmdeploy/pytorch/kv_connector/mooncake/store/worker.py231 def _setup_store(self, store: Any, local_hostname: str) -> None:CODE
LOW…deploy/pytorch/kv_connector/mooncake/store/protocol.py11__all__ = ['LOOKUP_MSG', 'RESP_ERR']CODE
LOWlmdeploy/pytorch/kv_connector/mooncake/store/lookup.py366__all__ = ['LookupKeyClient', 'LookupKeyServer', 'prepare_lookup_rpc_path']CODE
LOW…deploy/pytorch/kv_connector/mooncake/store/__init__.py6__all__ = [CODE
LOWlmdeploy/pytorch/backends/cuda/attention/fa3.py130def update_fa3_metadata(attn_metadata, step_context, **kwargs) -> None:CODE
LOWlmdeploy/pytorch/memdecode/__init__.py6__all__ = [CODE
LOWlmdeploy/pytorch/models/__init__.py4__all__ = ['QLinear', 'QRMSNorm']CODE
LOWlmdeploy/pytorch/models/kimi_k25_vision.py809__all__ = [CODE
LOWlmdeploy/pytorch/disagg/backend/__init__.py18__all__ = ['DLSlimeBackend', 'MooncakeBackend']CODE
LOWlmdeploy/pytorch/spec_decode/__init__.py66__all__ = ['build_spec_agent']CODE
LOWlmdeploy/pytorch/multimodal/__init__.py4__all__ = ['MultiModalData']CODE
LOWlmdeploy/pytorch/paging/__init__.py4__all__ = ['Scheduler']CODE
LOWlmdeploy/pytorch/paging/scheduler.py1446 def update_connector_output(self, connector_output) -> None:CODE
LOWlmdeploy/pytorch/paging/block_trie/__init__.py7__all__ = ['BlockTrie', 'Node', 'PrefixCacheStats']CODE
LOWlmdeploy/pytorch/transformers/__init__.py4__all__ = ['config_from_pretrained', 'register_config']CODE
LOWlmdeploy/pytorch/engine/__init__.py5__all__ = ['Engine', 'EngineInstance']CODE
LOWlmdeploy/pytorch/engine/executor/base.py442 def update_configs(self) -> None:CODE
LOWlmdeploy/pytorch/devices/__init__.py4__all__ = ['DeviceContext', 'DefaultContext', 'get_device_manager']CODE
LOWtests/turbomind/linear/linear.py258 def set_grouped(self, grouped: bool) -> None:CODE
LOWtests/turbomind/linear/linear.py266 def set_epilogue(self, epilogue) -> None:CODE
LOWtests/turbomind/linear/linear.py299 def set_param(self, name: str, tensor) -> None:CODE
LOWtests/turbomind/linear/linear.py399 def set_measure(self, on: bool) -> None:CODE
LOWtests/turbomind/linear_attn/cases.py179 def set_logical(self, layer: int, state: torch.Tensor) -> None:CODE
LOWautotest/utils/config_utils.py1488def set_device_env_variable(worker_id: str | None, parallel_config: dict[str, int] | None = None) -> None:CODE
LOWscripts/test_turbomind_model.py183def _set_hf_cache(path: str) -> None:CODE
Redundant / Tautological Comments14 hits · 23 pts
SeverityFileLineSnippetContext
LOWbenchmark/profile_restful_api.py307 # Check if this chunk contains contentCOMMENT
LOWbenchmark/profile_restful_api.py519 # Check if the cache file already existsCOMMENT
LOWlmdeploy/deepseek_v4_encoding.py349 # Check if previous message has a task - if so, this is a task output (no thinking)COMMENT
LOWlmdeploy/model.py781 # Verify if the model can perform apply_chat_template with different roles.COMMENT
LOWlmdeploy/lite/apis/calibrate.py153 # Check if the child is an instance of the given layer typeCOMMENT
LOWlmdeploy/lite/apis/calibrate.py161 # Check if the child contains the target module typeCOMMENT
LOWlmdeploy/lite/apis/calibrate.py164 # Check if the child matches the head nameCOMMENT
LOWlmdeploy/lite/utils/batch_split.py102 # Check if the current element is a past key-value pair.COMMENT
LOWlmdeploy/serve/processors/multimodal.py253 # Check if multimodal input existsCOMMENT
LOW…loy/serve/openai/chat_completions/logits_processors.py30 # Check if token_id is within the vocab sizeCOMMENT
LOWlmdeploy/pytorch/engine/executor/ray_executor.py646 # Check if all elements in ips are present in worker_ips and vice versa (ignoring order)COMMENT
LOWautotest/utils/run_restful_chat.py114 # Check if process is still runningCOMMENT
LOWautotest/utils/run_restful_chat.py1290 # Check if process is still runningCOMMENT
LOWautotest/utils/ray_distributed_utils.py58 # Check if port is openCOMMENT
Self-Referential Comments11 hits · 19 pts
SeverityFileLineSnippetContext
MEDIUMlmdeploy/api.py97 """This function is deprecated and no longer available.STRING
MEDIUMlmdeploy/api.py110 """This function is deprecated and no longer available.STRING
MEDIUMlmdeploy/lite/quantization/modules/linear.py16 """This class implements weight only quantization linear.STRING
MEDIUMlmdeploy/turbomind/tokenizer_info.py3"""This module provides the tokenizer info class to handle the tokenizerSTRING
MEDIUMlmdeploy/pytorch/ray.py127 # Create a new placement groupCOMMENT
MEDIUMlmdeploy/pytorch/tools/utils.py165 # Create a clean table-like formatCOMMENT
MEDIUMlmdeploy/pytorch/models/llama4.py751 """This function is used to fetch the first embedding layer to activateSTRING
MEDIUMlmdeploy/pytorch/models/kimi_k25_vision.py3# This file contains code adapted from moonshotai/Kimi-K2.6COMMENT
MEDIUMlmdeploy/pytorch/models/gemma3_vl.py240 # Create a global causal mask.STRING
MEDIUMlmdeploy/pytorch/models/gemma3_vl.py261 # Create a local causal mask with sliding window (1024).STRING
MEDIUM…_lite/test_quantization/test_utils/test_cal_qparams.py18 # Create a dummy tensorCOMMENT
Structural Annotation Overuse8 hits · 13 pts
SeverityFileLineSnippetContext
LOWlmdeploy/deepseek_v32_encoding.py355# NOTE: This function parses only correctly formatted strings and will not attempt to correctCOMMENT
LOW…rve/openai/chat_completions/test_delta_tool_call_id.py18 # Step 1: feed partial JSON with nameCOMMENT
LOW…rve/openai/chat_completions/test_delta_tool_call_id.py27 # Step 2: feed final chunk with argumentsCOMMENT
LOW…ts/pytorch/spec_decode/test_guided_spec_integration.py481 # Step 2: original should be at correct stateCOMMENT
LOWdocs/en/advance/update_weights.md5## Step 1: Launch serverCOMMENT
LOWdocs/en/advance/update_weights.md13## Step 2: Offloads weights & kv cacheCOMMENT
LOWdocs/en/advance/update_weights.md38## Step 3: Update weightsCOMMENT
LOWdocs/en/advance/update_weights.md71## Step 4: Wakeup serverCOMMENT
Docstring Block Structure2 hits · 10 pts
SeverityFileLineSnippetContext
HIGHlmdeploy/api.py24Create a pipeline for inference. Args: model_path: the path of a model. It could be one of the following opSTRING
HIGHlmdeploy/lite/utils/memory_efficient.py46Finds modules in model that return given value. Args: model (nn.Module): Model to inspect value (stSTRING
Dead Code4 hits · 8 pts
SeverityFileLineSnippetContext
MEDIUM…oy/serve/openai/chat_completions/test_n_completions.py331CODE
MEDIUM…oy/serve/openai/chat_completions/test_n_completions.py418CODE
MEDIUM…oy/serve/openai/chat_completions/test_n_completions.py475CODE
MEDIUMtests/pytorch/engine/test_ray_mp_engine.py166CODE
Verbosity Indicators4 hits · 6 pts
SeverityFileLineSnippetContext
LOWlmdeploy/serve/core/async_engine.py809 The purpose of this function is to allow users to choose whether to use the synchronous interface or theSTRING
LOW…rve/openai/chat_completions/test_delta_tool_call_id.py18 # Step 1: feed partial JSON with nameCOMMENT
LOW…rve/openai/chat_completions/test_delta_tool_call_id.py27 # Step 2: feed final chunk with argumentsCOMMENT
LOW…ts/pytorch/spec_decode/test_guided_spec_integration.py481 # Step 2: original should be at correct stateCOMMENT
AI Slop Vocabulary3 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMlmdeploy/pytorch/kernels/cuda/moe/blocked_fp8.py645 # tokens. A compact BM64 schedule avoids that cliff and remains robustCOMMENT
LOWlmdeploy/pytorch/paging/scheduler.py1250 # No need to evict, just return True.COMMENT
LOWlmdeploy/pytorch/paging/scheduler.py1253 # Enough free blocks, just return True.COMMENT
Modern AI Meta-Vocabulary2 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMautotest/tools/pipeline/mllm_case.py374 # In-context few-shot learningCOMMENT
MEDIUMdocs/en/multi_modal/vl_pipeline.md66### Set context window sizeCOMMENT
Cross-Language Confusion2 hits · 5 pts
SeverityFileLineSnippetContext
HIGHlmdeploy/turbomind/parallel_config.py8 attn_tp == tp || mlp_tp == tpSTRING
HIGHlmdeploy/turbomind/parallel_config.py9 tp % attn_tp == 0 && tp % mlp_tp == 0STRING
Example Usage Blocks1 hit · 2 pts
SeverityFileLineSnippetContext
LOWtests/pytorch/engine/test_zmq_rpc.py76 # Example usageCOMMENT
Fake / Example Data1 hit · 1 pts
SeverityFileLineSnippetContext
LOWlmdeploy/model.py844 messages = [{'role': 'user', 'content': 'placeholder'}, {'role': 'assistant', 'content': 'sentinel'}]CODE