One delightful Ruby framework for every major AI provider. Build AI agents, chatbots, RAG apps, and multimodal workflows in beautiful, expressive code.
This report presents the forensic synthetic code analysis of crmne/ruby_llm, a Ruby project with 4,243 GitHub stars. SynthScan v2.0 examined 60,922 lines of code across 446 source files, recording 305 pattern matches distributed across 6 syntactic categories. The overall adjusted score of 6.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 305 distinct pattern matches across 6 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 | spec/ruby_llm/chat_tools_spec.rb | 5 | def skip_unless_supports_functions(provider, model) | CODE |
| LOW | spec/ruby_llm/chat_tools_spec.rb | 178 | def assistant_tool_call_messages(chat) | CODE |
| LOW | spec/ruby_llm/uploaded_file_spec.rb | 113 | def stub_default_model_provider(provider, config: RubyLLM.config) | CODE |
| LOW | spec/ruby_llm/chat_tool_attachments_spec.rb | 64 | def chat_with_tool_attachment(model, provider, protocol: nil) | CODE |
| LOW | spec/ruby_llm/active_record/acts_as_spec.rb | 90 | def complete_assistant_message(chat, input_tokens: 1_000, output_tokens: 2_000, content: 'Hi') | CODE |
| LOW | spec/ruby_llm/generators/chat_ui_generator_spec.rb | 14 | def expect_messages_helper_content(path) | CODE |
| LOW | spec/ruby_llm/generators/chat_ui_generator_spec.rb | 27 | def expect_generated_view_set( # rubocop:disable Metrics/AbcSize | CODE |
| LOW | spec/ruby_llm/generators/chat_ui_generator_spec.rb | 96 | def expect_broadcasting_model( | CODE |
| LOW | spec/ruby_llm/generators/chat_ui_generator_spec.rb | 131 | def expect_chat_script_to_succeed(script) | CODE |
| LOW | docs/_advanced/rails-persistence.md | 478 | def persist_message_completion(message) | CODE |
| LOW | docs/_core_features/image-generation.md | 225 | def generate_and_attach_image(product, prompt) | CODE |
| LOW | lib/ruby_llm/tool.rb | 227 | def validate_keyword_arguments(arguments) # :nodoc: | CODE |
| LOW | lib/ruby_llm/streaming.rb | 138 | def build_stream_error_response(parsed_data, env, status) | CODE |
| LOW | lib/ruby_llm/agent.rb | 453 | def apply_passthrough_options(llm_chat) | CODE |
| LOW | lib/ruby_llm/agent.rb | 508 | def apply_assume_model_exists(chat_object) | CODE |
| LOW | lib/ruby_llm/agent.rb | 528 | def resolved_instructions_value(chat_object, runtime, inputs:) | CODE |
| LOW | lib/ruby_llm/agent.rb | 561 | def runtime_instruction_target(chat_object) | CODE |
| LOW | lib/ruby_llm/model.rb | 196 | def normalize_reasoning_options(options) | CODE |
| LOW | lib/ruby_llm/utils.rb | 75 | def iso_date_prefix_to_utc_midnight_string(value) | CODE |
| LOW | lib/ruby_llm/chat.rb | 654 | def extract_schema_definition(schema) | CODE |
| LOW⚡ | lib/ruby_llm/chat.rb | 857 | def execute_pending_tool_calls(response) | CODE |
| LOW⚡ | lib/ruby_llm/chat.rb | 867 | def handle_sequential_tool_calls(tool_calls) | CODE |
| LOW⚡ | lib/ruby_llm/chat.rb | 875 | def handle_concurrent_tool_calls(tool_calls) | CODE |
| LOW⚡ | lib/ruby_llm/chat.rb | 882 | def execute_tools_concurrently(tool_calls, &on_result) | CODE |
| LOW⚡ | lib/ruby_llm/chat.rb | 888 | def execute_tool_with_callbacks(tool_call) | CODE |
| LOW | lib/ruby_llm/chat.rb | 956 | def normalize_tool_concurrency(concurrency) | CODE |
| LOW | lib/ruby_llm/chat.rb | 986 | def tool_name_for_choice_class(tool_class) | CODE |
| LOW | lib/ruby_llm/stream_accumulator.rb | 102 | def parse_tool_call_arguments(arguments, response) | CODE |
| LOW | lib/ruby_llm/stream_accumulator.rb | 133 | def initial_tool_call_arguments(tool_call) | CODE |
| LOW | lib/ruby_llm/stream_accumulator.rb | 140 | def append_tool_call_fragment(stream_key, tool_call) | CODE |
| LOW | lib/ruby_llm/stream_accumulator.rb | 177 | def append_text_with_thinking(text) | CODE |
| LOW | lib/ruby_llm/stream_accumulator.rb | 183 | def append_thinking_from_chunk(chunk) | CODE |
| LOW | lib/ruby_llm/stream_accumulator.rb | 225 | def consume_non_think_content(remaining, start_tag, output) | CODE |
| LOW | lib/ruby_llm/protocol.rb | 159 | def maybe_normalize_temperature(temperature, _model) | CODE |
| LOW | lib/ruby_llm/protocol.rb | 180 | def apply_before_request_hooks(payload, hooks) | CODE |
| LOW | lib/ruby_llm/protocol.rb | 218 | def provider_file_upload_options(_attachment) | CODE |
| LOW | lib/ruby_llm/protocol.rb | 264 | def parse_completion_response(response) | CODE |
| LOW | lib/ruby_llm/provider.rb | 454 | def configured_remote_providers(config) # :nodoc: | CODE |
| LOW | lib/ruby_llm/models.rb | 313 | def normalize_embedding_modalities(data) # :nodoc: | CODE |
| LOW | lib/ruby_llm/models.rb | 335 | def models_dev_model_attributes(model_data, provider_slug, provider_key) # :nodoc: | CODE |
| LOW | lib/ruby_llm/models.rb | 419 | def normalize_models_dev_modalities(modalities) # :nodoc: | CODE |
| LOW | lib/ruby_llm/models.rb | 428 | def normalize_models_dev_knowledge(value) # :nodoc: | CODE |
| LOW | lib/ruby_llm/models.rb | 565 | def resolve_provider_registry_id(model_id, provider) | CODE |
| LOW | lib/ruby_llm/configuration.rb | 42 | def register_provider_options(options) # :nodoc: | CODE |
| LOW | lib/ruby_llm/providers/openai.rb | 79 | def batch_protocol_for_stored_batch(id) | CODE |
| LOW | lib/ruby_llm/providers/openai.rb | 84 | def batch_protocol_for_endpoint(endpoint) | CODE |
| LOW | lib/ruby_llm/providers/vertexai.rb | 128 | def batch_protocol_for_model_path(model_path) | CODE |
| LOW | lib/ruby_llm/providers/gemini/capabilities.rb | 50 | def critical_capabilities_for(model_id) | CODE |
| LOW | lib/ruby_llm/providers/openrouter/chat.rb | 149 | def extract_thinking_signature(message_data) | CODE |
| LOW | lib/ruby_llm/providers/openrouter/models.rb | 14 | def parse_list_models_response(response, slug, _capabilities) | CODE |
| LOW | lib/ruby_llm/providers/openrouter/models.rb | 59 | def supported_parameters_to_capabilities(params) | CODE |
| LOW | lib/ruby_llm/providers/deepseek/capabilities.rb | 31 | def critical_capabilities_for(model_id) | CODE |
| LOW | lib/ruby_llm/providers/xai/models.rb | 10 | def parse_list_models_response(response, slug, _capabilities) | CODE |
| LOW | lib/ruby_llm/providers/bedrock/embedding_protocol.rb | 16 | def parse_single_embedding_responses(responses, model:, text:) | CODE |
| LOW | lib/ruby_llm/providers/bedrock/embedding_protocol.rb | 24 | def deep_merge_provider_options(payload, provider_options) | CODE |
| LOW | lib/ruby_llm/providers/bedrock/models.rb | 20 | def parse_list_models_response(response, slug, _capabilities) | CODE |
| LOW | lib/ruby_llm/providers/bedrock/models.rb | 72 | def normalize_inference_profile_id(model_id, inference_types, region) | CODE |
| LOW | lib/ruby_llm/providers/vertexai/batch_prediction.rb | 116 | def vertex_batch_result_index(line, fallback_index) | CODE |
| LOW | lib/ruby_llm/providers/vertexai/batch_prediction.rb | 121 | def parse_vertex_batch_result(_line, _fallback_index) | CODE |
| LOW | lib/ruby_llm/providers/vertexai/models.rb | 120 | def build_model_from_api_data(model_data, model_id) | CODE |
| 96 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | spec/dummy/config/puma.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | spec/dummy/config/puma.rb | 21 | # response time (latency) of the application. | COMMENT |
| LOW | spec/dummy/config/database.yml | 21 | database: storage/test<%= ENV['TEST_ENV_NUMBER'] %>.sqlite3 | COMMENT |
| LOW | spec/dummy/config/locales/en.yml | 1 | # Files in the config/locales directory are used for internationalization and | COMMENT |
| LOW | spec/dummy/config/locales/en.yml | 21 | # | COMMENT |
| LOW | spec/dummy/config/environments/production.rb | 61 | # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com` | COMMENT |
| LOW | spec/dummy/config/environments/test.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | spec/dummy/config/initializers/inflections.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | spec/dummy/config/initializers/cors.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | spec/dummy/db/schema.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | spec/dummy/db/seeds.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/ruby_llm.rb | 41 | # RubyLLM is a Ruby interface to large language models. One API for | COMMENT |
| LOW | lib/ruby_llm.rb | 61 | # configured chat (model, instructions, tools, schema) into a reusable | COMMENT |
| LOW | lib/ruby_llm.rb | 101 | # own configuration. | COMMENT |
| LOW | lib/ruby_llm.rb | 121 | # chat = RubyLLM.chat(model: 'claude-sonnet-4-5') | COMMENT |
| LOW | lib/ruby_llm.rb | 141 | # forwarded to Embedding.embed. | COMMENT |
| LOW | lib/ruby_llm.rb | 161 | # are forwarded to Image.paint. | COMMENT |
| LOW | lib/ruby_llm.rb | 181 | # forwarded to Transcription.transcribe. | COMMENT |
| LOW | lib/ruby_llm.rb | 201 | # forwarded to UploadedFile.download. | COMMENT |
| LOW | lib/ruby_llm.rb | 221 | Prompt.render(name, **locals) | COMMENT |
| LOW | lib/ruby_llm/image.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/ruby_llm/image.rb | 21 | # The MIME type of the image data, such as <tt>"image/png"</tt>. | COMMENT |
| LOW | lib/ruby_llm/image.rb | 41 | # supplies a Context whose configuration replaces the global one. | COMMENT |
| LOW | lib/ruby_llm/tool.rb | 21 | # class Weather < RubyLLM::Tool | COMMENT |
| LOW | lib/ruby_llm/tool.rb | 41 | COMMENT | |
| LOW | lib/ruby_llm/tool.rb | 61 | COMMENT | |
| LOW | lib/ruby_llm/tool.rb | 81 | # Sets the JSON Schema for the tool's arguments. Accepts a schema hash, | COMMENT |
| LOW | lib/ruby_llm/tool.rb | 101 | end | COMMENT |
| LOW | lib/ruby_llm/fallback.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/ruby_llm/cost.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/ruby_llm/cost.rb | 21 | PER_MILLION = 1_000_000.0 # :nodoc: | COMMENT |
| LOW | lib/ruby_llm/cost.rb | 161 | # input tokens. | COMMENT |
| LOW | lib/ruby_llm/tool_call.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/ruby_llm/speech.rb | 41 | @format = (format || 'mp3').to_s | COMMENT |
| LOW | lib/ruby_llm/deprecator.rb | 21 | # Raised when a deprecated API is used and | COMMENT |
| LOW | lib/ruby_llm/agent.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/ruby_llm/agent.rb | 21 | # that class instead. | COMMENT |
| LOW | lib/ruby_llm/agent.rb | 101 | COMMENT | |
| LOW | lib/ruby_llm/agent.rb | 121 | # instructions { "You are helping #{workspace.name}" } | COMMENT |
| LOW | lib/ruby_llm/agent.rb | 161 | # the configured value. | COMMENT |
| LOW | lib/ruby_llm/agent.rb | 181 | @citations = value | COMMENT |
| LOW | lib/ruby_llm/agent.rb | 221 | # DSL; a lambda is evaluated when the chat is built. Called with no | COMMENT |
| LOW | lib/ruby_llm/agent.rb | 321 | COMMENT | |
| LOW | lib/ruby_llm/agent.rb | 601 | @resolved_chat_model = case @chat_model | COMMENT |
| LOW | lib/ruby_llm/agent.rb | 641 | COMMENT | |
| LOW | lib/ruby_llm/agent.rb | 661 | # Returns the structured output schema set on the chat. See Chat#schema. | COMMENT |
| LOW | lib/ruby_llm/agent.rb | 681 | # Registers tools on the chat. See Chat#with_tools. | COMMENT |
| LOW | lib/ruby_llm/agent.rb | 701 | # Switches the chat to a different model. See Chat#with_model. | COMMENT |
| LOW | lib/ruby_llm/agent.rb | 721 | # Clears the thinking configuration. See Chat#without_thinking. | COMMENT |
| LOW | lib/ruby_llm/agent.rb | 741 | # Disables prompt caching. See Chat#without_caching. | COMMENT |
| LOW | lib/ruby_llm/agent.rb | 761 | # | COMMENT |
| LOW | lib/ruby_llm/agent.rb | 781 | # | COMMENT |
| LOW | lib/ruby_llm/agent.rb | 801 | # | COMMENT |
| LOW | lib/ruby_llm/agent.rb | 821 | # | COMMENT |
| LOW | lib/ruby_llm/agent.rb | 841 | # | COMMENT |
| LOW | lib/ruby_llm/thinking.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/ruby_llm/model.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/ruby_llm/model.rb | 121 | # tokens, or +nil+ if the registry has no such price. Valid kinds are | COMMENT |
| LOW | lib/ruby_llm/uploaded_file.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/ruby_llm/uploaded_file.rb | 181 | end | COMMENT |
| 61 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | Archspec.rb | 10 | # User-facing objects and orchestration. These are nouns like Chat, Batch, | COMMENT |
| MEDIUM | docs/_advanced/error-handling.md | 98 | # Reduce prompt size or use a model with a larger context window | COMMENT |
| MEDIUM | docs/_core_features/embeddings.md | 235 | embedding_result = RubyLLM.embed(content) # Uses default embedding model | CODE |
| MEDIUM | docs/_core_features/citations.md | 79 | ## Citing Tool Results (RAG) | COMMENT |
| MEDIUM | lib/ruby_llm/agent.rb | 832 | # Runs the agentic loop until nothing is left to do. See Chat#complete. | COMMENT |
| MEDIUM | lib/ruby_llm/chat.rb | 18 | # #ask runs the agentic loop to completion, executing tool calls until the | COMMENT |
| MEDIUM | lib/ruby_llm/chat.rb | 94 | # agentic loop to completion, executing tool calls along the way. | COMMENT |
| MEDIUM | lib/ruby_llm/chat.rb | 153 | # Runs the agentic loop until #complete? is +true+ and returns the last | COMMENT |
| MEDIUM | lib/ruby_llm/error.rb | 87 | # Raised when the request exceeds the model's context window or token | COMMENT |
| MEDIUM | lib/ruby_llm/embedding.rb | 46 | # +model:+ selects the embedding model and defaults to the | COMMENT |
| MEDIUM | lib/generators/ruby_llm/generator_helpers.rb | 175 | # scaffold conventions without complicating scaffold templates. | COMMENT |
| MEDIUM | lib/generators/ruby_llm/chat_ui/chat_ui_generator.rb | 8 | # Generates a simple chat UI scaffold for RubyLLM | COMMENT |
| MEDIUM | lib/generators/ruby_llm/chat_ui/chat_ui_generator.rb | 45 | # - `scaffold` should stay close to Rails scaffold ERB output. | COMMENT |
| MEDIUM | lib/generators/ruby_llm/chat_ui/chat_ui_generator.rb | 46 | # - `tailwind` should stay close to tailwindcss-rails scaffold output. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | spec/dummy/db/schema.rb | 3 | # This file is auto-generated from the current state of the database. Instead | COMMENT |
| MEDIUM | spec/dummy/db/schema.rb | 7 | # This file is the source Rails uses to define your schema when running `bin/rails | COMMENT |
| MEDIUM | spec/ruby_llm/chat_error_spec.rb | 79 | # Create a huge conversation (matching <MASSIVE_TEXT> in spec_helper) | COMMENT |
| MEDIUM | spec/ruby_llm/chat_error_spec.rb | 82 | # Create a few copies in the conversation | COMMENT |
| MEDIUM | spec/ruby_llm/models_refresh_spec.rb | 156 | # Create a temporary file for testing | COMMENT |
| MEDIUM | spec/ruby_llm/chat_schema_spec.rb | 5 | # Define a test schema class for testing RubyLLM::Schema instances | COMMENT |
| MEDIUM | spec/ruby_llm/active_record/acts_as_spec.rb | 512 | # Define a second tool for testing | COMMENT |
| MEDIUM | spec/ruby_llm/active_record/acts_as_spec.rb | 1337 | # Create a known model first | COMMENT |
| MEDIUM | …ec/ruby_llm/active_record/acts_as_with_context_spec.rb | 37 | # Create a different API key in custom context | COMMENT |
| MEDIUM | spec/ruby_llm/protocols/gemini/chat_spec.rb | 8 | # Create a test object that includes the module to access private methods | COMMENT |
| MEDIUM | lib/ruby_llm/active_record/batch_methods.rb | 12 | # Creating the record submits the staged chats to the provider in the | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | .github/pull_request_template.md | 38 | ## AI-generated code | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docs/_getting_started/configuration-providers.md | 147 | config.openai_api_key = ENV['CUSTOM_API_KEY'] # Or 'dummy-key' if not required | CODE |
| LOW | docs/_getting_started/configuration-providers.md | 165 | config.openai_api_key = "dummy-key" # If required by your server | CODE |