Repository Analysis

google-ai-edge/LiteRT-LM

LiteRT-LM is Google's production-ready, high-performance, open-source inference framework for deploying Large Language Models on edge devices.

24.1 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of google-ai-edge/LiteRT-LM, a C++ project with 6,311 GitHub stars. SynthScan v2.0 examined 108,203 lines of code across 604 source files, recording 1881 pattern matches distributed across 17 syntactic categories. The overall adjusted score of 24.1 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).

24.1
Adjusted Score
24.1
Raw Score
100%
Time Factor
2026-08-29
Last Push
6.3K
Stars
C++
Language
108.2K
Lines of Code
604
Files
1.9K
Pattern Hits
2026-08-29
Scan Date
0.04
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 25MEDIUM 428LOW 1428

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 1881 distinct pattern matches across 17 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.

Decorative Section Separators413 hits · 1068 pts
SeverityFileLineSnippetContext
MEDIUMpython/litert_lm/debug_artifacts_test.py14# ==============================================================================COMMENT
MEDIUMjs/CMakeLists.txt17# ==============================================================================COMMENT
MEDIUMjs/CMakeLists.txt19# ==============================================================================COMMENT
MEDIUMjs/packages/core/src/cpp/CMakeLists.txt15# ==============================================================================COMMENT
MEDIUMjs/packages/core/src/cpp/CMakeLists.txt17# ==============================================================================COMMENT
MEDIUMjs/packages/core/src/cpp/CMakeLists.txt33# ==============================================================================COMMENT
MEDIUMjs/packages/core/src/cpp/CMakeLists.txt35# ==============================================================================COMMENT
MEDIUMjs/packages/core/src/cpp/CMakeLists.txt51# ==============================================================================COMMENT
MEDIUMjs/packages/core/src/cpp/CMakeLists.txt53# ==============================================================================COMMENT
MEDIUMruntime/CMakeLists.txt23# ==============================================================================COMMENT
MEDIUMruntime/CMakeLists.txt25# ==============================================================================COMMENT
MEDIUMruntime/core/CMakeLists.txt15# ==============================================================================COMMENT
MEDIUMruntime/core/CMakeLists.txt17# ==============================================================================COMMENT
MEDIUMruntime/core/CMakeLists.txt43# ==============================================================================COMMENT
MEDIUMruntime/core/CMakeLists.txt45# ==============================================================================COMMENT
MEDIUMruntime/core/CMakeLists.txt78# ==============================================================================COMMENT
MEDIUMruntime/core/CMakeLists.txt80# ==============================================================================COMMENT
MEDIUMruntime/core/CMakeLists.txt99# ==============================================================================COMMENT
MEDIUMruntime/core/CMakeLists.txt101# ==============================================================================COMMENT
MEDIUMruntime/core/CMakeLists.txt144# ==============================================================================COMMENT
MEDIUMruntime/core/CMakeLists.txt146# ==============================================================================COMMENT
MEDIUMruntime/core/CMakeLists.txt168# ==============================================================================COMMENT
MEDIUMruntime/core/CMakeLists.txt170# ==============================================================================COMMENT
MEDIUMruntime/core/CMakeLists.txt192# ==============================================================================COMMENT
MEDIUMruntime/core/CMakeLists.txt194# ==============================================================================COMMENT
MEDIUMruntime/core/CMakeLists.txt215# ==============================================================================COMMENT
MEDIUMruntime/core/CMakeLists.txt217# ==============================================================================COMMENT
MEDIUMruntime/core/CMakeLists.txt233# ==============================================================================COMMENT
MEDIUMruntime/core/CMakeLists.txt235# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt17# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt19# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt34# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt36# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt57# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt59# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt77# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt79# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt90# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt92# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt109# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt111# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt132# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt134# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt154# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt156# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt177# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt179# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt199# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt201# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt221# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt223# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt240# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt242# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt259# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt261# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt278# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt280# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt297# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt299# ==============================================================================COMMENT
MEDIUMruntime/util/CMakeLists.txt318# ==============================================================================COMMENT
353 more matches not shown…
Over-Commented Block893 hits · 862 pts
SeverityFileLineSnippetContext
LOWCMakeLists.txt1# Copyright 2026 Google LLC.COMMENT
LOW__init__.py1# Copyright 2025 The ODML Authors.COMMENT
LOWPackage.swift1// swift-tools-version: 5.9COMMENT
LOWtools/pytest/conftest.py1# Copyright 2026 Google LLC.COMMENT
LOWtools/pytest/utils.py1# Copyright 2026 Google LLC.COMMENT
LOWtools/pytest/test_e2e_sanity_checks.py1# Copyright 2026 Google LLC.COMMENT
LOWcmake/packages/litert_lm/CMakeLists.txt1# Copyright 2026 Google LLC.COMMENT
LOWcmake/packages/tflite/shims/CMakeLists-shim.txt1#COMMENT
LOWcmake/packages/litert/shims/CMakeLists-support-shim.txt1# Copyright 2026 Google LLC.COMMENT
LOWcmake/packages/litert/shims/CMakeLists-support-shim.txt161)COMMENT
LOWcmake/packages/litert/shims/CMakeLists-shim.txt1# Copyright 2026 Google LLC.COMMENT
LOWcmake/packages/litert/shims/CMakeLists-shim.txt161 endif()COMMENT
LOWpython/litert_lm/interfaces.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm/debug_artifacts_test.py1# Copyright 2026 The Google AI Edge Debugger Authors. All Rights Reserved.COMMENT
LOWpython/litert_lm/messages_test.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm/capabilities_test.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm/_ffi.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm/benchmark.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm/conversation.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm/tools.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm/session.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm/engine_test.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm/__init__.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm/tool_test.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm/_messages.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm/engine.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm/utils.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm/bundle_pypi_package.sh1#!/bin/bashCOMMENT
LOWpython/litert_lm/capabilities.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm/embedding_engine_test.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm/api_test.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm/embedding_engine.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm/examples/simple_main.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm/examples/multimodal_main.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm/examples/tool_main.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm_eval/utils_test.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm_eval/__init__.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm_eval/utils.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm_eval/litert_lm_eval_test.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm_eval/litert_lm_eval.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm_eval/runners/__init__.py1# Copyright 2026 The ODML Authors.COMMENT
LOW…lm_eval/runners/lm_eval_runner/litert_lm_model_test.py1# Copyright 2026 The ODML Authors.COMMENT
LOW…thon/litert_lm_eval/runners/lm_eval_runner/__init__.py1# Copyright 2026 The ODML Authors.COMMENT
LOW…tert_lm_eval/runners/lm_eval_runner/litert_lm_model.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm_cli/model_test.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm_cli/config.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm_cli/help_formatter.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm_cli/common_test.py1# Licensed under the Apache License, Version 2.0 (the "License");COMMENT
LOWpython/litert_lm_cli/venv_manager_test.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm_cli/cli_helpers.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm_cli/model.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm_cli/venv_manager.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm_cli/common.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm_cli/bundle_pypi_package.sh1#!/bin/bashCOMMENT
LOWpython/litert_lm_cli/cli_helpers_test.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm_cli/huggingface_download_test.py1# Licensed under the Apache License, Version 2.0 (the "License");COMMENT
LOWpython/litert_lm_cli/huggingface_download.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm_cli/main_test.py1# Copyright 2026 The ODML Authors.COMMENT
LOWpython/litert_lm_cli/cli_tests.sh1#!/bin/bashCOMMENT
LOWpython/litert_lm_cli/main.py1# Copyright 2026 The ODML Authors.COMMENT
833 more matches not shown…
Hyper-Verbose Identifiers366 hits · 349 pts
SeverityFileLineSnippetContext
LOWpython/litert_lm/debug_artifacts_test.py49 def test_get_debug_artifacts_with_warning_on_macro_disabled(self):CODE
LOWpython/litert_lm/debug_artifacts_test.py73 def test_get_debug_artifacts_invalid_session(self):CODE
LOWpython/litert_lm/debug_artifacts_test.py84 def test_get_debug_artifacts_empty_session_dir(self):CODE
LOWpython/litert_lm/debug_artifacts_test.py106 def test_get_debug_artifacts_populated_session_dir_and_sorting(self):CODE
LOWpython/litert_lm/debug_artifacts_test.py178 def test_get_debug_artifacts_with_warning_on_macro_disabled(self):CODE
LOWpython/litert_lm/debug_artifacts_test.py197 def test_get_debug_artifacts_populated_dir(self):CODE
LOWpython/litert_lm/messages_test.py77 def test_tool_response_content(self):CODE
LOWpython/litert_lm/messages_test.py112 def test_contents_of_sequence(self):CODE
LOWpython/litert_lm/messages_test.py176 def test_message_with_tool_calls(self):CODE
LOWpython/litert_lm/messages_test.py195 def test_message_with_channels(self):CODE
LOWpython/litert_lm/capabilities_test.py59 def test_capabilities_non_existent_file(self):CODE
LOWpython/litert_lm/capabilities_test.py67 def test_capabilities_destructor_deletes_handle(CODE
LOWpython/litert_lm/capabilities_test.py85 def test_capabilities_creation_failure_raises_runtime_error(CODE
LOWpython/litert_lm/capabilities_test.py100 def test_capabilities_destructor_noop_when_handle_none(CODE
LOWpython/litert_lm/capabilities_test.py117 def test_capabilities_destructor_noop_when_handle_not_set(CODE
LOWpython/litert_lm/capabilities_test.py131 def test_capabilities_context_manager(self):CODE
LOWpython/litert_lm/capabilities_test.py138 def test_capabilities_close_explicit(self):CODE
LOWpython/litert_lm/tools.py28def _parse_param_descriptions(docstring: str) -> dict[str, str]:CODE
LOWpython/litert_lm/engine_test.py442 def test_engine_abc_inheritance(self):CODE
LOWpython/litert_lm/engine_test.py446 def test_engine_tokenization_api(self):CODE
LOWpython/litert_lm/engine_test.py456 def test_engine_special_token_metadata(self):CODE
LOWpython/litert_lm/engine_test.py470 def test_conversation_abc_inheritance(self):CODE
LOWpython/litert_lm/engine_test.py477 def test_create_conversation_with_messages(self):CODE
LOWpython/litert_lm/engine_test.py485 def test_create_conversation_with_message_objects(self):CODE
LOWpython/litert_lm/engine_test.py509 def test_create_conversation_with_chat_template(self):CODE
LOWpython/litert_lm/engine_test.py517 def test_create_conversation_with_filter_channel_content_from_kv_cache(self):CODE
LOWpython/litert_lm/engine_test.py526 def test_create_conversation_with_max_output_tokens_async(self):CODE
LOWpython/litert_lm/engine_test.py536 def test_conversation_send_message_object(self):CODE
LOWpython/litert_lm/engine_test.py545 def test_conversation_send_contents_object(self):CODE
LOWpython/litert_lm/engine_test.py554 def test_conversation_send_dict_message(self):CODE
LOWpython/litert_lm/engine_test.py563 def test_conversation_with_thinking_config(self):CODE
LOWpython/litert_lm/engine_test.py856 def test_session_api_apply_prompt_template(self, apply_prompt_template):CODE
LOWpython/litert_lm/engine_test.py863 def test_response_format_validation(self):CODE
LOWpython/litert_lm/engine_test.py867 def test_response_format_without_enabling(self):CODE
LOWpython/litert_lm/engine_test.py74 def test_backend_cpu_equality(self):CODE
LOWpython/litert_lm/engine_test.py90 def test_engine_init_with_cpu_thread_counts(self):CODE
LOWpython/litert_lm/engine_test.py124 def test_engine_init_with_use_ringbuffers_local_attention(self):CODE
LOWpython/litert_lm/engine_test.py146 def test_engine_init_with_enable_ynnpack(self):CODE
LOWpython/litert_lm/engine_test.py169 def test_engine_init_with_npu_backend(self):CODE
LOWpython/litert_lm/engine_test.py201 def test_npu_backend_non_windows(self):CODE
LOWpython/litert_lm/engine_test.py210 def test_npu_backend_windows_no_openvino(self):CODE
LOWpython/litert_lm/engine_test.py221 def test_npu_backend_windows_openvino_no_npu(self):CODE
LOWpython/litert_lm/engine_test.py234 def test_npu_backend_windows_openvino_with_npu(self):CODE
LOWpython/litert_lm/engine_test.py255 def test_engine_init_with_legacy_backend_class(self):CODE
LOWpython/litert_lm/engine_test.py272 def test_sampler_config_validation(self):CODE
LOWpython/litert_lm/engine_test.py291 def test_conversation_with_sampler_config(self):CODE
LOWpython/litert_lm/engine_test.py306 def test_session_with_sampler_config(self):CODE
LOWpython/litert_lm/engine_test.py319 def test_conversation_send_message(self):CODE
LOWpython/litert_lm/engine_test.py334 def test_conversation_render_message_to_string(self):CODE
LOWpython/litert_lm/engine_test.py345 def test_conversation_send_message_async(self):CODE
LOWpython/litert_lm/engine_test.py358 def test_conversation_send_message_async_cancel(self):CODE
LOWpython/litert_lm/engine_test.py399 def test_benchmark_class_with_thread_count(self):CODE
LOWpython/litert_lm/engine_test.py419 def test_benchmark_class_with_enable_speculative_decoding(self):CODE
LOWpython/litert_lm/engine_test.py496 def test_create_conversation_with_max_output_tokens(self):CODE
LOWpython/litert_lm/engine_test.py594 def test_conversation_token_count(self):CODE
LOWpython/litert_lm/engine_test.py604 def test_conversation_get_benchmark_info(self):CODE
LOWpython/litert_lm/engine_test.py617 def test_create_conversation_with_extra_context(self):CODE
LOWpython/litert_lm/engine_test.py625 def test_tool_event_handler_storage(self):CODE
LOWpython/litert_lm/engine_test.py642 def test_session_api_run_decode(self):CODE
LOWpython/litert_lm/engine_test.py656 def test_session_api_run_text_scoring_with_token_lengths(self):CODE
306 more matches not shown…
Docstring Block Structure25 hits · 125 pts
SeverityFileLineSnippetContext
HIGHtools/pytest/utils.py25Loads test data from a JSON file. Dynamically loads test data from a JSON file matching the caller's filename. ArgSTRING
HIGHpython/litert_lm/utils.py51Converts a ThinkingConfig to a LiteRtLmThinkingConfig opaque pointer. Args: lib: The loaded C library instance.STRING
HIGHpython/litert_lm_cli/cli_helpers.py35Prompts the user to select an option from a list. Args: choices: The list of choices to present. message: TheSTRING
HIGHpython/litert_lm_cli/cli_helpers.py70Resolves the model file when it is missing, prompting the user. Args: from_huggingface_repo: The HuggingFace repoSTRING
HIGHpython/litert_lm_cli/model.py45Returns the attachment type (audio or image) from the file path. Args: path: Path to the attachment. Returns: STRING
HIGHpython/litert_lm_cli/common.py96Returns the cache directory value for the given cache mode. Args: cache: The cache mode. Valid values are "disk",STRING
HIGHpython/litert_lm_cli/huggingface_download.py85Downloads a file from HuggingFace Hub. Args: repo_id: The HuggingFace repository ID. filename: The filename tSTRING
HIGHpython/litert_lm_cli/huggingface_download.py162Lists .litertlm files in a HuggingFace repository. Args: repo_id: The HuggingFace repository ID. token: The HSTRING
HIGHpython/litert_lm_cli/commands/import.py41Downloads an experimental model. Args: model_id: The unique ID of the experimental model to download. user_agSTRING
HIGHpython/litert_lm_cli/commands/import.py92Copies the source file to dest, falling back to download if needed. If the source is a local file (equal to model_filSTRING
HIGHpython/litert_lm_cli/commands/serve_util.py107Retrieves the persistent server engine or initializes it on first request. Lifetime Management: The LiteRT-LM EnginSTRING
HIGHpython/litert_lm_cli/commands/serve_util.py230Retrieves the persistent server embedding engine or initializes it on first request. Args: server: The active cusSTRING
HIGHpython/litert_lm_cli/commands/openai_handler.py163Parses a model parameter string into (model_id, backend, max_num_tokens). Format: "<model-id>[,<backend>[,<max-token>STRING
HIGHpython/litert_lm_cli/commands/openai_handler.py651Translates an OpenAI message to a LiteRT-LM message format. This function takes a message dictionary, typically from STRING
HIGHpython/litert_lm_builder/litertlm_builder_cli.py383Parses the command-line arguments. Args: parser: The argument parser to use. Returns: A list of parsed argSTRING
HIGHpython/litert_lm_builder/litertlm_peek.py93Reads the header of a LiteRT-LM file and returns the metadata. Args: file_path: The path to the LiteRT-LM file. STRING
HIGHpython/litert_lm_builder/litertlm_builder.py322Initializes a LitertLmFileBuilder from a loaded TOML string. Args: toml_str: The TOML string to parse. STRING
HIGHpython/litert_lm_builder/litertlm_builder.py502Adds llm metadata to the litertlm file. Args: llm_metadata_path: The path to the llm metadata file. Can be biSTRING
HIGHpython/litert_lm_builder/litertlm_builder.py572Adds executor metadata to the litertlm file. Args: executor_metadata_path: The path to the executor metadata STRING
HIGHpython/litert_lm_builder/litertlm_builder.py622Adds embedding metadata to the litertlm file. Args: embedding_metadata_path: The path to the embedding metadaSTRING
HIGHpython/litert_lm_builder/litertlm_builder.py676Adds a tflite model to the litertlm file. Args: tflite_model_path: The path to the tflite model file. mSTRING
HIGHpython/litert_lm_builder/litertlm_builder.py747Adds tflite weights to the litertlm file. Args: tflite_weights_path: The path to the tflite weights file. STRING
HIGHpython/litert_lm_builder/litertlm_builder.py792Adds a sentencepiece tokenizer to the litertlm file. Args: sp_tokenizer_path: The path to the sentencepiece tSTRING
HIGHpython/litert_lm_builder/litertlm_builder.py829Adds a hf tokenizer to the litertlm file. Args: hf_tokenizer_path: The path to the hf tokenizer `tokenizer.jsSTRING
HIGHpython/litert_lm_builder/litertlm_builder.py875Adds generic binary data to the litertlm file. Args: generic_binary_data_path: The path to the generic binarySTRING
Unused Imports62 hits · 52 pts
SeverityFileLineSnippetContext
LOWpython/litert_lm/interfaces.py17CODE
LOWpython/litert_lm/_ffi.py16CODE
LOWpython/litert_lm/conversation.py16CODE
LOWpython/litert_lm/tools.py17CODE
LOWpython/litert_lm/__init__.py19CODE
LOWpython/litert_lm/__init__.py20CODE
LOWpython/litert_lm/__init__.py21CODE
LOWpython/litert_lm/__init__.py22CODE
LOWpython/litert_lm/__init__.py23CODE
LOWpython/litert_lm/__init__.py24CODE
LOWpython/litert_lm/__init__.py25CODE
LOWpython/litert_lm/__init__.py26CODE
LOWpython/litert_lm/__init__.py27CODE
LOWpython/litert_lm/__init__.py28CODE
LOWpython/litert_lm/__init__.py29CODE
LOWpython/litert_lm/__init__.py30CODE
LOWpython/litert_lm/__init__.py31CODE
LOWpython/litert_lm/__init__.py32CODE
LOWpython/litert_lm/__init__.py33CODE
LOWpython/litert_lm/__init__.py34CODE
LOWpython/litert_lm/__init__.py35CODE
LOWpython/litert_lm/__init__.py36CODE
LOWpython/litert_lm/__init__.py37CODE
LOWpython/litert_lm/__init__.py38CODE
LOWpython/litert_lm/__init__.py39CODE
LOWpython/litert_lm/__init__.py40CODE
LOWpython/litert_lm/__init__.py41CODE
LOWpython/litert_lm/__init__.py42CODE
LOWpython/litert_lm/__init__.py43CODE
LOWpython/litert_lm/__init__.py44CODE
LOWpython/litert_lm/__init__.py45CODE
LOWpython/litert_lm/__init__.py46CODE
LOWpython/litert_lm/__init__.py47CODE
LOWpython/litert_lm/__init__.py48CODE
LOWpython/litert_lm/__init__.py49CODE
LOWpython/litert_lm/__init__.py50CODE
LOWpython/litert_lm/__init__.py51CODE
LOWpython/litert_lm/__init__.py52CODE
LOWpython/litert_lm/__init__.py53CODE
LOWpython/litert_lm/__init__.py54CODE
LOWpython/litert_lm/__init__.py55CODE
LOWpython/litert_lm/__init__.py56CODE
LOWpython/litert_lm/__init__.py57CODE
LOWpython/litert_lm/_messages.py16CODE
LOWpython/litert_lm/engine.py16CODE
LOWpython/litert_lm/capabilities.py35CODE
LOWpython/litert_lm/embedding_engine.py16CODE
LOWpython/litert_lm_eval/litert_lm_eval.py43CODE
LOWpython/litert_lm_eval/litert_lm_eval.py49CODE
LOWpython/litert_lm_cli/config.py16CODE
LOWpython/litert_lm_cli/model.py17CODE
LOWpython/litert_lm_cli/main.py18CODE
LOWpython/litert_lm_cli/commands/run.py33CODE
LOWpython/litert_lm_cli/commands/convert.py17CODE
LOWpython/litert_lm_cli/commands/convert.py18CODE
LOWpython/litert_lm_cli/commands/convert.py22CODE
LOWpython/litert_lm_cli/commands/convert.py23CODE
LOWpython/litert_lm_cli/commands/convert.py24CODE
LOWpython/litert_lm_cli/commands/serve.py20CODE
LOWpython/litert_lm_cli/commands/serve_util.py15CODE
2 more matches not shown…
Excessive Try-Catch Wrapping35 hits · 35 pts
SeverityFileLineSnippetContext
LOWpython/litert_lm/conversation.py84 except Exception: # pylint: disable=broad-exception-caughtCODE
LOWpython/litert_lm/conversation.py118 except Exception as e: # pylint: disable=broad-exception-caughtCODE
LOWpython/litert_lm/conversation.py264 except Exception as e:CODE
LOWpython/litert_lm/session.py43 except Exception: # pylint: disable=broad-exception-caughtCODE
LOWpython/litert_lm/engine.py211 except Exception: # pylint: disable=broad-exception-caughtCODE
LOWpython/litert_lm/embedding_engine.py418 except Exception: # pylint: disable=broad-exception-caughtCODE
LOW…tert_lm_eval/runners/lm_eval_runner/litert_lm_model.py78 except Exception: # pylint: disable=broad-exceptCODE
LOW…tert_lm_eval/runners/lm_eval_runner/litert_lm_model.py120 except Exception as e:CODE
LOW…tert_lm_eval/runners/lm_eval_runner/litert_lm_model.py135 except Exception as e:CODE
LOWpython/litert_lm_cli/config.py152 except Exception as e:CODE
LOWpython/litert_lm_cli/config.py326 except Exception as e:CODE
LOWpython/litert_lm_cli/model.py166 except Exception as e: # pylint: disable=broad-exception-caughtCODE
LOWpython/litert_lm_cli/common.py308 except Exception:CODE
LOWpython/litert_lm_cli/huggingface_download.py67 except Exception as e:CODE
LOWpython/litert_lm_cli/commands/pack.py181 except Exception as e: # pylint: disable=broad-exception-caughtSTRING
LOWpython/litert_lm_cli/commands/run.py416 except Exception: # pylint: disable=broad-exception-caughtCODE
LOWpython/litert_lm_cli/commands/run.py420 except Exception: # pylint: disable=broad-exception-caughtCODE
LOWpython/litert_lm_cli/commands/benchmark.py189 except Exception: # pylint: disable=broad-exception-caughtCODE
LOWpython/litert_lm_cli/commands/gemini_handler.py228 except Exception as e: # pylint: disable=broad-exception-caughtCODE
LOWpython/litert_lm_cli/commands/gemini_handler.py367 except Exception as e: # pylint: disable=broad-exception-caughtCODE
LOWpython/litert_lm_cli/commands/gemini_handler.py430 except Exception as e: # pylint: disable=broad-exception-caughtCODE
LOWpython/litert_lm_cli/commands/openai_handler.py371 except Exception: # pylint: disable=broad-exception-caughtCODE
LOWpython/litert_lm_cli/commands/openai_handler.py775 except Exception as e:CODE
LOWpython/litert_lm_cli/commands/openai_handler.py917 except Exception as e: # pylint: disable=broad-exception-caughtCODE
LOWpython/litert_lm_cli/commands/openai_handler.py929 except Exception: # pylint: disable=broad-exception-caughtCODE
LOWpython/litert_lm_cli/commands/openai_handler.py1149 except Exception as e: # pylint: disable=broad-exception-caughtCODE
LOWpython/litert_lm_cli/commands/openai_handler.py1210 except Exception as e: # pylint: disable=broad-exception-caughtCODE
LOWpython/litert_lm_cli/commands/openai_handler.py1384 except Exception as e: # pylint: disable=broad-exception-caughtCODE
LOWpython/litert_lm_cli/commands/openai_handler.py1474 except Exception as e: # pylint: disable=broad-exception-caughtCODE
LOWpython/litert_lm_cli/commands/openai_handler.py1501 except Exception as e: # pylint: disable=broad-exception-caughtCODE
LOWpython/litert_lm_cli/commands/openai_handler.py1601 except Exception as e: # pylint: disable=broad-exception-caughtCODE
LOWpython/litert_lm_cli/commands/unpack.py168 except Exception as e: # pylint: disable=broad-exception-caughtSTRING
LOW…/litert_lm_cli/commands/serve_openai_streaming_test.py76 except Exception: # pylint: disable=broad-exception-caughtCODE
LOW…/litert_lm_cli/commands/serve_openai_streaming_test.py188 except Exception as e: # pylint: disable=broad-exception-caughtCODE
MEDIUMpython/litert_lm_builder/litertlm_peek_main.py59 print(f"Error processing file: {e}", file=sys.stderr)CODE
Deep Nesting37 hits · 34 pts
SeverityFileLineSnippetContext
LOWtools/pytest/conftest.py139CODE
LOWpython/litert_lm/conversation.py154CODE
LOWpython/litert_lm/conversation.py349CODE
LOWpython/litert_lm/tools.py28CODE
LOWpython/litert_lm/session.py131CODE
LOWpython/litert_lm/engine_test.py169CODE
LOWpython/litert_lm/engine_test.py358CODE
LOWpython/litert_lm/engine.py221CODE
LOWpython/litert_lm/engine.py457CODE
LOWpython/litert_lm/utils.py78CODE
LOWpython/litert_lm/api_test.py222CODE
LOWpython/litert_lm/embedding_engine.py82CODE
LOWpython/litert_lm/embedding_engine.py306CODE
LOWpython/litert_lm/examples/tool_main.py42CODE
LOWpython/litert_lm_eval/utils.py20CODE
LOW…tert_lm_eval/runners/lm_eval_runner/litert_lm_model.py143CODE
LOW…tert_lm_eval/runners/lm_eval_runner/litert_lm_model.py207CODE
LOWpython/litert_lm_cli/model_test.py46CODE
LOWpython/litert_lm_cli/config.py199CODE
LOWpython/litert_lm_cli/model.py115CODE
LOWpython/litert_lm_cli/model.py196CODE
LOWpython/litert_lm_cli/common.py268CODE
LOWpython/litert_lm_cli/commands/import.py84CODE
LOWpython/litert_lm_cli/commands/run.py80CODE
LOWpython/litert_lm_cli/commands/run.py175CODE
LOWpython/litert_lm_cli/commands/serve.py34CODE
LOWpython/litert_lm_cli/commands/openai_handler.py68CODE
LOWpython/litert_lm_cli/commands/openai_handler.py647CODE
LOWpython/litert_lm_cli/commands/openai_handler.py851CODE
LOWpython/litert_lm_cli/commands/openai_handler.py932CODE
LOWpython/litert_lm_cli/commands/openai_handler.py1505CODE
LOW…/litert_lm_cli/commands/serve_openai_streaming_test.py33CODE
LOWpython/litert_lm_builder/litertlm_peek.py390CODE
LOWpython/litert_lm_builder/litertlm_peek.py487CODE
LOWpython/litert_lm_builder/litertlm_peek.py528CODE
LOWpython/litert_lm_builder/litertlm_builder.py316CODE
LOWpython/litert_lm_builder/litertlm_builder.py496CODE
Example Usage Blocks12 hits · 18 pts
SeverityFileLineSnippetContext
LOWruntime/components/prompt_template.h35// Example usage:COMMENT
LOW…/components/constrained_decoding/constrained_decoder.h39// Example usage:COMMENT
LOWruntime/engine/engine.h46// Example usage:COMMENT
LOWruntime/engine/engine.h279 // Example usage:COMMENT
LOWruntime/engine/engine.h297 // Example usage:COMMENT
LOWruntime/engine/engine_factory.h44// Example usage:COMMENT
LOWruntime/conversation/conversation.h135 // Example usage:COMMENT
LOWruntime/conversation/conversation.h481// Example usage:COMMENT
LOWruntime/conversation/conversation.h599 // Example usage:COMMENT
LOWswift/Conversation.swift41/// Example usage:COMMENT
LOWswift/EmbeddingEngine.swift22/// Example usage:COMMENT
LOWswift/Engine.swift22/// Example usage:COMMENT
Self-Referential Comments5 hits · 15 pts
SeverityFileLineSnippetContext
MEDIUM…tert_lm_eval/runners/lm_eval_runner/litert_lm_model.py33# Define the placeholder used by the evaluation harness.COMMENT
MEDIUMpython/litert_lm_cli/main_test.py814 # Create a dummy source file to simulate unpacking a local .litertlm fileCOMMENT
MEDIUMpython/litert_lm_builder/litertlm_peek_test.py110 # Create a temporary directory for dumping files.COMMENT
MEDIUMpython/litert_lm_builder/litertlm_peek_test.py194 # Create a temporary directory for dumping files.COMMENT
MEDIUM.github/workflows/ml-ci-build-win.yml149 # Create a dedicated directory on the big drive for the B: mountCOMMENT
AI Slop Vocabulary7 hits · 14 pts
SeverityFileLineSnippetContext
MEDIUMpython/litert_lm/api_test.py27 """Executes master comprehensive E2E tests covering multi-turn reasoning, streaming, tools, and telemetry."""STRING
MEDIUM…tert_lm_eval/runners/lm_eval_runner/litert_lm_model.py33# Define the placeholder used by the evaluation harness.COMMENT
LOWpython/litert_lm_cli/main_test.py395 # Since we are in an isolated filesystem, we'll just use simple namesCOMMENT
LOWpython/litert_lm_cli/main_test.py400 # or just use paths that will exist.COMMENT
LOWpython/litert_lm_builder/litertlm_builder.py1056 # This is expected if the file is in text format. We'll just pass and tryCOMMENT
MEDIUMruntime/util/litert_lm_loader.h92 // A simple hash combine. For more robust hashing, considerCOMMENT
MEDIUM…ntime/framework/resource_management/resource_manager.h45// as the LlmExecutor, enabling multiple sessions to utilize it concurrently.COMMENT
AI Structural Patterns9 hits · 9 pts
SeverityFileLineSnippetContext
LOWpython/litert_lm/interfaces.py430CODE
LOWpython/litert_lm/interfaces.py580CODE
LOWpython/litert_lm/conversation.py40CODE
LOWpython/litert_lm/engine.py52CODE
LOWpython/litert_lm/engine.py221CODE
LOWpython/litert_lm_cli/commands/run.py175CODE
LOWpython/litert_lm_cli/commands/run.py576CODE
LOWpython/litert_lm_cli/commands/benchmark.py37CODE
LOWpython/litert_lm_cli/commands/benchmark.py244CODE
Modern AI Meta-Vocabulary4 hits · 8 pts
SeverityFileLineSnippetContext
MEDIUMREADME.md66[Bringing Gemma 4 12B to your Laptop: Unlocking Local, Agentic Workflows with Google AI Edge](https://developers.googlebCODE
MEDIUMREADME.md69[Bring state-of-the-art agentic skills to the edge with Gemma 4](https://developers.googleblog.com/bring-state-of-the-arCODE
MEDIUMREADME.md148 ([blog](https://developers.googleblog.com/bring-state-of-the-art-agentic-skills-to-the-edge-with-gemma-4/))CODE
MEDIUMdocs/getting-started/cmake.md44├── sentencepiece.cmake # Primary orchestration module (ExternalProject_Add)CODE
Redundant / Tautological Comments4 hits · 6 pts
SeverityFileLineSnippetContext
LOWpython/litert_lm_cli/bundle_pypi_package.sh79# Check if wheels were pre-fetched by Kokoro via gfile_resources into KOKORO_GFILE_DIRCOMMENT
LOWpython/litert_lm_cli/main_test.py131 # Check if expected keys are added.COMMENT
LOWpython/litert_lm_cli/main_test.py133 # Check if enter (ControlM), c-j (ControlJ), esc+enter, c-c (ControlC).COMMENT
LOWpython/litert_lm_builder/litertlm_peek_test.py132 # Check if files were dumped in the specified directory.COMMENT
Fake / Example Data5 hits · 6 pts
SeverityFileLineSnippetContext
LOWpython/litert_lm_cli/huggingface_download_test.py80 repo_id=repo_id, filename=filename, token="fake-token"CODE
LOWpython/litert_lm_cli/huggingface_download_test.py96 self.assertEqual(req.get_header("Authorization"), "Bearer fake-token")CODE
LOWpython/litert_lm_cli/huggingface_download_test.py179 repo_id=repo_id, token="fake-token"CODE
LOWpython/litert_lm_cli/huggingface_download_test.py185 self.assertEqual(req.get_header("Authorization"), "Bearer fake-token")CODE
LOWpython/litert_lm_cli/huggingface_download_test.py204 repo_id=repo_id, token="fake-token"CODE
Slop Phrases1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMpython/litert_lm_builder/litertlm_builder_cli.py50# Section 1: SP_Tokenizer (you can also use HF_Tokenizer)COMMENT
Modern Structural Boilerplate2 hits · 2 pts
SeverityFileLineSnippetContext
LOWpython/litert_lm_cli/config.py120def set_config_path(config_path: str | None) -> None:CODE
LOWpython/litert_lm_builder/__init__.py31__all__ = [CODE
Structural Annotation Overuse1 hit · 2 pts
SeverityFileLineSnippetContext
LOWcmake/packages/tflite/shims/CMakeLists-shim.txt19# WARNING: This is an experimental that is subject to change.COMMENT