Repository Analysis

guidance-ai/guidance

A guidance language for controlling large language models.

19.3 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of guidance-ai/guidance, a Jupyter Notebook project with 21,661 GitHub stars. SynthScan v2.0 examined 35,924 lines of code across 228 source files, recording 578 pattern matches distributed across 16 syntactic categories. The overall adjusted score of 19.3 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).

19.3
Adjusted Score
19.3
Raw Score
100%
Time Factor
2026-05-21
Last Push
21.7K
Stars
Jupyter Notebook
Language
35.9K
Lines of Code
228
Files
578
Pattern Hits
2026-07-14
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 9MEDIUM 32LOW 537

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 578 distinct pattern matches across 16 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 Identifiers217 hits · 214 pts
SeverityFileLineSnippetContext
LOWREADME.md175def zero_shot_multiple_choice(STRING
LOWguidance/_ast.py217 def is_allowed_in_lark_terminal(self) -> bool:CODE
LOWguidance/_ast.py225 def is_allowed_in_lark_rule_with_attrs(self) -> bool:CODE
LOWguidance/_ast.py348 def is_allowed_in_lark_terminal(self) -> bool:CODE
LOWguidance/_ast.py352 def is_allowed_in_lark_rule_with_attrs(self) -> bool:CODE
LOWguidance/_ast.py450 def is_allowed_in_lark_terminal(self) -> bool:CODE
LOWguidance/_ast.py489 def is_allowed_in_lark_terminal(self) -> bool:CODE
LOWguidance/_ast.py519 def is_allowed_in_lark_terminal(self) -> bool:CODE
LOWguidance/_ast.py533 def is_allowed_in_lark_terminal(self) -> bool:CODE
LOWguidance/_ast.py537 def is_allowed_in_lark_rule_with_attrs(self) -> bool:CODE
LOWguidance/_uri_validation.py66def _validate_hostname_not_private(hostname: str, original_url: str) -> None:CODE
LOWguidance/chat.py83def _template_class_from_string(template_str):CODE
LOWguidance/_utils.py128def strip_multiline_string_indents(f):CODE
LOWguidance/_utils.py423def apply_top_k_and_top_p_filter(logits: np.ndarray, sampling_params: Optional["SamplingParams"]) -> np.ndarray:CODE
LOWguidance/models/_mock.py94 def get_next_token_with_top_k(CODE
LOWguidance/models/_openai_base.py217 def streaming_chat_completions(CODE
LOWguidance/models/_openai_base.py232 def streaming_chat_completions(CODE
LOWguidance/models/_azureai.py76def create_azure_openai_model(CODE
LOWguidance/models/_azureai.py162 def streaming_chat_completions(CODE
LOWguidance/models/_azureai.py220def create_azure_aifoundry_model(CODE
LOWguidance/models/_transformers.py179 def _byte_tokens_from_byte_decoder(CODE
LOWguidance/models/_transformers.py194 def _byte_tokens_from_sp_model(CODE
LOWguidance/models/_transformers.py217 def _byte_tokens_by_encoding_token_strings(CODE
LOWguidance/models/_transformers.py278 def check_byte_decoder_has_all_bytes() -> None:CODE
LOWguidance/models/_transformers.py287 def check_byte_decoder_complex_round_trip() -> None:CODE
LOWguidance/models/experimental/_litellm.py46 def streaming_chat_completions(CODE
LOWguidance/models/_engine/_engine.py542 def get_next_token_with_top_k(CODE
LOWguidance/models/_engine/_engine.py659 def chat_completion_streaming(CODE
LOWguidance/models/_engine/_engine.py732def apply_temp_and_sampling_params(CODE
LOWguidance/models/_base/_model.py192 def _update_open_block_captures(self) -> Self:CODE
LOWguidance/_bg/__init__.py20def _asyncio_background_thread() -> tuple[threading.Thread, AbstractEventLoop]:CODE
LOWtests/tokenizer_common.py37 def base_eos_bos_token_round_trip(self, model_name: str):CODE
LOWtests/utils.py114def check_match_success_with_guards(grammar, test_string: str):CODE
LOWtests/utils.py194def check_run_with_temperature(lm: models.Model, desired_temperature: float):CODE
LOWtests/unit/test_parser.py17def test_zero_or_more_and_one_or_more():CODE
LOWtests/unit/test_parser.py34def test_zero_or_more_and_one_or_more_mixed():CODE
LOWtests/unit/test_parser.py117def test_char_set_one_or_more():CODE
LOWtests/unit/test_model.py58def test_step_every_k_injection():CODE
LOWtests/unit/test_model.py84def test_step_stop_token_trigger_injection():CODE
LOWtests/unit/test_grammar.py24def test_select_ambiguous_lexeme_boundary():CODE
LOWtests/unit/test_grammar.py33def test_select_ambiguous_lexeme_boundary_manual_fix():STRING
LOWtests/unit/test_grammar.py50def test_grammar_plus_fstring():CODE
LOWtests/unit/test_grammar.py82 def test_multiple_mutual_recursion(self):CODE
LOWtests/unit/test_grammar.py99 def test_branching_mutual_recursion(self):CODE
LOWtests/unit/test_grammar.py140 def test_raises_on_incomplete_input(self):CODE
LOWtests/unit/test_uri_validation.py11 def test_https_allowed_by_default(self):CODE
LOWtests/unit/test_uri_validation.py16 def test_http_blocked_by_default(self):CODE
LOWtests/unit/test_uri_validation.py20 def test_ftp_blocked_by_default(self):CODE
LOWtests/unit/test_uri_validation.py24 def test_http_allowed_when_configured(self):CODE
LOWtests/unit/test_uri_validation.py28 def test_custom_scheme_allowed(self):CODE
LOWtests/unit/test_uri_validation.py32 def test_scheme_check_is_case_insensitive(self):CODE
LOWtests/unit/test_uri_validation.py38 def test_file_uri_blocked_when_allow_local_false(self):CODE
LOWtests/unit/test_uri_validation.py42 def test_file_uri_allowed_when_allow_local_true(self):CODE
LOWtests/unit/test_uri_validation.py46 def test_file_uri_not_subject_to_scheme_allowlist(self):CODE
LOWtests/unit/test_uri_validation.py105 def test_ip_literal_in_url_blocked(self):CODE
LOWtests/unit/test_uri_validation.py118 def test_dns_resolution_failure_raises(self):CODE
LOWtests/unit/test_uri_validation.py129 def test_all_resolved_addresses_checked(self):CODE
LOWtests/unit/test_bytes_from.py12 def test_blocks_http_by_default(self):CODE
LOWtests/unit/test_bytes_from.py16 def test_allows_http_when_configured(self):CODE
LOWtests/unit/test_bytes_from.py24 def test_blocks_private_ip_by_default(self):CODE
157 more matches not shown…
Unused Imports119 hits · 114 pts
SeverityFileLineSnippetContext
LOWguidance/_tools.py11CODE
LOWguidance/__init__.py8CODE
LOWguidance/__init__.py11CODE
LOWguidance/_ast.py31CODE
LOWguidance/_ast.py31CODE
LOWguidance/_parser.py13CODE
LOWguidance/_utils.py21CODE
LOWguidance/metrics/__init__.py3CODE
LOWguidance/metrics/__init__.py3CODE
LOWguidance/metrics/__init__.py3CODE
LOWguidance/trace/__init__.py9CODE
LOWguidance/trace/__init__.py9CODE
LOWguidance/trace/__init__.py9CODE
LOWguidance/trace/__init__.py9CODE
LOWguidance/trace/__init__.py9CODE
LOWguidance/trace/__init__.py9CODE
LOWguidance/trace/__init__.py9CODE
LOWguidance/trace/__init__.py9CODE
LOWguidance/trace/__init__.py9CODE
LOWguidance/trace/__init__.py9CODE
LOWguidance/trace/__init__.py9CODE
LOWguidance/trace/__init__.py9CODE
LOWguidance/trace/__init__.py9CODE
LOWguidance/trace/__init__.py9CODE
LOWguidance/trace/__init__.py9CODE
LOWguidance/trace/__init__.py9CODE
LOWguidance/trace/__init__.py9CODE
LOWguidance/trace/__init__.py9CODE
LOWguidance/trace/__init__.py9CODE
LOWguidance/trace/__init__.py9CODE
LOWguidance/library/__init__.py3CODE
LOWguidance/library/__init__.py3CODE
LOWguidance/library/__init__.py3CODE
LOWguidance/library/__init__.py3CODE
LOWguidance/library/__init__.py3CODE
LOWguidance/library/__init__.py4CODE
LOWguidance/library/__init__.py4CODE
LOWguidance/library/__init__.py7CODE
LOWguidance/library/__init__.py8CODE
LOWguidance/library/__init__.py9CODE
LOWguidance/library/__init__.py9CODE
LOWguidance/library/__init__.py10CODE
LOWguidance/library/__init__.py10CODE
LOWguidance/library/__init__.py11CODE
LOWguidance/library/__init__.py11CODE
LOWguidance/library/__init__.py12CODE
LOWguidance/library/__init__.py13CODE
LOWguidance/library/__init__.py14CODE
LOWguidance/library/__init__.py14CODE
LOWguidance/library/__init__.py14CODE
LOWguidance/library/__init__.py14CODE
LOWguidance/library/__init__.py17CODE
LOWguidance/library/__init__.py17CODE
LOWguidance/library/__init__.py17CODE
LOWguidance/library/__init__.py17CODE
LOWguidance/library/__init__.py17CODE
LOWguidance/library/__init__.py18CODE
LOWguidance/library/__init__.py19CODE
LOWguidance/library/__init__.py19CODE
LOWguidance/library/_subgrammar.py2CODE
59 more matches not shown…
Over-Commented Block94 hits · 93 pts
SeverityFileLineSnippetContext
LOWguidance/models/broken_models/_lite_llm.py1# import tiktokenCOMMENT
LOWguidance/models/broken_models/_lite_llm.py21# "Please install the litellm package version >= 1.7 using `pip install litellm -U` in order to use guidCOMMENT
LOWguidance/models/broken_models/_lite_llm.py41# )COMMENT
LOWguidance/models/broken_models/_lite_llm.py61COMMENT
LOWguidance/models/broken_models/_lite_llm.py81COMMENT
LOWguidance/models/broken_models/_lite_llm.py101# n=1,COMMENT
LOWguidance/models/broken_models/_lite_llm.py121# else:COMMENT
LOWguidance/models/broken_models/_lite_llm.py141# raise Exception(COMMENT
LOWguidance/models/broken_models/_lite_llm.py161# except Exception as e: # TODO: add retry logicCOMMENT
LOWguidance/models/broken_models/_lite_llm.py181# messages = []COMMENT
LOWguidance/models/broken_models/_lite_llm.py201# pos += end_pos + len(role_end)COMMENT
LOWguidance/models/broken_models/_lite_llm.py221# except Exception as e: # TODO: add retry logicCOMMENT
LOWguidance/models/broken_models/_cohere.py1# from ._lite_llm import LiteLLMEngine, LiteLLM, LiteLLMCompletion, LiteLLMInstructCOMMENT
LOWguidance/models/broken_models/_cohere.py21COMMENT
LOWguidance/models/broken_models/_cohere.py41# class CohereCompletion(Cohere, LiteLLMCompletion):COMMENT
LOWguidance/models/broken_models/_azure_openai.py1# import pathlibCOMMENT
LOWguidance/models/broken_models/_azure_openai.py21# """Represents an Azure OpenAI model as exposed through their remote API.COMMENT
LOWguidance/models/broken_models/_azure_openai.py41# max_streaming_tokens: int = 1000,COMMENT
LOWguidance/models/broken_models/_azure_openai.py61# if not is_openai or not hasattr(openai_package, "OpenAI"):COMMENT
LOWguidance/models/broken_models/_azure_openai.py81COMMENT
LOWguidance/models/broken_models/_azure_openai.py101# engine_instance,COMMENT
LOWguidance/models/broken_models/_googleai.py1# import reCOMMENT
LOWguidance/models/broken_models/_googleai.py21# model,COMMENT
LOWguidance/models/broken_models/_googleai.py41# genai.configure(api_key=api_key)COMMENT
LOWguidance/models/broken_models/_googleai.py61# timeout=0.5,COMMENT
LOWguidance/models/broken_models/_googleai.py81COMMENT
LOWguidance/models/broken_models/_googleai.py101# engine=engine_map[self.__class__](COMMENT
LOWguidance/models/broken_models/_googleai.py121# assistant_start = b"<|im_start|>assistant\n"COMMENT
LOWguidance/models/broken_models/_googleai.py141# end_pos = prompt[pos:].find(role_end)COMMENT
LOWguidance/models/broken_models/_googleai.py161# )COMMENT
LOWguidance/models/broken_models/_googleai.py181COMMENT
LOWguidance/models/broken_models/_googleai.py201# formated_messages = []COMMENT
LOWguidance/models/broken_models/_googleai.py221# formated_messages.append(Content(role=m["role"], parts=parts))COMMENT
LOWguidance/models/broken_models/_googleai.py241# class GoogleAIChat(GoogleAI, Chat):COMMENT
LOWguidance/models/broken_models/_Gemini.py1# import osCOMMENT
LOWguidance/models/broken_models/_Gemini.py21COMMENT
LOWguidance/models/broken_models/_Gemini.py41# is_vertexai = TrueCOMMENT
LOWguidance/models/broken_models/_Gemini.py61# # caching=caching,COMMENT
LOWguidance/models/broken_models/_Gemini.py81# # tokenizer=tokenizer,COMMENT
LOWguidance/models/broken_models/_Gemini.py101# # the superclass does all the workCOMMENT
LOWguidance/models/broken_models/_Gemini.py121# # last_user_text = messages[-1]["content"]COMMENT
LOWguidance/models/broken_models/_Gemini.py141COMMENT
LOWguidance/models/broken_models/_anthropic.py1# import osCOMMENT
LOWguidance/models/broken_models/_anthropic.py21# except ModuleNotFoundError:COMMENT
LOWguidance/models/broken_models/_anthropic.py41# except:COMMENT
LOWguidance/models/broken_models/_anthropic.py61# ("assistant", b"<|im_start|>assistant\n"),COMMENT
LOWguidance/models/broken_models/_anthropic.py81COMMENT
LOWguidance/models/broken_models/_anthropic.py101# temperature=temperature,COMMENT
LOWguidance/models/broken_models/_anthropic.py121# there are some things we cannot do, like force the model to follow a pattern insideCOMMENT
LOWguidance/models/broken_models/_anthropic.py141# tokenizer=tokenizer,COMMENT
LOWguidance/models/broken_models/_azureai_studio.py1# import hashlibCOMMENT
LOWguidance/models/broken_models/_azureai_studio.py21# class AzureAIStudioChatEngine(GrammarlessEngine):COMMENT
LOWguidance/models/broken_models/_azureai_studio.py41# "Detected OpenAI compatible model; please install openai package"COMMENT
LOWguidance/models/broken_models/_azureai_studio.py61COMMENT
LOWguidance/models/broken_models/_azureai_studio.py81# found = TrueCOMMENT
LOWguidance/models/broken_models/_azureai_studio.py101# message_content = btext.decode("utf8")COMMENT
LOWguidance/models/broken_models/_azureai_studio.py121# cache_key = self._hash_prompt(prompt)COMMENT
LOWguidance/models/broken_models/_azureai_studio.py141COMMENT
LOWguidance/models/broken_models/_azureai_studio.py161# response_score = requests.post(COMMENT
LOWguidance/models/broken_models/_azureai_studio.py181# yield encoded_chunkCOMMENT
34 more matches not shown…
Decorative Section Separators22 hits · 69 pts
SeverityFileLineSnippetContext
MEDIUMguidance/chat.py91# --------------------------------------------------COMMENT
MEDIUMguidance/chat.py93# --------------------------------------------------COMMENT
MEDIUMguidance/chat.py111# --------------------------------------------------COMMENT
MEDIUMguidance/chat.py113# --------------------------------------------------COMMENT
MEDIUMguidance/chat.py146# --------------------------------------------------COMMENT
MEDIUMguidance/chat.py148# --------------------------------------------------COMMENT
MEDIUMguidance/chat.py173# --------------------------------------------------COMMENT
MEDIUMguidance/chat.py175# --------------------------------------------------COMMENT
MEDIUMguidance/chat.py230# --------------------------------------------------COMMENT
MEDIUMguidance/chat.py232# --------------------------------------------------COMMENT
MEDIUMguidance/chat.py251# --------------------------------------------------COMMENT
MEDIUMguidance/chat.py253# --------------------------------------------------COMMENT
MEDIUMguidance/chat.py285# --------------------------------------------------COMMENT
MEDIUMguidance/chat.py287# --------------------------------------------------COMMENT
MEDIUMguidance/chat.py317# --------------------------------------------------COMMENT
MEDIUMguidance/chat.py319# --------------------------------------------------COMMENT
MEDIUMguidance/chat.py345# --------------------------------------------------COMMENT
MEDIUMguidance/chat.py347# --------------------------------------------------COMMENT
MEDIUMguidance/chat.py371# --------------------------------------------------COMMENT
MEDIUMguidance/chat.py373# --------------------------------------------------COMMENT
MEDIUMguidance/models/broken_models/_azure_openai.py49# ----------COMMENT
MEDIUMguidance/models/broken_models/_azureai_studio.py214# ----------COMMENT
Self-Referential Comments10 hits · 34 pts
SeverityFileLineSnippetContext
MEDIUMguidance/models/_openai_base.py484 # Create an in-memory WAV fileCOMMENT
MEDIUMguidance/models/_transformers.py405 # Create the tokenizerSTRING
MEDIUMguidance/models/_base/_model.py368 # Define the target function for the threadCOMMENT
MEDIUMtests/unit/test_decorator.py407 # Create a weak reference to the objectCOMMENT
MEDIUMtests/unit/test_decorator.py420 # Create a weak reference to the objectCOMMENT
MEDIUMtests/unit/test_decorator.py433 # Create a weak reference to the objectCOMMENT
MEDIUMtests/unit/test_decorator.py435 # Create a weak reference to the cached methodCOMMENT
MEDIUMdocs/conf.py7# This file is execfile()d with the current directory set to itsCOMMENT
MEDIUMscripts/extract_python_from_readme.py18 # This function contains 95% CoPilot vibes by volumeCOMMENT
MEDIUMpackages/python/stitch/docs/source/conf.py6# This file is execfile()d with the current directory set to itsCOMMENT
Deep Nesting32 hits · 32 pts
SeverityFileLineSnippetContext
LOWguidance/_schema.py184CODE
LOWguidance/_grammar.py61CODE
LOWguidance/_ast.py682CODE
LOWguidance/_parser.py324CODE
LOWguidance/_guidance.py129CODE
LOWguidance/_guidance.py140CODE
LOWguidance/metrics/_metrics.py126CODE
LOWguidance/trace/_trace.py357CODE
LOWguidance/library/_json.py13CODE
LOWguidance/library/_substring.py11CODE
LOWguidance/models/_mock.py117CODE
LOWguidance/models/_openai_base.py168CODE
LOWguidance/models/_openai_base.py336CODE
LOWguidance/models/_llama_cpp.py81CODE
LOWguidance/models/_transformers.py217CODE
LOWguidance/models/_transformers.py444CODE
LOWguidance/models/broken_models/_vertexai.py21CODE
LOWguidance/models/broken_models/_vertexai.py174CODE
LOWguidance/models/experimental/_sglang.py99CODE
LOWguidance/models/experimental/_litellm.py209CODE
LOWguidance/models/experimental/_vllm.py29CODE
LOWguidance/models/_engine/_engine.py94CODE
LOWguidance/models/_engine/_interpreter.py65CODE
LOWguidance/models/_base/_model.py115CODE
LOWguidance/models/_base/_model.py161CODE
LOWguidance/models/_base/_model.py361CODE
LOWguidance/visual/_renderer.py199CODE
LOWguidance/visual/_renderer.py329CODE
LOWguidance/visual/_renderer.py524CODE
LOWguidance/visual/_renderer.py541CODE
LOWguidance/visual/_trace.py17CODE
LOWtests/unit/test_ll.py62CODE
Cross-File Repetition6 hits · 30 pts
SeverityFileLineSnippetContext
HIGHguidance/models/_llama_cpp.py0computes the logits for the given token state. this overrides a method from the localengine class that is used to get inSTRING
HIGHguidance/models/_transformers.py0computes the logits for the given token state. this overrides a method from the localengine class that is used to get inSTRING
HIGHguidance/models/_onnxruntime.py0computes the logits for the given token state. this overrides a method from the localengine class that is used to get inSTRING
HIGHtests/model_specific/test_onnxruntime_genai.py0tweak this proverb to apply to model instructions instead. {gen("verse", max_tokens=2)}STRING
HIGHtests/model_specific/test_transformers.py0tweak this proverb to apply to model instructions instead. {gen("verse", max_tokens=2)}STRING
HIGHtests/model_specific/llama_cpp_tests/test_llama_cpp.py0tweak this proverb to apply to model instructions instead. {gen("verse", max_tokens=2)}STRING
Redundant / Tautological Comments18 hits · 29 pts
SeverityFileLineSnippetContext
LOWguidance/debug.py27 # Check if the auto renderer has a JupyterWidgetRenderer insideCOMMENT
LOWguidance/debug.py53 # Check if the auto renderer has a JupyterWidgetRenderer insideCOMMENT
LOWguidance/debug.py81 # Check if the auto renderer has a JupyterWidgetRenderer insideCOMMENT
LOWguidance/models/_transformers.py299 # Check if the tokenizer has a bos_token attribute, and if it does, checkCOMMENT
LOWguidance/models/broken_models/_azureai_studio.py123# # Check if the result is already in the cacheCOMMENT
LOWguidance/models/_engine/_engine.py315 # Check if the accumulated text ends with any stop stringCOMMENT
LOWguidance/models/_engine/_engine.py357 # Check if we've accumulated enough to match the stop stringCOMMENT
LOWguidance/models/_engine/_engine.py426 # Set flag to indicate this is an injection backtrackCOMMENT
LOWguidance/models/_engine/_engine.py474 # Set flag to indicate this is an injection backtrackCOMMENT
LOWguidance/models/_engine/_interpreter.py87 # Check if this is an injection backtrack (should happen before adding text)COMMENT
LOWguidance/models/_base/_model.py181 # Set start_index to the current lengthCOMMENT
LOWguidance/models/_base/_model.py392 # Check if the thread is still aliveCOMMENT
LOWguidance/visual/_renderer.py482 # Check if message has diverged from prev messagesCOMMENT
LOWguidance/visual/_trace.py32 # Check if any input is a role opener or closerCOMMENT
LOWguidance/visual/_trace.py93 # Check if any input in active role is a RoleCloserInputCOMMENT
LOWtests/unit/test_decorator.py415 # Check if the object was garbage collectedCOMMENT
LOWtests/unit/test_decorator.py428 # Check if the object was garbage collectedCOMMENT
LOWtests/unit/test_decorator.py444 # Check if the object was garbage collectedCOMMENT
Modern Structural Boilerplate29 hits · 29 pts
SeverityFileLineSnippetContext
LOWguidance/_topics.py19__all__ = [CODE
LOWguidance/__init__.py13__all__ = [CODE
LOWguidance/_ast.py512 def set_target(self, target: RuleNode) -> None:CODE
LOWguidance/debug.py8logger = logging.getLogger(__name__)CODE
LOWguidance/_utils.py23logger = logging.getLogger(__name__)CODE
LOWguidance/metrics/_metrics.py16logger = logging.getLogger(__name__)CODE
LOWguidance/metrics/__init__.py5__all__ = [CODE
LOWguidance/trace/__init__.py32__all__ = [CODE
LOWguidance/trace/_trace.py12logger = logging.getLogger(__name__)CODE
LOWguidance/library/__init__.py21__all__ = [CODE
LOWguidance/library/_subgrammar.py4__all__ = ["as_regular_grammar", "lexeme", "regex", "subgrammar"]CODE
LOWguidance/library/_gen.py10logger = logging.getLogger(__name__)CODE
LOWguidance/models/_mock.py11logger = logging.getLogger(__name__)CODE
LOWguidance/models/_llama_cpp.py30logger = logging.getLogger(__name__)CODE
LOWguidance/models/__init__.py10__all__ = [CODE
LOWguidance/models/_azureai.py27logger = logging.getLogger(__name__)CODE
LOWguidance/models/experimental/__init__.py5__all__ = ["LiteLLM", "SglangModel", "VLLMModel"]CODE
LOWguidance/models/_engine/__init__.py6__all__ = [CODE
LOWguidance/models/_engine/_engine.py27logger = logging.getLogger(__name__)CODE
LOWguidance/models/_base/__init__.py5__all__ = [CODE
LOWguidance/visual/_exchange.py11logger = logging.getLogger(__name__)CODE
LOWguidance/visual/_exchange.py70__all__ = ["TopicExchange"]CODE
LOWguidance/visual/__init__.py23__all__ = [CODE
LOWguidance/visual/_renderer.py53logger = logging.getLogger(__name__)CODE
LOWguidance/visual/_jupyter.py12logger = logging.getLogger(__name__)CODE
LOWguidance/registry/__init__.py5__all__ = [CODE
LOWguidance/registry/_registry.py82def set_renderer(renderer: Renderer) -> None:CODE
LOWpackages/python/stitch/docs/source/conf.py203logger = logging.getLogger(__name__)CODE
LOWpackages/python/stitch/stitch/__init__.py10__all__ = ["StitchWidget", "__version__", "_jupyter_labextension_paths", "_jupyter_nbextension_paths", "version_info"]CODE
Cross-Language Confusion3 hits · 20 pts
SeverityFileLineSnippetContext
HIGHtests/unit/library/json/test_allOf.py352 # valid: foo is null, bar is equal to 5, baz is nullCOMMENT
HIGHtests/unit/library/json/test_allOf.py443 # valid: foo is null, bar is equal to 5, baz is nullCOMMENT
HIGHpackages/python/stitch/stitch/tests/conftest.py43 _widget_attrs["_comm_default"] = getattr(Widget, "_comm_default", undefined)CODE
Excessive Try-Catch Wrapping10 hits · 10 pts
SeverityFileLineSnippetContext
LOWguidance/metrics/_metrics.py93 except Exception as e: # noqa BLE001CODE
LOWguidance/metrics/_metrics.py141 except Exception as e: # noqa BLE001CODE
LOWguidance/metrics/_metrics.py177 except Exception as e:CODE
LOWguidance/models/_transformers.py310 except Exception as e:CODE
LOWguidance/models/broken_models/_vertexai.py132 except Exception as e: # TODO: add retry logicCODE
LOWguidance/visual/_renderer.py153 except Exception: # noqa: BLE001CODE
LOWguidance/visual/_renderer.py195 except Exception as _: # noqa: BLE001CODE
LOWguidance/visual/_renderer.py237 except Exception as _: # noqa: BLE001CODE
LOWtests/unit/test_visual.py82 except Exception as e:CODE
LOWtests/model_specific/test_visual.py51 except Exception as e:CODE
AI Structural Patterns9 hits · 9 pts
SeverityFileLineSnippetContext
LOWguidance/_grammar.py27CODE
LOWguidance/_utils.py314CODE
LOWguidance/_utils.py331CODE
LOWguidance/library/_json.py13CODE
LOWguidance/library/_gen.py13CODE
LOWguidance/models/_azureai.py76CODE
LOWguidance/models/_azureai.py276CODE
LOWguidance/models/_transformers.py582CODE
LOWguidance/models/_onnxruntime.py31CODE
Fake / Example Data4 hits · 4 pts
SeverityFileLineSnippetContext
LOWguidance/resources/graphpaper-inline.html29/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla PubCOMMENT
LOWtests/model_specific/test_transformers.py35 big_opts = ["Lorem ipsum dolor sit amet", "Duis aute irure dolor "]CODE
LOWtests/model_specific/test_transformers.py35 big_opts = ["Lorem ipsum dolor sit amet", "Duis aute irure dolor "]CODE
LOWtests/model_integration/library/test_subgrammar.py62 lm += "John Doe's name, age, and birthday:\n"CODE
AI Slop Vocabulary2 hits · 3 pts
SeverityFileLineSnippetContext
LOWguidance/models/_transformers.py127 # (that will just add extra spaces during an encode-decode cycle)COMMENT
LOWguidance/models/_engine/_engine.py614 # If we have top_k, we can just return the first oneCOMMENT
Slop Phrases1 hit · 2 pts
SeverityFileLineSnippetContext
LOWguidance/models/broken_models/_lite_llm.py139# # make sure you don't try and instruct the same model twiceCOMMENT
Overly Generic Function Names2 hits · 2 pts
SeverityFileLineSnippetContext
LOWtests/model_integration/test_model.py41 def my_function(lm):STRING
LOWtests/model_integration/test_model.py77 def my_function(lm):CODE