Python bindings for llama.cpp
This report presents the forensic synthetic code analysis of abetlen/llama-cpp-python, a Python project with 10,485 GitHub stars. SynthScan v2.0 examined 44,784 lines of code across 96 source files, recording 509 pattern matches distributed across 14 syntactic categories. The overall adjusted score of 9.0 places this repository in the Low 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).
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.
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.
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.
The scanner identified 509 distinct pattern matches across 14 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.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | tests/test_llama.py | 69 | def llama_cpp_transformer_model_path(): | CODE |
| LOW⚡ | tests/test_llama.py | 77 | def llama_cpp_embedding_model_path(): | CODE |
| LOW⚡ | tests/test_llama.py | 85 | def llama_cpp_recurrent_model_path(): | CODE |
| LOW⚡ | tests/test_llama.py | 93 | def llama_cpp_hybrid_model_path(): | CODE |
| LOW | tests/test_llama.py | 23 | def test_llama_cpp_tokenization(): | CODE |
| LOW | tests/test_llama.py | 261 | def test_real_llama_repeated_prompt_cache(llama_cpp_model_path): | STRING |
| LOW | tests/test_llama.py | 292 | def _assert_prompt_cache_reset_handles_history_edit( | STRING |
| LOW | tests/test_llama.py | 335 | def test_recurrent_model_prompt_cache_reset(llama_cpp_recurrent_model_path): | STRING |
| LOW | tests/test_llama.py | 343 | def test_hybrid_model_prompt_cache_reset(llama_cpp_hybrid_model_path): | STRING |
| LOW | tests/test_llama.py | 385 | def _eval_alternate_same_length_prompt(model, tokens, expected_next_token): | STRING |
| LOW | tests/test_llama.py | 409 | def _assert_exact_cached_prompt_reuse_matches_fresh( | STRING |
| LOW | tests/test_llama.py | 449 | def _assert_loaded_exact_cached_prompt_reuse_matches_fresh( | STRING |
| LOW | tests/test_llama.py | 486 | def _assert_ram_cache_exact_prompt_hit_matches_fresh( | STRING |
| LOW | tests/test_llama.py | 541 | def _assert_shorter_prompt_prefix_reuse_matches_fresh( | STRING |
| LOW | tests/test_llama.py | 569 | def test_exact_cached_prompt_reuse_matches_fresh( | STRING |
| LOW | tests/test_llama.py | 585 | def test_loaded_exact_cached_prompt_reuse_matches_fresh( | STRING |
| LOW | tests/test_llama.py | 601 | def test_ram_cache_exact_prompt_hit_matches_fresh( | STRING |
| LOW | tests/test_llama.py | 617 | def test_shorter_prompt_prefix_reuse_matches_fresh( | STRING |
| LOW | tests/test_llama.py | 630 | def test_real_llama_embeddings(llama_cpp_embedding_model_path): | STRING |
| LOW | tests/test_llama_grammar.py | 18 | def test_composed_pydantic_grammar(): | STRING |
| LOW | tests/test_llama_speculative.py | 6 | def test_find_candidate_pred_tokens(): | CODE |
| LOW | tests/test_llama_chat_format.py | 85 | def test_hf_tokenizer_config_str_to_chat_formatter(): | CODE |
| LOW⚡ | examples/server/server.py | 13156 | def request_needs_prompt_logits(request: CompletionRequest) -> bool: | CODE |
| LOW⚡ | examples/server/server.py | 13162 | def request_needs_uncached_prompt_logprobs(request: CompletionRequest) -> bool: | CODE |
| LOW⚡ | examples/server/server.py | 13166 | def clear_sequence_cache_match(request: CompletionRequest) -> None: | CODE |
| LOW⚡ | examples/server/server.py | 13170 | def can_lookup_sequence_cache(self, request: CompletionRequest) -> bool: | CODE |
| LOW⚡ | examples/server/server.py | 13177 | def is_sequence_cache_match_usable( | CODE |
| LOW | examples/server/server.py | 4529 | def _regex_literal_prefix_and_remainder(pattern: str) -> Tuple[str, str]: | CODE |
| LOW | examples/server/server.py | 4584 | def _consume_optional_literal_prefix( | CODE |
| LOW | examples/server/server.py | 4599 | def _split_regex_alternatives(pattern: str) -> List[str]: | CODE |
| LOW | examples/server/server.py | 4633 | def _regex_lookahead_literal_specs(cls, pattern: str) -> List[Tuple[str, bool]]: | CODE |
| LOW | examples/server/server.py | 4671 | def _regex_capture_end_literal_specs(cls, pattern: str) -> List[Tuple[str, bool]]: | CODE |
| LOW | examples/server/server.py | 4683 | def _regex_capture_end_literals(cls, pattern: str) -> List[str]: | CODE |
| LOW | examples/server/server.py | 4728 | def _literal_suffix_prefix_length(text: str, literal: str) -> int: | CODE |
| LOW | examples/server/server.py | 4763 | def _compile_iterator_pattern(pattern: str) -> Optional[Tuple[str, str]]: | CODE |
| LOW | examples/server/server.py | 4774 | def _compile_iterator_block_pattern( | CODE |
| LOW | examples/server/server.py | 4853 | def _compile_word_capture_pattern( | CODE |
| LOW | examples/server/server.py | 4872 | def _consume_until_any_literal( | CODE |
| LOW | examples/server/server.py | 4907 | def _compile_tool_call_item_plan( | CODE |
| LOW | examples/server/server.py | 4976 | def _compile_segment_message_plan( | CODE |
| LOW | examples/server/server.py | 5045 | def _compile_tagged_message_plan( | CODE |
| LOW | examples/server/server.py | 5224 | def _parameter_schema_for_tool( | CODE |
| LOW | examples/server/server.py | 5250 | def _raw_string_tool_arguments(self, tool_name: str, value: str) -> Optional[Dict[str, str]]: | CODE |
| LOW | examples/server/server.py | 5282 | def _single_string_tool_argument_name(self, tool_name: str) -> Optional[str]: | CODE |
| LOW | examples/server/server.py | 5314 | def _text_tool_argument_from_object( | CODE |
| LOW | examples/server/server.py | 5364 | def _raw_object_tool_arguments(cls, value: str) -> Optional[Dict[str, Any]]: | CODE |
| LOW | examples/server/server.py | 5386 | def _trim_partial_gemma_quote_marker(value: str) -> str: | CODE |
| LOW | examples/server/server.py | 5585 | def _advance_direct_tool_call_state(self, text: str) -> Tuple[bool, List[Dict[str, Any]]]: | CODE |
| LOW | examples/server/server.py | 5836 | def _advance_direct_stream_state(self, text: str) -> Tuple[bool, List[Dict[str, Any]]]: | CODE |
| LOW | examples/server/server.py | 6673 | def _partial_regex_key_value_item( | CODE |
| LOW | examples/server/server.py | 6708 | def _trim_partial_tool_call_prefix( | CODE |
| LOW | examples/server/server.py | 7172 | def _normalize_tool_call_item( | CODE |
| LOW | examples/server/server.py | 7255 | def _serialize_partial_json_prefix(cls, value: Any) -> str: | CODE |
| LOW | examples/server/server.py | 7302 | def _contains_partial_json_value(cls, value: Any) -> bool: | CODE |
| LOW | examples/server/server.py | 7314 | def _serialize_partial_json_state(cls, value: Any) -> Tuple[str, bool]: | CODE |
| LOW | examples/server/server.py | 7357 | def _serialize_tool_arguments(cls, arguments: Any, *, partial: bool = False) -> str: | CODE |
| LOW | examples/server/server.py | 7897 | def _tools_for_response_parser( | CODE |
| LOW | examples/server/server.py | 7933 | def _response_reasoning_effort( | CODE |
| LOW | examples/server/server.py | 7945 | def _response_text_from_content(content: Any) -> str: | CODE |
| LOW | examples/server/server.py | 7969 | def _response_chat_content_from_content( | CODE |
| 237 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docker/open_llama/hug_model.py | 29 | CODE | |
| LOW | examples/low_level_api/low_level_api_chat_cpp.py | 338 | CODE | |
| LOW | examples/low_level_api/low_level_api_chat_cpp.py | 699 | CODE | |
| LOW | examples/server/server.py | 15737 | CODE | |
| LOW | examples/server/server.py | 329 | CODE | |
| LOW | examples/server/server.py | 364 | CODE | |
| LOW | examples/server/server.py | 526 | CODE | |
| LOW | examples/server/server.py | 1818 | CODE | |
| LOW | examples/server/server.py | 2239 | CODE | |
| LOW | examples/server/server.py | 3503 | CODE | |
| LOW | examples/server/server.py | 4529 | CODE | |
| LOW | examples/server/server.py | 5419 | CODE | |
| LOW | examples/server/server.py | 5585 | CODE | |
| LOW | examples/server/server.py | 5836 | CODE | |
| LOW | examples/server/server.py | 6003 | CODE | |
| LOW | examples/server/server.py | 6380 | CODE | |
| LOW | examples/server/server.py | 6734 | CODE | |
| LOW | examples/server/server.py | 7366 | CODE | |
| LOW | examples/server/server.py | 7687 | CODE | |
| LOW | examples/server/server.py | 8137 | CODE | |
| LOW | examples/server/server.py | 8698 | CODE | |
| LOW | examples/server/server.py | 8952 | CODE | |
| LOW | examples/server/server.py | 9308 | CODE | |
| LOW | examples/server/server.py | 9492 | CODE | |
| LOW | examples/server/server.py | 10021 | CODE | |
| LOW | examples/server/server.py | 10998 | CODE | |
| LOW | examples/server/server.py | 11235 | CODE | |
| LOW | examples/server/server.py | 11582 | CODE | |
| LOW | examples/server/server.py | 12744 | CODE | |
| LOW | examples/server/server.py | 13363 | CODE | |
| LOW | examples/server/server.py | 13537 | CODE | |
| LOW | examples/server/server.py | 13764 | CODE | |
| LOW | examples/server/server.py | 13860 | CODE | |
| LOW | examples/server/server.py | 14313 | CODE | |
| LOW | examples/server/server.py | 15866 | CODE | |
| LOW | examples/server/server.py | 15911 | CODE | |
| LOW | examples/server/server.py | 16174 | CODE | |
| LOW | examples/server/server.py | 330 | CODE | |
| LOW | examples/server/server.py | 377 | CODE | |
| LOW | llama_cpp/llama_chat_format.py | 1461 | CODE | |
| LOW | llama_cpp/llama_chat_format.py | 1824 | CODE | |
| LOW | llama_cpp/llama_chat_format.py | 4131 | CODE | |
| LOW | llama_cpp/llama_chat_format.py | 1491 | CODE | |
| LOW | llama_cpp/llama_chat_format.py | 1575 | CODE | |
| LOW | llama_cpp/llama_chat_format.py | 1875 | CODE | |
| LOW | llama_cpp/llama_chat_format.py | 2140 | CODE | |
| LOW | llama_cpp/llama_chat_format.py | 2852 | CODE | |
| LOW | llama_cpp/llama_chat_format.py | 3140 | CODE | |
| LOW | llama_cpp/llama_chat_format.py | 3402 | CODE | |
| LOW | llama_cpp/llama_chat_format.py | 3673 | CODE | |
| LOW | llama_cpp/llama_chat_format.py | 1625 | CODE | |
| LOW | llama_cpp/llama.py | 60 | CODE | |
| LOW | llama_cpp/llama.py | 697 | CODE | |
| LOW | llama_cpp/llama.py | 847 | CODE | |
| LOW | llama_cpp/llama.py | 1188 | CODE | |
| LOW | llama_cpp/_ctypes_extensions.py | 26 | CODE | |
| LOW | llama_cpp/llama_grammar.py | 439 | CODE | |
| LOW | llama_cpp/llama_grammar.py | 500 | CODE | |
| LOW | llama_cpp/llama_grammar.py | 697 | CODE | |
| LOW | llama_cpp/llama_grammar.py | 446 | CODE | |
| 5 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_llama.py | 1 | CODE | |
| LOW | tests/test_llama.py | 6 | CODE | |
| LOW | examples/low_level_api/ReasonAct.py | 2 | CODE | |
| LOW | examples/server/server.py | 17 | CODE | |
| LOW | examples/server/server.py | 39 | CODE | |
| LOW | examples/batch-processing/server.py | 26 | CODE | |
| LOW | llama_cpp/llama_cache.py | 14 | CODE | |
| LOW | llama_cpp/llama_tokenizer.py | 1 | CODE | |
| LOW | llama_cpp/llama_chat_format.py | 1 | CODE | |
| LOW | llama_cpp/__init__.py | 1 | CODE | |
| LOW | llama_cpp/__init__.py | 2 | CODE | |
| LOW | llama_cpp/llama_cpp.py | 1 | CODE | |
| LOW | llama_cpp/llama_cpp.py | 16 | CODE | |
| LOW | llama_cpp/llama_cpp.py | 23 | CODE | |
| LOW | llama_cpp/llama_cpp.py | 23 | CODE | |
| LOW | llama_cpp/llama_cpp.py | 23 | CODE | |
| LOW | llama_cpp/_internals.py | 1 | CODE | |
| LOW | llama_cpp/_internals.py | 7 | CODE | |
| LOW | llama_cpp/_internals.py | 22 | CODE | |
| LOW | llama_cpp/llama.py | 1 | CODE | |
| LOW | llama_cpp/llama.py | 33 | CODE | |
| LOW | llama_cpp/llama.py | 35 | CODE | |
| LOW | llama_cpp/llama.py | 35 | CODE | |
| LOW | llama_cpp/llama.py | 35 | CODE | |
| LOW | llama_cpp/mtmd_cpp.py | 1 | CODE | |
| LOW | llama_cpp/mtmd_cpp.py | 5 | CODE | |
| LOW | llama_cpp/mtmd_cpp.py | 5 | CODE | |
| LOW | llama_cpp/_ctypes_extensions.py | 1 | CODE | |
| LOW | llama_cpp/llama_cpp_ext.py | 7 | CODE | |
| LOW | llama_cpp/llava_cpp.py | 1 | CODE | |
| LOW | llama_cpp/llava_cpp.py | 4 | CODE | |
| LOW | llama_cpp/server/types.py | 1 | CODE | |
| LOW | llama_cpp/server/model.py | 1 | CODE | |
| LOW | llama_cpp/server/cli.py | 1 | CODE | |
| LOW | llama_cpp/server/settings.py | 1 | CODE | |
| LOW | llama_cpp/server/app.py | 1 | CODE | |
| LOW | llama_cpp/server/errors.py | 1 | CODE | |
| LOW | llama_cpp/server/errors.py | 6 | CODE | |
| LOW | llama_cpp/server/errors.py | 6 | CODE | |
| LOW | llama_cpp/server/__main__.py | 25 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | llama_cpp/llama.py | 123 | Load a llama.cpp model from `model_path`. Examples: Basic usage >>> import llama_cpp | STRING |
| HIGH | llama_cpp/llama.py | 598 | Tokenize a string. Args: text: The utf-8 encoded string to tokenize. add_bos: Whether t | STRING |
| HIGH | llama_cpp/llama.py | 868 | Create a generator of tokens from a prompt. Examples: >>> llama = Llama("models/ggml-7b.bin") | STRING |
| HIGH | llama_cpp/llama.py | 1836 | Generate text from a prompt. Args: prompt: The prompt to generate text from. suffix: A | STRING |
| HIGH | llama_cpp/llama.py | 1933 | Generate text from a prompt. Args: prompt: The prompt to generate text from. suffix: A | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | docker/open_llama/hug_model.py | 44 | # Creating a symbolic link from destination to "model.bin" | COMMENT |
| MEDIUM | docker/open_llama/hug_model.py | 74 | # Create an argument parser | COMMENT |
| MEDIUM | docker/open_llama/hug_model.py | 92 | # Define the parameters | COMMENT |
| MEDIUM | scripts/releases-to-pep-503.sh | 33 | # Create an index html file | COMMENT |
| MEDIUM | scripts/releases-to-pep-503.sh | 49 | # Create an index html file in llama-cpp-python directory | COMMENT |
| MEDIUM | llama_cpp/llama_chat_format.py | 3160 | """This method is no longer used in the new implementation.""" | STRING |
| MEDIUM | llama_cpp/_internals.py | 635 | # This method is deprecated in favor of using LlamaSampler directly | COMMENT |
| MEDIUM | llama_cpp/_internals.py | 874 | # Create a new wrapper around the cloned sampler | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | docker/open_llama/hug_model.py | 135 | print("Error - model choice was None") | CODE |
| MEDIUM | examples/server/server.py | 3273 | def resolve_model_path(self) -> str: | CODE |
| LOW | examples/server/server.py | 9349 | except Exception: | CODE |
| LOW | examples/server/server.py | 10829 | except Exception: | CODE |
| LOW | examples/server/server.py | 12461 | except Exception: | CODE |
| LOW | examples/server/server.py | 12480 | except Exception: # noqa: BLE001 | CODE |
| LOW | examples/server/server.py | 13208 | except Exception: # noqa: BLE001 | CODE |
| LOW | examples/server/server.py | 13282 | except Exception: # noqa: BLE001 | CODE |
| LOW | examples/server/server.py | 13331 | except Exception: # noqa: BLE001 | CODE |
| LOW | examples/server/server.py | 16229 | except Exception: | CODE |
| LOW | examples/server/server.py | 3194 | except Exception: | STRING |
| LOW | examples/server/server.py | 3232 | except Exception as exc: | STRING |
| LOW | examples/server/server.py | 3244 | except Exception: | STRING |
| LOW | examples/server/server.py | 3303 | except Exception as exc: | STRING |
| LOW | llama_cpp/llama_chat_format.py | 718 | except Exception as e: | CODE |
| LOW | llama_cpp/llama_chat_format.py | 1011 | except Exception as e: | CODE |
| LOW | llama_cpp/llama_chat_format.py | 1738 | except Exception as e: | CODE |
| LOW | llama_cpp/llama_chat_format.py | 2095 | except Exception as e: | CODE |
| LOW | llama_cpp/llama_chat_format.py | 3085 | except Exception as e: | CODE |
| LOW | llama_cpp/llama_chat_format.py | 3619 | except Exception as e: | CODE |
| LOW | llama_cpp/llama_chat_format.py | 4314 | except Exception as e: | CODE |
| LOW | llama_cpp/llama_chat_format.py | 4433 | except Exception as e: | CODE |
| LOW | llama_cpp/llama.py | 487 | except Exception as e: | CODE |
| LOW | llama_cpp/_ctypes_extensions.py | 93 | except Exception as e: | CODE |
| LOW | llama_cpp/_ctypes_extensions.py | 103 | except Exception as e: | CODE |
| LOW | llama_cpp/llama_grammar.py | 33 | except Exception as err: | CODE |
| LOW | llama_cpp/server/errors.py | 180 | except Exception as exc: | CODE |
| LOW | llama_cpp/server/errors.py | 198 | except Exception: | CODE |
| LOW | llama_cpp/server/__main__.py | 80 | except Exception as e: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | examples/server/server.py | 1 | #!/usr/bin/env -S uv run --script | COMMENT |
| LOW | llama_cpp/llama_cpp.py | 61 | # GGML_TYPE_Q4_0 = 2, | COMMENT |
| LOW | llama_cpp/llama_cpp.py | 81 | # GGML_TYPE_IQ2_S = 22, | COMMENT |
| LOW | llama_cpp/llama_cpp.py | 201 | llama_token_p = ctypes.POINTER(llama_token) | COMMENT |
| LOW | llama_cpp/llama_cpp.py | 241 | # LLAMA_VOCAB_PRE_TYPE_MPT = 5, | COMMENT |
| LOW | llama_cpp/llama_cpp.py | 261 | # LLAMA_VOCAB_PRE_TYPE_EXAONE = 25, | COMMENT |
| LOW | llama_cpp/llama_cpp.py | 341 | LLAMA_TOKEN_TYPE_CONTROL = 3 | COMMENT |
| LOW | llama_cpp/llama_cpp.py | 381 | # // LLAMA_FTYPE_MOSTLY_Q4_3 = 6, // support has been removed | COMMENT |
| LOW | llama_cpp/llama_cpp.py | 401 | # LLAMA_FTYPE_MOSTLY_IQ3_S = 26, // except 1d tensors | COMMENT |
| LOW | llama_cpp/llama_cpp.py | 461 | # enum llama_rope_scaling_type { | COMMENT |
| LOW | llama_cpp/llama_cpp.py | 501 | # enum llama_flash_attn_type { | COMMENT |
| LOW | llama_cpp/llama_cpp.py | 601 | # // | COMMENT |
| LOW | llama_cpp/llama_cpp.py | 661 | # enum llama_model_kv_override_type { | COMMENT |
| LOW | llama_cpp/llama_cpp.py | 781 | # ggml_backend_buffer_type_t buft; | COMMENT |
| LOW | llama_cpp/llama_cpp.py | 801 | # // Called with a progress value between 0.0 and 1.0. Pass NULL to disable. | COMMENT |
| LOW | llama_cpp/llama_cpp.py | 901 | COMMENT | |
| LOW | llama_cpp/llama_cpp.py | 921 | # float rope_freq_base; // RoPE base frequency, 0 = from model | COMMENT |
| LOW | llama_cpp/llama_cpp.py | 941 | COMMENT | |
| LOW | llama_cpp/llama_cpp.py | 1101 | # enum ggml_type output_tensor_type; // output tensor type | COMMENT |
| LOW | llama_cpp/llama_cpp.py | 1301 | COMMENT | |
| LOW | llama_cpp/llama_cpp.py | 1341 | # // Optional: an auto threadpool gets created in ggml if not passed explicitly | COMMENT |
| LOW | llama_cpp/llama_cpp.py | 2221 | COMMENT | |
| LOW | llama_cpp/llama_cpp.py | 2901 | LLAMA_STATE_SEQ_FLAGS_NONE = 0 | COMMENT |
| LOW | llama_cpp/llama_cpp.py | 3021 | COMMENT | |
| LOW | llama_cpp/llama_cpp.py | 3081 | # // Process a batch of tokens. | COMMENT |
| LOW | llama_cpp/llama_cpp.py | 3201 | COMMENT | |
| LOW | llama_cpp/llama_cpp.py | 3981 | # /// @param add_special Allow to add BOS and EOS tokens if model is configured to do so. | COMMENT |
| LOW | llama_cpp/llama_cpp.py | 4081 | # /// @details Convert the provided tokens into text (inverse of llama_tokenize()). | COMMENT |
| LOW | llama_cpp/llama_cpp.py | 4141 | # /// @param n_msg Number of llama_chat_message in this chat | COMMENT |
| LOW | llama_cpp/llama_cpp.py | 4241 | # // user code can implement the interface below in order to create custom llama_sampler | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | tests/test_llama_chat_format.py | 75 | "pad_token": null, | CODE |
| HIGH | llama_cpp/llama_cache.py | 138 | # self.cache.push(_key, side="front") # type: ignore | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/get-releases.sh | 20 | # Check if the response is valid JSON | COMMENT |
| LOW | scripts/releases-to-pep-503.sh | 24 | # Check if all_releases.txt exists | COMMENT |
| LOW | .github/workflows/build-wheels-cuda.yaml | 272 | # Set tag_name to <tag>-cu<cuda_version>. | COMMENT |
| LOW | llama_cpp/llama_chat_format.py | 2818 | # Check if vision is supported | COMMENT |
| LOW | llama_cpp/llama.py | 1468 | # Check if stop sequence is in the token | COMMENT |
| LOW | llama_cpp/server/app.py | 110 | # Check if yaml file | COMMENT |
| LOW | llama_cpp/server/__main__.py | 63 | # Check if yaml file | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | examples/server/server.py | 11235 | CODE | |
| LOW | llama_cpp/llama_chat_format.py | 1461 | CODE | |
| LOW | llama_cpp/llama_chat_format.py | 1824 | CODE | |
| LOW | llama_cpp/llama_chat_format.py | 4131 | CODE | |
| LOW | llama_cpp/llama_chat_format.py | 69 | CODE | |
| LOW | llama_cpp/llama_chat_format.py | 613 | CODE | |
| LOW | llama_cpp/llama_chat_format.py | 2852 | CODE | |
| LOW | llama_cpp/llama_chat_format.py | 3402 | CODE | |
| LOW | llama_cpp/llama.py | 60 | CODE | |
| LOW | llama_cpp/llama.py | 697 | CODE | |
| LOW | llama_cpp/llama.py | 785 | CODE | |
| LOW | llama_cpp/llama.py | 847 | CODE | |
| LOW | llama_cpp/llama.py | 1188 | CODE | |
| LOW | llama_cpp/llama.py | 1808 | CODE | |
| LOW | llama_cpp/llama.py | 1905 | CODE | |
| LOW | llama_cpp/llama.py | 1997 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | README.md | 310 | # n_ctx=2048, # Uncomment to increase the context window | COMMENT |
| MEDIUM | README.md | 314 | max_tokens=32, # Generate up to 32 tokens, set to None to generate up to the end of the context window | CODE |
| MEDIUM | llama_cpp/llama.py | 1346 | # Truncate max_tokens if requested tokens would exceed the context window | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | llama_cpp/llama_types.py | 300 | # NOTE: The following type names are not part of the OpenAI OpenAPI specification | COMMENT |
| LOW | llama_cpp/llama_cpp.py | 4138 | # /// NOTE: This function does not use a jinja parser. It only support a pre-defined list of template. See more: https:/ | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | llama_cpp/llama_cpp.py | 2998 | # // NOTE: this is a helper function to facilitate transition to the new batch API - avoid using it | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | examples/server/server.py | 12176 | def set_draft_processing_enabled(self, enabled: bool) -> None: | CODE |
| LOW | examples/server/server.py | 1201 | def set_target_processing_enabled(self, enabled: bool) -> None: | STRING |
| LOW | examples/server/server.py | 1398 | def set_target_processing_enabled(self, enabled: bool) -> None: | STRING |
| LOW | examples/server/server.py | 1461 | def _set_nextn_layer_offset(self, offset: int) -> None: | STRING |