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,327 GitHub stars. SynthScan v2.0 examined 91,922 lines of code across 594 source files, recording 380 pattern matches distributed across 7 syntactic categories. The overall adjusted score of 4.8 places this repository in the Likely human-written 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 380 distinct pattern matches across 7 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 | 6 | def skip_unless_supports_functions(provider, model) | CODE |
| LOW | spec/ruby_llm/chat_tools_spec.rb | 192 | def assistant_tool_call_messages(chat) | CODE |
| LOW | spec/ruby_llm/uploaded_file_spec.rb | 151 | def stub_default_model_provider(provider, config: RubyLLM.config) | CODE |
| LOW | spec/ruby_llm/chat_tool_attachments_spec.rb | 56 | def messages_with_tool_attachment(path) | CODE |
| LOW | spec/ruby_llm/chat_tool_attachments_spec.rb | 64 | def chat_with_tool_attachment(model, provider, protocol: nil, attachment: image_path) | CODE |
| LOW | …ruby_llm/generators/upgrade_migration_adapters_spec.rb | 37 | def create_migration_class_name(table_name) | 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 | 108 | def expect_broadcasting_model( | CODE |
| LOW | spec/ruby_llm/generators/chat_ui_generator_spec.rb | 143 | def expect_chat_script_to_succeed(script) | CODE |
| LOW | spec/support/models_to_test.rb | 16 | def filter_unrecorded_providers(models) | CODE |
| LOW | spec/support/models_to_test.rb | 36 | def skip_without_cassette_or_key(env_key) | CODE |
| LOW | docs/_core_features/image-generation.md | 248 | def generate_and_attach_image(product, prompt) | CODE |
| LOW | lib/ruby_llm/tool.rb | 319 | def validate_keyword_arguments(arguments) # :nodoc: | CODE |
| LOW | lib/ruby_llm/cost.rb | 80 | def missing_recorded_components(amounts, tokens, total_recorded) | CODE |
| LOW | lib/ruby_llm/streaming.rb | 182 | def build_stream_error_response(parsed_data, env, status) | CODE |
| LOW | lib/ruby_llm/agent.rb | 615 | def apply_passthrough_options(chat) | CODE |
| LOW | lib/ruby_llm/agent.rb | 676 | def apply_assume_model_exists(chat_object) | CODE |
| LOW | lib/ruby_llm/agent.rb | 696 | def resolved_instructions_value(chat_object, runtime, inputs:) | CODE |
| LOW | lib/ruby_llm/model.rb | 207 | def pricing_data_with_long_context(pricing) | CODE |
| LOW | lib/ruby_llm/model.rb | 231 | def normalize_reasoning_options(options) | CODE |
| LOW | lib/ruby_llm/utils.rb | 87 | def iso_date_prefix_to_utc_midnight_string(value) | CODE |
| LOW⚡ | lib/ruby_llm/chat.rb | 1154 | def handle_sequential_tool_calls(tool_calls) | CODE |
| LOW⚡ | lib/ruby_llm/chat.rb | 1163 | def handle_concurrent_tool_calls(tool_calls) | CODE |
| LOW⚡ | lib/ruby_llm/chat.rb | 1171 | def execute_tools_concurrently(tool_calls, &on_result) | CODE |
| LOW⚡ | lib/ruby_llm/chat.rb | 1177 | def execute_tool_with_callbacks(tool_call) | CODE |
| LOW | lib/ruby_llm/chat.rb | 822 | def extract_schema_definition(schema) | CODE |
| LOW | lib/ruby_llm/chat.rb | 1093 | def execute_pending_tool_calls(response) | CODE |
| LOW | lib/ruby_llm/chat.rb | 1107 | def partition_pending_tool_calls(pending) | CODE |
| LOW | lib/ruby_llm/chat.rb | 1134 | def record_tool_call_decision(tool_call, decision) | CODE |
| LOW | lib/ruby_llm/chat.rb | 1240 | def normalize_tool_concurrency(concurrency) | CODE |
| LOW | lib/ruby_llm/chat.rb | 1270 | def tool_name_for_choice_class(tool_class) | CODE |
| LOW | lib/ruby_llm/stream_accumulator.rb | 113 | def parse_tool_call_arguments(arguments, response) | CODE |
| LOW | lib/ruby_llm/stream_accumulator.rb | 143 | def initial_tool_call_arguments(tool_call) | CODE |
| LOW | lib/ruby_llm/stream_accumulator.rb | 150 | def append_tool_call_fragment(stream_key, tool_call) | CODE |
| LOW | lib/ruby_llm/stream_accumulator.rb | 186 | def append_thinking_from_chunk(chunk) | CODE |
| LOW | lib/ruby_llm/protocol.rb | 393 | def resolve_server_tools_for_request(entries) | CODE |
| LOW | lib/ruby_llm/protocol.rb | 417 | def merge_server_tool_entries(payload, entries) | CODE |
| LOW | lib/ruby_llm/protocol.rb | 439 | def apply_before_request_hooks(payload, hooks) | CODE |
| LOW | lib/ruby_llm/protocol.rb | 499 | def provider_file_upload_options(_attachment) | CODE |
| LOW | lib/ruby_llm/protocol.rb | 557 | def parse_completion_response(response) | CODE |
| LOW | lib/ruby_llm/provider.rb | 517 | def configured_remote_providers(config) # :nodoc: | CODE |
| LOW | lib/ruby_llm/models.rb | 247 | def models_dev_provider_models(provider_key, provider_data) # :nodoc: | CODE |
| LOW | lib/ruby_llm/models.rb | 368 | def augment_model_capabilities(model) # :nodoc: | CODE |
| LOW | lib/ruby_llm/models.rb | 384 | def models_dev_reported_capabilities(models_dev_model) # :nodoc: | CODE |
| LOW | lib/ruby_llm/models.rb | 394 | def normalize_embedding_modalities(data) # :nodoc: | CODE |
| LOW | lib/ruby_llm/models.rb | 416 | def models_dev_model_attributes(model_data, provider_slug, provider_key) # :nodoc: | CODE |
| LOW | lib/ruby_llm/models.rb | 483 | def models_dev_text_tokens_pricing(text_standard, cost) # :nodoc: | CODE |
| LOW | lib/ruby_llm/models.rb | 518 | def normalize_models_dev_modalities(modalities) # :nodoc: | CODE |
| LOW | lib/ruby_llm/models.rb | 527 | def normalize_models_dev_knowledge(value) # :nodoc: | CODE |
| LOW | lib/ruby_llm/models.rb | 801 | def resolve_provider_registry_id(model_id, provider, config = nil) | CODE |
| LOW | lib/ruby_llm/provider_generator_cli.rb | 121 | def initialize_git_repository(destination) | CODE |
| LOW | lib/ruby_llm/configuration.rb | 42 | def register_provider_options(options) # :nodoc: | CODE |
| LOW | lib/ruby_llm/providers/openai.rb | 114 | def batch_protocol_for_stored_batch(id) | CODE |
| LOW | lib/ruby_llm/providers/openai.rb | 119 | def batch_protocol_for_endpoint(endpoint) | CODE |
| LOW | lib/ruby_llm/providers/vertexai.rb | 147 | def batch_protocol_for_model_path(model_path) | CODE |
| LOW | lib/ruby_llm/providers/openrouter/chat.rb | 30 | def log_ignored_compaction_options(compaction) | CODE |
| LOW | lib/ruby_llm/providers/openrouter/chat.rb | 189 | def extract_thinking_signature(message_data) | CODE |
| LOW | lib/ruby_llm/providers/openrouter/models.rb | 42 | def parse_list_models_response(response, slug) | CODE |
| LOW | lib/ruby_llm/providers/openrouter/models.rb | 92 | def supported_parameters_to_capabilities(params) | CODE |
| 141 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/seeds.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/ruby_llm.rb | 41 | loader.ignore("#{__dir__}/ruby_llm/railtie.rb") | COMMENT |
| LOW | lib/ruby_llm.rb | 61 | # | COMMENT |
| LOW | lib/ruby_llm.rb | 81 | # == Rails | COMMENT |
| LOW | lib/ruby_llm.rb | 101 | Instrumentation.instrument(...) | COMMENT |
| LOW | lib/ruby_llm.rb | 121 | # Runs ordinary Ruby code as a named, instrumented workflow. Every RubyLLM | COMMENT |
| LOW | lib/ruby_llm.rb | 141 | # no arguments, uses the configured default model. | COMMENT |
| LOW | lib/ruby_llm.rb | 161 | COMMENT | |
| LOW | lib/ruby_llm.rb | 181 | # embedding.vectors # => [0.018, -0.027, ...] | COMMENT |
| LOW | lib/ruby_llm.rb | 201 | # | COMMENT |
| LOW | lib/ruby_llm.rb | 221 | # to Video.animate. | COMMENT |
| LOW | lib/ruby_llm.rb | 241 | COMMENT | |
| LOW | lib/ruby_llm.rb | 261 | # end | COMMENT |
| LOW | lib/ruby_llm.rb | 281 | # model: "voyageai/rerank-2.5-lite", provider: :openrouter) | COMMENT |
| LOW | lib/ruby_llm.rb | 301 | # content = RubyLLM.download(file.id) | COMMENT |
| LOW | lib/ruby_llm.rb | 321 | # | COMMENT |
| LOW | lib/ruby_llm.rb | 341 | end | COMMENT |
| LOW | lib/ruby_llm/image.rb | 21 | # inline, or +nil+. | COMMENT |
| LOW | lib/ruby_llm/image.rb | 41 | # an Array of Images instead of one. +with:+ passes one or more source | COMMENT |
| LOW | lib/ruby_llm/image.rb | 141 | # Writes the binary image to +path+, expanding it first. Returns | COMMENT |
| LOW | lib/ruby_llm/video_job.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/ruby_llm/video_job.rb | 21 | # The id of the model rendering the video. | COMMENT |
| LOW | lib/ruby_llm/tool.rb | 21 | # class Weather < RubyLLM::Tool | COMMENT |
| LOW | lib/ruby_llm/tool.rb | 81 | end | COMMENT |
| LOW | lib/ruby_llm/tool.rb | 101 | # (defaults to <tt>'string'</tt>), +description:+, and +required:+ | COMMENT |
| LOW | lib/ruby_llm/tool.rb | 121 | # schematist DSL. Returns +self+. | COMMENT |
| LOW | lib/ruby_llm/tool.rb | 141 | @parameters_schema_definition = SchemaDefinition.new(schema:, block:) | COMMENT |
| LOW | lib/ruby_llm/tool.rb | 161 | # execute, +false+ to deny, or +nil+ while the decision is pending. | COMMENT |
| LOW | lib/ruby_llm/fallback.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/ruby_llm/video.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/ruby_llm/video.rb | 21 | # The MIME type of the video, such as <tt>"video/mp4"</tt>. | COMMENT |
| LOW | lib/ruby_llm/video.rb | 41 | # +model:+ selects the video model and defaults to the configured | COMMENT |
| LOW | lib/ruby_llm/cost.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/ruby_llm/cost.rb | 21 | # every response), #total returns the reported amount instead of a | COMMENT |
| LOW | lib/ruby_llm/tool_call.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/ruby_llm/workflow.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/ruby_llm/speech.rb | 41 | @data = data | 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 | end | COMMENT |
| LOW | lib/ruby_llm/agent.rb | 121 | @chat_kwargs = options | COMMENT |
| LOW | lib/ruby_llm/agent.rb | 141 | # Called with no arguments, returns the configured options. | COMMENT |
| LOW | lib/ruby_llm/agent.rb | 161 | COMMENT | |
| LOW | lib/ruby_llm/agent.rb | 181 | end | COMMENT |
| LOW | lib/ruby_llm/agent.rb | 221 | end | COMMENT |
| LOW | lib/ruby_llm/agent.rb | 261 | COMMENT | |
| LOW | lib/ruby_llm/agent.rb | 301 | # | COMMENT |
| LOW | lib/ruby_llm/agent.rb | 361 | # declared names. | COMMENT |
| LOW | lib/ruby_llm/agent.rb | 381 | # raise | COMMENT |
| LOW | lib/ruby_llm/agent.rb | 461 | COMMENT | |
| 88 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/_reference/upgrading.md | 469 | See [Driving the Loop Yourself]({% link _advanced/agentic-workflows.md %}#driving-the-loop-yourself) and [Agent Handoffs | CODE |
| MEDIUM | docs/_advanced/error-handling.md | 93 | # Reduce prompt size or use a model with a larger context window | COMMENT |
| MEDIUM | docs/_core_features/embeddings.md | 246 | embedding_result = RubyLLM.embed(content) # Uses default embedding model | CODE |
| MEDIUM | docs/_core_features/citations.md | 67 | ## Citing Tool Results (RAG) | COMMENT |
| MEDIUM | lib/ruby_llm/tool.rb | 146 | # agentic loop parks the tool call until a decision is recorded with | COMMENT |
| MEDIUM | lib/ruby_llm/workflow.rb | 5 | # orchestration in ordinary Ruby code. | 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 | 118 | # agentic loop to completion, executing tool calls along the way. | COMMENT |
| MEDIUM | lib/ruby_llm/chat.rb | 191 | # Runs the agentic loop until #complete? is +true+ and returns the last | COMMENT |
| MEDIUM | lib/ruby_llm/chat.rb | 478 | # going instead of overflowing the context window. The provider condenses | COMMENT |
| MEDIUM | lib/ruby_llm/error.rb | 108 | # Raised when the request exceeds the model's context window or token | COMMENT |
| MEDIUM | lib/ruby_llm/embedding.rb | 76 | # +model:+ selects the embedding model and defaults to the | COMMENT |
| MEDIUM | lib/ruby_llm/embedding_request.rb | 21 | # The Model of the embedding model the request targets. | COMMENT |
| MEDIUM | lib/ruby_llm/providers/openrouter/chat.rb | 22 | # would overflow the model's context window. It summarizes nothing | COMMENT |
| MEDIUM | lib/ruby_llm/providers/xai/responses.rb | 7 | # Grok models. Usage counts agentic tool activity. | COMMENT |
| MEDIUM | lib/generators/ruby_llm/generator_helpers.rb | 170 | # 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 | 43 | # - `scaffold` should stay close to Rails scaffold ERB output. | COMMENT |
| MEDIUM | lib/generators/ruby_llm/chat_ui/chat_ui_generator.rb | 44 | # - `tailwind` should stay close to tailwindcss-rails scaffold output. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | spec/ruby_llm/chat_error_spec.rb | 73 | # Create a huge conversation (matching <MASSIVE_TEXT> in spec_helper) | COMMENT |
| MEDIUM | spec/ruby_llm/chat_error_spec.rb | 76 | # Create a few copies in the conversation | COMMENT |
| MEDIUM | spec/ruby_llm/models_refresh_spec.rb | 169 | # Create a temporary file for testing | COMMENT |
| MEDIUM | spec/ruby_llm/chat_schema_spec.rb | 5 | # Define a test schema class for testing Schematist::Schema instances | 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 |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| CRITICAL | lib/generators/ruby_llm/generator_helpers.rb | 130 | Rails.application.config.generators.options.dig(:active_record, :primary_key_type) || :bigint | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | .github/pull_request_template.md | 38 | ## AI-generated code | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | spec/ruby_llm/chat_tools_spec.rb | 709 | expect(response.content).to match(/simple PDF file|Lorem ipsum/i) | CODE |
| LOW | docs/_getting_started/configuration-providers.md | 198 | config.openai_api_key = ENV['CUSTOM_API_KEY'] # Or 'dummy-key' if not required | CODE |
| LOW | docs/_getting_started/configuration-providers.md | 216 | config.openai_api_key = "dummy-key" # If required by your server | CODE |