A guidance language for controlling large language models.
This report summarizes scanner evidence for guidance-ai/guidance, a Jupyter Notebook project with 21,787 GitHub stars. SynthScan examined 35,924 lines of code across 228 source files, recording 591 pattern matches distributed across 17 syntactic categories. The legacy adjusted pattern signal is 21.1 (Elevated pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 385 finding(s).
Are imports declared and package/API names verified? 126 finding(s).
Are wrappers, guards, and repeated structures necessary? 306 finding(s).
Which changes need focused human review? 591 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 591 distinct pattern matches across 17 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | README.md | 175 | def zero_shot_multiple_choice( | STRING |
| LOW | guidance/_ast.py | 217 | def is_allowed_in_lark_terminal(self) -> bool: | CODE |
| LOW | guidance/_ast.py | 225 | def is_allowed_in_lark_rule_with_attrs(self) -> bool: | CODE |
| LOW | guidance/_ast.py | 348 | def is_allowed_in_lark_terminal(self) -> bool: | CODE |
| LOW | guidance/_ast.py | 352 | def is_allowed_in_lark_rule_with_attrs(self) -> bool: | CODE |
| LOW | guidance/_ast.py | 450 | def is_allowed_in_lark_terminal(self) -> bool: | CODE |
| LOW | guidance/_ast.py | 489 | def is_allowed_in_lark_terminal(self) -> bool: | CODE |
| LOW | guidance/_ast.py | 519 | def is_allowed_in_lark_terminal(self) -> bool: | CODE |
| LOW | guidance/_ast.py | 533 | def is_allowed_in_lark_terminal(self) -> bool: | CODE |
| LOW | guidance/_ast.py | 537 | def is_allowed_in_lark_rule_with_attrs(self) -> bool: | CODE |
| LOW | guidance/_uri_validation.py | 66 | def _validate_hostname_not_private(hostname: str, original_url: str) -> None: | CODE |
| LOW⚡ | guidance/chat.py | 83 | def _template_class_from_string(template_str): | CODE |
| LOW | guidance/_utils.py | 128 | def strip_multiline_string_indents(f): | CODE |
| LOW | guidance/_utils.py | 423 | def apply_top_k_and_top_p_filter(logits: np.ndarray, sampling_params: Optional["SamplingParams"]) -> np.ndarray: | CODE |
| LOW | guidance/models/_mock.py | 94 | def get_next_token_with_top_k( | CODE |
| LOW | guidance/models/_openai_base.py | 217 | def streaming_chat_completions( | CODE |
| LOW | guidance/models/_openai_base.py | 232 | def streaming_chat_completions( | CODE |
| LOW | guidance/models/_azureai.py | 76 | def create_azure_openai_model( | CODE |
| LOW | guidance/models/_azureai.py | 162 | def streaming_chat_completions( | CODE |
| LOW | guidance/models/_azureai.py | 220 | def create_azure_aifoundry_model( | CODE |
| LOW | guidance/models/_transformers.py | 179 | def _byte_tokens_from_byte_decoder( | CODE |
| LOW | guidance/models/_transformers.py | 194 | def _byte_tokens_from_sp_model( | CODE |
| LOW | guidance/models/_transformers.py | 217 | def _byte_tokens_by_encoding_token_strings( | CODE |
| LOW | guidance/models/_transformers.py | 278 | def check_byte_decoder_has_all_bytes() -> None: | CODE |
| LOW | guidance/models/_transformers.py | 287 | def check_byte_decoder_complex_round_trip() -> None: | CODE |
| LOW | guidance/models/experimental/_litellm.py | 46 | def streaming_chat_completions( | CODE |
| LOW | guidance/models/_engine/_engine.py | 542 | def get_next_token_with_top_k( | CODE |
| LOW | guidance/models/_engine/_engine.py | 659 | def chat_completion_streaming( | CODE |
| LOW | guidance/models/_engine/_engine.py | 732 | def apply_temp_and_sampling_params( | CODE |
| LOW | guidance/models/_base/_model.py | 192 | def _update_open_block_captures(self) -> Self: | CODE |
| LOW | guidance/_bg/__init__.py | 20 | def _asyncio_background_thread() -> tuple[threading.Thread, AbstractEventLoop]: | CODE |
| LOW | tests/tokenizer_common.py | 37 | def base_eos_bos_token_round_trip(self, model_name: str): | CODE |
| LOW | tests/utils.py | 114 | def check_match_success_with_guards(grammar, test_string: str): | CODE |
| LOW | tests/utils.py | 194 | def check_run_with_temperature(lm: models.Model, desired_temperature: float): | CODE |
| LOW | tests/unit/test_parser.py | 17 | def test_zero_or_more_and_one_or_more(): | CODE |
| LOW | tests/unit/test_parser.py | 34 | def test_zero_or_more_and_one_or_more_mixed(): | CODE |
| LOW | tests/unit/test_parser.py | 117 | def test_char_set_one_or_more(): | CODE |
| LOW | tests/unit/test_model.py | 58 | def test_step_every_k_injection(): | CODE |
| LOW | tests/unit/test_model.py | 84 | def test_step_stop_token_trigger_injection(): | CODE |
| LOW | tests/unit/test_grammar.py | 24 | def test_select_ambiguous_lexeme_boundary(): | CODE |
| LOW | tests/unit/test_grammar.py | 33 | def test_select_ambiguous_lexeme_boundary_manual_fix(): | STRING |
| LOW | tests/unit/test_grammar.py | 50 | def test_grammar_plus_fstring(): | CODE |
| LOW | tests/unit/test_grammar.py | 82 | def test_multiple_mutual_recursion(self): | CODE |
| LOW | tests/unit/test_grammar.py | 99 | def test_branching_mutual_recursion(self): | CODE |
| LOW | tests/unit/test_grammar.py | 140 | def test_raises_on_incomplete_input(self): | CODE |
| LOW⚡ | tests/unit/test_uri_validation.py | 11 | def test_https_allowed_by_default(self): | CODE |
| LOW⚡ | tests/unit/test_uri_validation.py | 16 | def test_http_blocked_by_default(self): | CODE |
| LOW⚡ | tests/unit/test_uri_validation.py | 20 | def test_ftp_blocked_by_default(self): | CODE |
| LOW⚡ | tests/unit/test_uri_validation.py | 24 | def test_http_allowed_when_configured(self): | CODE |
| LOW⚡ | tests/unit/test_uri_validation.py | 28 | def test_custom_scheme_allowed(self): | CODE |
| LOW⚡ | tests/unit/test_uri_validation.py | 32 | def test_scheme_check_is_case_insensitive(self): | CODE |
| LOW⚡ | tests/unit/test_uri_validation.py | 38 | def test_file_uri_blocked_when_allow_local_false(self): | CODE |
| LOW⚡ | tests/unit/test_uri_validation.py | 42 | def test_file_uri_allowed_when_allow_local_true(self): | CODE |
| LOW⚡ | tests/unit/test_uri_validation.py | 46 | def test_file_uri_not_subject_to_scheme_allowlist(self): | CODE |
| LOW | tests/unit/test_uri_validation.py | 105 | def test_ip_literal_in_url_blocked(self): | CODE |
| LOW | tests/unit/test_uri_validation.py | 118 | def test_dns_resolution_failure_raises(self): | CODE |
| LOW | tests/unit/test_uri_validation.py | 129 | def test_all_resolved_addresses_checked(self): | CODE |
| LOW⚡ | tests/unit/test_bytes_from.py | 12 | def test_blocks_http_by_default(self): | CODE |
| LOW⚡ | tests/unit/test_bytes_from.py | 16 | def test_allows_http_when_configured(self): | CODE |
| LOW⚡ | tests/unit/test_bytes_from.py | 24 | def test_blocks_private_ip_by_default(self): | CODE |
| 157 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | guidance/_tools.py | 11 | CODE | |
| LOW | guidance/__init__.py | 8 | CODE | |
| LOW | guidance/__init__.py | 11 | CODE | |
| LOW | guidance/_ast.py | 31 | CODE | |
| LOW | guidance/_ast.py | 31 | CODE | |
| LOW | guidance/_parser.py | 13 | CODE | |
| LOW | guidance/_utils.py | 21 | CODE | |
| LOW | guidance/metrics/__init__.py | 3 | CODE | |
| LOW | guidance/metrics/__init__.py | 3 | CODE | |
| LOW | guidance/metrics/__init__.py | 3 | CODE | |
| LOW | guidance/trace/__init__.py | 9 | CODE | |
| LOW | guidance/trace/__init__.py | 9 | CODE | |
| LOW | guidance/trace/__init__.py | 9 | CODE | |
| LOW | guidance/trace/__init__.py | 9 | CODE | |
| LOW | guidance/trace/__init__.py | 9 | CODE | |
| LOW | guidance/trace/__init__.py | 9 | CODE | |
| LOW | guidance/trace/__init__.py | 9 | CODE | |
| LOW | guidance/trace/__init__.py | 9 | CODE | |
| LOW | guidance/trace/__init__.py | 9 | CODE | |
| LOW | guidance/trace/__init__.py | 9 | CODE | |
| LOW | guidance/trace/__init__.py | 9 | CODE | |
| LOW | guidance/trace/__init__.py | 9 | CODE | |
| LOW | guidance/trace/__init__.py | 9 | CODE | |
| LOW | guidance/trace/__init__.py | 9 | CODE | |
| LOW | guidance/trace/__init__.py | 9 | CODE | |
| LOW | guidance/trace/__init__.py | 9 | CODE | |
| LOW | guidance/trace/__init__.py | 9 | CODE | |
| LOW | guidance/trace/__init__.py | 9 | CODE | |
| LOW | guidance/trace/__init__.py | 9 | CODE | |
| LOW | guidance/trace/__init__.py | 9 | CODE | |
| LOW | guidance/library/__init__.py | 3 | CODE | |
| LOW | guidance/library/__init__.py | 3 | CODE | |
| LOW | guidance/library/__init__.py | 3 | CODE | |
| LOW | guidance/library/__init__.py | 3 | CODE | |
| LOW | guidance/library/__init__.py | 3 | CODE | |
| LOW | guidance/library/__init__.py | 4 | CODE | |
| LOW | guidance/library/__init__.py | 4 | CODE | |
| LOW | guidance/library/__init__.py | 7 | CODE | |
| LOW | guidance/library/__init__.py | 8 | CODE | |
| LOW | guidance/library/__init__.py | 9 | CODE | |
| LOW | guidance/library/__init__.py | 9 | CODE | |
| LOW | guidance/library/__init__.py | 10 | CODE | |
| LOW | guidance/library/__init__.py | 10 | CODE | |
| LOW | guidance/library/__init__.py | 11 | CODE | |
| LOW | guidance/library/__init__.py | 11 | CODE | |
| LOW | guidance/library/__init__.py | 12 | CODE | |
| LOW | guidance/library/__init__.py | 13 | CODE | |
| LOW | guidance/library/__init__.py | 14 | CODE | |
| LOW | guidance/library/__init__.py | 14 | CODE | |
| LOW | guidance/library/__init__.py | 14 | CODE | |
| LOW | guidance/library/__init__.py | 14 | CODE | |
| LOW | guidance/library/__init__.py | 17 | CODE | |
| LOW | guidance/library/__init__.py | 17 | CODE | |
| LOW | guidance/library/__init__.py | 17 | CODE | |
| LOW | guidance/library/__init__.py | 17 | CODE | |
| LOW | guidance/library/__init__.py | 17 | CODE | |
| LOW | guidance/library/__init__.py | 18 | CODE | |
| LOW | guidance/library/__init__.py | 19 | CODE | |
| LOW | guidance/library/__init__.py | 19 | CODE | |
| LOW | guidance/library/_subgrammar.py | 2 | CODE | |
| 59 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | guidance/models/broken_models/_lite_llm.py | 1 | # import tiktoken | COMMENT |
| LOW | guidance/models/broken_models/_lite_llm.py | 21 | # "Please install the litellm package version >= 1.7 using `pip install litellm -U` in order to use guid | COMMENT |
| LOW | guidance/models/broken_models/_lite_llm.py | 41 | # ) | COMMENT |
| LOW | guidance/models/broken_models/_lite_llm.py | 61 | COMMENT | |
| LOW | guidance/models/broken_models/_lite_llm.py | 81 | COMMENT | |
| LOW | guidance/models/broken_models/_lite_llm.py | 101 | # n=1, | COMMENT |
| LOW | guidance/models/broken_models/_lite_llm.py | 121 | # else: | COMMENT |
| LOW | guidance/models/broken_models/_lite_llm.py | 141 | # raise Exception( | COMMENT |
| LOW | guidance/models/broken_models/_lite_llm.py | 161 | # except Exception as e: # TODO: add retry logic | COMMENT |
| LOW | guidance/models/broken_models/_lite_llm.py | 181 | # messages = [] | COMMENT |
| LOW | guidance/models/broken_models/_lite_llm.py | 201 | # pos += end_pos + len(role_end) | COMMENT |
| LOW | guidance/models/broken_models/_lite_llm.py | 221 | # except Exception as e: # TODO: add retry logic | COMMENT |
| LOW | guidance/models/broken_models/_cohere.py | 1 | # from ._lite_llm import LiteLLMEngine, LiteLLM, LiteLLMCompletion, LiteLLMInstruct | COMMENT |
| LOW | guidance/models/broken_models/_cohere.py | 21 | COMMENT | |
| LOW | guidance/models/broken_models/_cohere.py | 41 | # class CohereCompletion(Cohere, LiteLLMCompletion): | COMMENT |
| LOW | guidance/models/broken_models/_azure_openai.py | 1 | # import pathlib | COMMENT |
| LOW | guidance/models/broken_models/_azure_openai.py | 21 | # """Represents an Azure OpenAI model as exposed through their remote API. | COMMENT |
| LOW | guidance/models/broken_models/_azure_openai.py | 41 | # max_streaming_tokens: int = 1000, | COMMENT |
| LOW | guidance/models/broken_models/_azure_openai.py | 61 | # if not is_openai or not hasattr(openai_package, "OpenAI"): | COMMENT |
| LOW | guidance/models/broken_models/_azure_openai.py | 81 | COMMENT | |
| LOW | guidance/models/broken_models/_azure_openai.py | 101 | # engine_instance, | COMMENT |
| LOW | guidance/models/broken_models/_googleai.py | 1 | # import re | COMMENT |
| LOW | guidance/models/broken_models/_googleai.py | 21 | # model, | COMMENT |
| LOW | guidance/models/broken_models/_googleai.py | 41 | # genai.configure(api_key=api_key) | COMMENT |
| LOW | guidance/models/broken_models/_googleai.py | 61 | # timeout=0.5, | COMMENT |
| LOW | guidance/models/broken_models/_googleai.py | 81 | COMMENT | |
| LOW | guidance/models/broken_models/_googleai.py | 101 | # engine=engine_map[self.__class__]( | COMMENT |
| LOW | guidance/models/broken_models/_googleai.py | 121 | # assistant_start = b"<|im_start|>assistant\n" | COMMENT |
| LOW | guidance/models/broken_models/_googleai.py | 141 | # end_pos = prompt[pos:].find(role_end) | COMMENT |
| LOW | guidance/models/broken_models/_googleai.py | 161 | # ) | COMMENT |
| LOW | guidance/models/broken_models/_googleai.py | 181 | COMMENT | |
| LOW | guidance/models/broken_models/_googleai.py | 201 | # formated_messages = [] | COMMENT |
| LOW | guidance/models/broken_models/_googleai.py | 221 | # formated_messages.append(Content(role=m["role"], parts=parts)) | COMMENT |
| LOW | guidance/models/broken_models/_googleai.py | 241 | # class GoogleAIChat(GoogleAI, Chat): | COMMENT |
| LOW | guidance/models/broken_models/_Gemini.py | 1 | # import os | COMMENT |
| LOW | guidance/models/broken_models/_Gemini.py | 21 | COMMENT | |
| LOW | guidance/models/broken_models/_Gemini.py | 41 | # is_vertexai = True | COMMENT |
| LOW | guidance/models/broken_models/_Gemini.py | 61 | # # caching=caching, | COMMENT |
| LOW | guidance/models/broken_models/_Gemini.py | 81 | # # tokenizer=tokenizer, | COMMENT |
| LOW | guidance/models/broken_models/_Gemini.py | 101 | # # the superclass does all the work | COMMENT |
| LOW | guidance/models/broken_models/_Gemini.py | 121 | # # last_user_text = messages[-1]["content"] | COMMENT |
| LOW | guidance/models/broken_models/_Gemini.py | 141 | COMMENT | |
| LOW | guidance/models/broken_models/_anthropic.py | 1 | # import os | COMMENT |
| LOW | guidance/models/broken_models/_anthropic.py | 21 | # except ModuleNotFoundError: | COMMENT |
| LOW | guidance/models/broken_models/_anthropic.py | 41 | # except: | COMMENT |
| LOW | guidance/models/broken_models/_anthropic.py | 61 | # ("assistant", b"<|im_start|>assistant\n"), | COMMENT |
| LOW | guidance/models/broken_models/_anthropic.py | 81 | COMMENT | |
| LOW | guidance/models/broken_models/_anthropic.py | 101 | # temperature=temperature, | COMMENT |
| LOW | guidance/models/broken_models/_anthropic.py | 121 | # there are some things we cannot do, like force the model to follow a pattern inside | COMMENT |
| LOW | guidance/models/broken_models/_anthropic.py | 141 | # tokenizer=tokenizer, | COMMENT |
| LOW | guidance/models/broken_models/_azureai_studio.py | 1 | # import hashlib | COMMENT |
| LOW | guidance/models/broken_models/_azureai_studio.py | 21 | # class AzureAIStudioChatEngine(GrammarlessEngine): | COMMENT |
| LOW | guidance/models/broken_models/_azureai_studio.py | 41 | # "Detected OpenAI compatible model; please install openai package" | COMMENT |
| LOW | guidance/models/broken_models/_azureai_studio.py | 61 | COMMENT | |
| LOW | guidance/models/broken_models/_azureai_studio.py | 81 | # found = True | COMMENT |
| LOW | guidance/models/broken_models/_azureai_studio.py | 101 | # message_content = btext.decode("utf8") | COMMENT |
| LOW | guidance/models/broken_models/_azureai_studio.py | 121 | # cache_key = self._hash_prompt(prompt) | COMMENT |
| LOW | guidance/models/broken_models/_azureai_studio.py | 141 | COMMENT | |
| LOW | guidance/models/broken_models/_azureai_studio.py | 161 | # response_score = requests.post( | COMMENT |
| LOW | guidance/models/broken_models/_azureai_studio.py | 181 | # yield encoded_chunk | COMMENT |
| 34 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM⚡ | guidance/chat.py | 91 | # -------------------------------------------------- | COMMENT |
| MEDIUM⚡ | guidance/chat.py | 93 | # -------------------------------------------------- | COMMENT |
| MEDIUM | guidance/chat.py | 111 | # -------------------------------------------------- | COMMENT |
| MEDIUM | guidance/chat.py | 113 | # -------------------------------------------------- | COMMENT |
| MEDIUM | guidance/chat.py | 146 | # -------------------------------------------------- | COMMENT |
| MEDIUM | guidance/chat.py | 148 | # -------------------------------------------------- | COMMENT |
| MEDIUM | guidance/chat.py | 173 | # -------------------------------------------------- | COMMENT |
| MEDIUM | guidance/chat.py | 175 | # -------------------------------------------------- | COMMENT |
| MEDIUM | guidance/chat.py | 230 | # -------------------------------------------------- | COMMENT |
| MEDIUM | guidance/chat.py | 232 | # -------------------------------------------------- | COMMENT |
| MEDIUM | guidance/chat.py | 251 | # -------------------------------------------------- | COMMENT |
| MEDIUM | guidance/chat.py | 253 | # -------------------------------------------------- | COMMENT |
| MEDIUM | guidance/chat.py | 285 | # -------------------------------------------------- | COMMENT |
| MEDIUM | guidance/chat.py | 287 | # -------------------------------------------------- | COMMENT |
| MEDIUM | guidance/chat.py | 317 | # -------------------------------------------------- | COMMENT |
| MEDIUM | guidance/chat.py | 319 | # -------------------------------------------------- | COMMENT |
| MEDIUM | guidance/chat.py | 345 | # -------------------------------------------------- | COMMENT |
| MEDIUM | guidance/chat.py | 347 | # -------------------------------------------------- | COMMENT |
| MEDIUM | guidance/chat.py | 371 | # -------------------------------------------------- | COMMENT |
| MEDIUM | guidance/chat.py | 373 | # -------------------------------------------------- | COMMENT |
| MEDIUM | guidance/models/broken_models/_azure_openai.py | 49 | # ---------- | COMMENT |
| MEDIUM | guidance/models/broken_models/_azureai_studio.py | 214 | # ---------- | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | guidance/_parser.py | 178 | except StopIteration: | CODE |
| HIGH | guidance/_parser.py | 351 | except UnicodeDecodeError: | CODE |
| HIGH | guidance/_parser.py | 336 | except UnicodeDecodeError: | CODE |
| HIGH | guidance/_uri_validation.py | 73 | except ValueError: | CODE |
| HIGH | guidance/models/_mock.py | 75 | except: | CODE |
| HIGH | guidance/models/_llama_cpp.py | 106 | except FileNotFoundError: | CODE |
| HIGH | guidance/models/_llama_cpp.py | 108 | except PermissionError: | CODE |
| HIGH | guidance/models/_transformers.py | 20 | except ModuleNotFoundError: | CODE |
| HIGH | guidance/models/_transformers.py | 370 | except FileNotFoundError: | CODE |
| HIGH | guidance/models/_transformers.py | 372 | except PermissionError: | CODE |
| HIGH | guidance/visual/_environment.py | 105 | except (NameError, ImportError): # pragma: no cover | CODE |
| HIGH | guidance/visual/_jupyter.py | 9 | except ImportError: | CODE |
| HIGH | tests/unit/test_visual.py | 80 | except ImportError: # NOTE(nopdive): anytree not installed | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | guidance/models/_openai_base.py | 484 | # Create an in-memory WAV file | COMMENT |
| MEDIUM | guidance/models/_transformers.py | 405 | # Create the tokenizer | STRING |
| MEDIUM | guidance/models/_base/_model.py | 368 | # Define the target function for the thread | COMMENT |
| MEDIUM⚡ | tests/unit/test_decorator.py | 407 | # Create a weak reference to the object | COMMENT |
| MEDIUM⚡ | tests/unit/test_decorator.py | 420 | # Create a weak reference to the object | COMMENT |
| MEDIUM⚡ | tests/unit/test_decorator.py | 433 | # Create a weak reference to the object | COMMENT |
| MEDIUM⚡ | tests/unit/test_decorator.py | 435 | # Create a weak reference to the cached method | COMMENT |
| MEDIUM | docs/conf.py | 7 | # This file is execfile()d with the current directory set to its | COMMENT |
| MEDIUM | scripts/extract_python_from_readme.py | 18 | # This function contains 95% CoPilot vibes by volume | COMMENT |
| MEDIUM | packages/python/stitch/docs/source/conf.py | 6 | # This file is execfile()d with the current directory set to its | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | guidance/_schema.py | 184 | CODE | |
| LOW | guidance/_grammar.py | 61 | CODE | |
| LOW | guidance/_ast.py | 682 | CODE | |
| LOW | guidance/_parser.py | 324 | CODE | |
| LOW | guidance/_guidance.py | 129 | CODE | |
| LOW | guidance/_guidance.py | 140 | CODE | |
| LOW | guidance/metrics/_metrics.py | 126 | CODE | |
| LOW | guidance/trace/_trace.py | 357 | CODE | |
| LOW | guidance/library/_json.py | 13 | CODE | |
| LOW | guidance/library/_substring.py | 11 | CODE | |
| LOW | guidance/models/_mock.py | 117 | CODE | |
| LOW | guidance/models/_openai_base.py | 168 | CODE | |
| LOW | guidance/models/_openai_base.py | 336 | CODE | |
| LOW | guidance/models/_llama_cpp.py | 81 | CODE | |
| LOW | guidance/models/_transformers.py | 217 | CODE | |
| LOW | guidance/models/_transformers.py | 444 | CODE | |
| LOW | guidance/models/broken_models/_vertexai.py | 21 | CODE | |
| LOW | guidance/models/broken_models/_vertexai.py | 174 | CODE | |
| LOW | guidance/models/experimental/_sglang.py | 99 | CODE | |
| LOW | guidance/models/experimental/_litellm.py | 209 | CODE | |
| LOW | guidance/models/experimental/_vllm.py | 29 | CODE | |
| LOW | guidance/models/_engine/_engine.py | 94 | CODE | |
| LOW | guidance/models/_engine/_interpreter.py | 65 | CODE | |
| LOW | guidance/models/_base/_model.py | 115 | CODE | |
| LOW | guidance/models/_base/_model.py | 161 | CODE | |
| LOW | guidance/models/_base/_model.py | 361 | CODE | |
| LOW | guidance/visual/_renderer.py | 199 | CODE | |
| LOW | guidance/visual/_renderer.py | 329 | CODE | |
| LOW | guidance/visual/_renderer.py | 524 | CODE | |
| LOW | guidance/visual/_renderer.py | 541 | CODE | |
| LOW | guidance/visual/_trace.py | 17 | CODE | |
| LOW | tests/unit/test_ll.py | 62 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | guidance/models/_llama_cpp.py | 0 | computes the logits for the given token state. this overrides a method from the localengine class that is used to get in | STRING |
| HIGH | guidance/models/_transformers.py | 0 | computes the logits for the given token state. this overrides a method from the localengine class that is used to get in | STRING |
| HIGH | guidance/models/_onnxruntime.py | 0 | computes the logits for the given token state. this overrides a method from the localengine class that is used to get in | STRING |
| HIGH | tests/model_specific/test_onnxruntime_genai.py | 0 | tweak this proverb to apply to model instructions instead. {gen("verse", max_tokens=2)} | STRING |
| HIGH | tests/model_specific/test_transformers.py | 0 | tweak this proverb to apply to model instructions instead. {gen("verse", max_tokens=2)} | STRING |
| HIGH | tests/model_specific/llama_cpp_tests/test_llama_cpp.py | 0 | tweak this proverb to apply to model instructions instead. {gen("verse", max_tokens=2)} | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | guidance/debug.py | 27 | # Check if the auto renderer has a JupyterWidgetRenderer inside | COMMENT |
| LOW | guidance/debug.py | 53 | # Check if the auto renderer has a JupyterWidgetRenderer inside | COMMENT |
| LOW | guidance/debug.py | 81 | # Check if the auto renderer has a JupyterWidgetRenderer inside | COMMENT |
| LOW | guidance/models/_transformers.py | 299 | # Check if the tokenizer has a bos_token attribute, and if it does, check | COMMENT |
| LOW | guidance/models/broken_models/_azureai_studio.py | 123 | # # Check if the result is already in the cache | COMMENT |
| LOW | guidance/models/_engine/_engine.py | 315 | # Check if the accumulated text ends with any stop string | COMMENT |
| LOW | guidance/models/_engine/_engine.py | 357 | # Check if we've accumulated enough to match the stop string | COMMENT |
| LOW | guidance/models/_engine/_engine.py | 426 | # Set flag to indicate this is an injection backtrack | COMMENT |
| LOW | guidance/models/_engine/_engine.py | 474 | # Set flag to indicate this is an injection backtrack | COMMENT |
| LOW | guidance/models/_engine/_interpreter.py | 87 | # Check if this is an injection backtrack (should happen before adding text) | COMMENT |
| LOW | guidance/models/_base/_model.py | 181 | # Set start_index to the current length | COMMENT |
| LOW | guidance/models/_base/_model.py | 392 | # Check if the thread is still alive | COMMENT |
| LOW | guidance/visual/_renderer.py | 482 | # Check if message has diverged from prev messages | COMMENT |
| LOW | guidance/visual/_trace.py | 32 | # Check if any input is a role opener or closer | COMMENT |
| LOW | guidance/visual/_trace.py | 93 | # Check if any input in active role is a RoleCloserInput | COMMENT |
| LOW⚡ | tests/unit/test_decorator.py | 415 | # Check if the object was garbage collected | COMMENT |
| LOW⚡ | tests/unit/test_decorator.py | 428 | # Check if the object was garbage collected | COMMENT |
| LOW⚡ | tests/unit/test_decorator.py | 444 | # Check if the object was garbage collected | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | guidance/_topics.py | 19 | __all__ = [ | CODE |
| LOW | guidance/__init__.py | 13 | __all__ = [ | CODE |
| LOW | guidance/_ast.py | 512 | def set_target(self, target: RuleNode) -> None: | CODE |
| LOW | guidance/debug.py | 8 | logger = logging.getLogger(__name__) | CODE |
| LOW | guidance/_utils.py | 23 | logger = logging.getLogger(__name__) | CODE |
| LOW | guidance/metrics/_metrics.py | 16 | logger = logging.getLogger(__name__) | CODE |
| LOW | guidance/metrics/__init__.py | 5 | __all__ = [ | CODE |
| LOW | guidance/trace/__init__.py | 32 | __all__ = [ | CODE |
| LOW | guidance/trace/_trace.py | 12 | logger = logging.getLogger(__name__) | CODE |
| LOW | guidance/library/__init__.py | 21 | __all__ = [ | CODE |
| LOW | guidance/library/_subgrammar.py | 4 | __all__ = ["as_regular_grammar", "lexeme", "regex", "subgrammar"] | CODE |
| LOW | guidance/library/_gen.py | 10 | logger = logging.getLogger(__name__) | CODE |
| LOW | guidance/models/_mock.py | 11 | logger = logging.getLogger(__name__) | CODE |
| LOW | guidance/models/_llama_cpp.py | 30 | logger = logging.getLogger(__name__) | CODE |
| LOW | guidance/models/__init__.py | 10 | __all__ = [ | CODE |
| LOW | guidance/models/_azureai.py | 27 | logger = logging.getLogger(__name__) | CODE |
| LOW | guidance/models/experimental/__init__.py | 5 | __all__ = ["LiteLLM", "SglangModel", "VLLMModel"] | CODE |
| LOW | guidance/models/_engine/__init__.py | 6 | __all__ = [ | CODE |
| LOW | guidance/models/_engine/_engine.py | 27 | logger = logging.getLogger(__name__) | CODE |
| LOW | guidance/models/_base/__init__.py | 5 | __all__ = [ | CODE |
| LOW | guidance/visual/_exchange.py | 11 | logger = logging.getLogger(__name__) | CODE |
| LOW | guidance/visual/_exchange.py | 70 | __all__ = ["TopicExchange"] | CODE |
| LOW | guidance/visual/__init__.py | 23 | __all__ = [ | CODE |
| LOW | guidance/visual/_renderer.py | 53 | logger = logging.getLogger(__name__) | CODE |
| LOW | guidance/visual/_jupyter.py | 12 | logger = logging.getLogger(__name__) | CODE |
| LOW | guidance/registry/__init__.py | 5 | __all__ = [ | CODE |
| LOW | guidance/registry/_registry.py | 82 | def set_renderer(renderer: Renderer) -> None: | CODE |
| LOW | packages/python/stitch/docs/source/conf.py | 203 | logger = logging.getLogger(__name__) | CODE |
| LOW | packages/python/stitch/stitch/__init__.py | 10 | __all__ = ["StitchWidget", "__version__", "_jupyter_labextension_paths", "_jupyter_nbextension_paths", "version_info"] | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | tests/unit/library/json/test_allOf.py | 352 | # valid: foo is null, bar is equal to 5, baz is null | COMMENT |
| HIGH | tests/unit/library/json/test_allOf.py | 443 | # valid: foo is null, bar is equal to 5, baz is null | COMMENT |
| HIGH | packages/python/stitch/stitch/tests/conftest.py | 43 | _widget_attrs["_comm_default"] = getattr(Widget, "_comm_default", undefined) | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | guidance/metrics/_metrics.py | 93 | except Exception as e: # noqa BLE001 | CODE |
| LOW | guidance/metrics/_metrics.py | 141 | except Exception as e: # noqa BLE001 | CODE |
| LOW | guidance/metrics/_metrics.py | 177 | except Exception as e: | CODE |
| LOW | guidance/models/_transformers.py | 310 | except Exception as e: | CODE |
| LOW | guidance/models/broken_models/_vertexai.py | 132 | except Exception as e: # TODO: add retry logic | CODE |
| LOW | guidance/visual/_renderer.py | 153 | except Exception: # noqa: BLE001 | CODE |
| LOW | guidance/visual/_renderer.py | 195 | except Exception as _: # noqa: BLE001 | CODE |
| LOW | guidance/visual/_renderer.py | 237 | except Exception as _: # noqa: BLE001 | CODE |
| LOW | tests/unit/test_visual.py | 82 | except Exception as e: | CODE |
| LOW | tests/model_specific/test_visual.py | 51 | except Exception as e: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | guidance/_grammar.py | 27 | CODE | |
| LOW | guidance/_utils.py | 314 | CODE | |
| LOW | guidance/_utils.py | 331 | CODE | |
| LOW | guidance/library/_json.py | 13 | CODE | |
| LOW | guidance/library/_gen.py | 13 | CODE | |
| LOW | guidance/models/_azureai.py | 76 | CODE | |
| LOW | guidance/models/_azureai.py | 276 | CODE | |
| LOW | guidance/models/_transformers.py | 582 | CODE | |
| LOW | guidance/models/_onnxruntime.py | 31 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | guidance/resources/graphpaper-inline.html | 29 | /*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Pub | COMMENT |
| LOW | tests/model_specific/test_transformers.py | 35 | big_opts = ["Lorem ipsum dolor sit amet", "Duis aute irure dolor "] | CODE |
| LOW | tests/model_specific/test_transformers.py | 35 | big_opts = ["Lorem ipsum dolor sit amet", "Duis aute irure dolor "] | CODE |
| LOW | tests/model_integration/library/test_subgrammar.py | 62 | lm += "John Doe's name, age, and birthday:\n" | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | guidance/models/_transformers.py | 127 | # (that will just add extra spaces during an encode-decode cycle) | COMMENT |
| LOW | guidance/models/_engine/_engine.py | 614 | # If we have top_k, we can just return the first one | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | guidance/models/broken_models/_lite_llm.py | 139 | # # make sure you don't try and instruct the same model twice | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/model_integration/test_model.py | 41 | def my_function(lm): | STRING |
| LOW | tests/model_integration/test_model.py | 77 | def my_function(lm): | CODE |