Repository Analysis

crmne/ruby_llm

One delightful Ruby framework for every major AI provider. Build AI agents, chatbots, RAG apps, and multimodal workflows in beautiful, expressive code.

4.8 Likely human-written View on GitHub

Analysis Overview

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).

4.8
Adjusted Score
4.8
Raw Score
100%
Time Factor
2026-08-28
Last Push
4.3K
Stars
Ruby
Language
91.9K
Lines of Code
594
Files
380
Pattern Hits
2026-08-29
Scan Date
0.00
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 1HIGH 1MEDIUM 26LOW 352

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 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.

Hyper-Verbose Identifiers201 hits · 205 pts
SeverityFileLineSnippetContext
LOWspec/ruby_llm/chat_tools_spec.rb6 def skip_unless_supports_functions(provider, model)CODE
LOWspec/ruby_llm/chat_tools_spec.rb192 def assistant_tool_call_messages(chat)CODE
LOWspec/ruby_llm/uploaded_file_spec.rb151 def stub_default_model_provider(provider, config: RubyLLM.config)CODE
LOWspec/ruby_llm/chat_tool_attachments_spec.rb56 def messages_with_tool_attachment(path)CODE
LOWspec/ruby_llm/chat_tool_attachments_spec.rb64 def chat_with_tool_attachment(model, provider, protocol: nil, attachment: image_path)CODE
LOW…ruby_llm/generators/upgrade_migration_adapters_spec.rb37 def create_migration_class_name(table_name)CODE
LOWspec/ruby_llm/generators/chat_ui_generator_spec.rb14 def expect_messages_helper_content(path)CODE
LOWspec/ruby_llm/generators/chat_ui_generator_spec.rb27 def expect_generated_view_set( # rubocop:disable Metrics/AbcSizeCODE
LOWspec/ruby_llm/generators/chat_ui_generator_spec.rb108 def expect_broadcasting_model(CODE
LOWspec/ruby_llm/generators/chat_ui_generator_spec.rb143 def expect_chat_script_to_succeed(script)CODE
LOWspec/support/models_to_test.rb16def filter_unrecorded_providers(models)CODE
LOWspec/support/models_to_test.rb36def skip_without_cassette_or_key(env_key)CODE
LOWdocs/_core_features/image-generation.md248def generate_and_attach_image(product, prompt)CODE
LOWlib/ruby_llm/tool.rb319 def validate_keyword_arguments(arguments) # :nodoc:CODE
LOWlib/ruby_llm/cost.rb80 def missing_recorded_components(amounts, tokens, total_recorded)CODE
LOWlib/ruby_llm/streaming.rb182 def build_stream_error_response(parsed_data, env, status)CODE
LOWlib/ruby_llm/agent.rb615 def apply_passthrough_options(chat)CODE
LOWlib/ruby_llm/agent.rb676 def apply_assume_model_exists(chat_object)CODE
LOWlib/ruby_llm/agent.rb696 def resolved_instructions_value(chat_object, runtime, inputs:)CODE
LOWlib/ruby_llm/model.rb207 def pricing_data_with_long_context(pricing)CODE
LOWlib/ruby_llm/model.rb231 def normalize_reasoning_options(options)CODE
LOWlib/ruby_llm/utils.rb87 def iso_date_prefix_to_utc_midnight_string(value)CODE
LOWlib/ruby_llm/chat.rb1154 def handle_sequential_tool_calls(tool_calls)CODE
LOWlib/ruby_llm/chat.rb1163 def handle_concurrent_tool_calls(tool_calls)CODE
LOWlib/ruby_llm/chat.rb1171 def execute_tools_concurrently(tool_calls, &on_result)CODE
LOWlib/ruby_llm/chat.rb1177 def execute_tool_with_callbacks(tool_call)CODE
LOWlib/ruby_llm/chat.rb822 def extract_schema_definition(schema)CODE
LOWlib/ruby_llm/chat.rb1093 def execute_pending_tool_calls(response)CODE
LOWlib/ruby_llm/chat.rb1107 def partition_pending_tool_calls(pending)CODE
LOWlib/ruby_llm/chat.rb1134 def record_tool_call_decision(tool_call, decision)CODE
LOWlib/ruby_llm/chat.rb1240 def normalize_tool_concurrency(concurrency)CODE
LOWlib/ruby_llm/chat.rb1270 def tool_name_for_choice_class(tool_class)CODE
LOWlib/ruby_llm/stream_accumulator.rb113 def parse_tool_call_arguments(arguments, response)CODE
LOWlib/ruby_llm/stream_accumulator.rb143 def initial_tool_call_arguments(tool_call)CODE
LOWlib/ruby_llm/stream_accumulator.rb150 def append_tool_call_fragment(stream_key, tool_call)CODE
LOWlib/ruby_llm/stream_accumulator.rb186 def append_thinking_from_chunk(chunk)CODE
LOWlib/ruby_llm/protocol.rb393 def resolve_server_tools_for_request(entries)CODE
LOWlib/ruby_llm/protocol.rb417 def merge_server_tool_entries(payload, entries)CODE
LOWlib/ruby_llm/protocol.rb439 def apply_before_request_hooks(payload, hooks)CODE
LOWlib/ruby_llm/protocol.rb499 def provider_file_upload_options(_attachment)CODE
LOWlib/ruby_llm/protocol.rb557 def parse_completion_response(response)CODE
LOWlib/ruby_llm/provider.rb517 def configured_remote_providers(config) # :nodoc:CODE
LOWlib/ruby_llm/models.rb247 def models_dev_provider_models(provider_key, provider_data) # :nodoc:CODE
LOWlib/ruby_llm/models.rb368 def augment_model_capabilities(model) # :nodoc:CODE
LOWlib/ruby_llm/models.rb384 def models_dev_reported_capabilities(models_dev_model) # :nodoc:CODE
LOWlib/ruby_llm/models.rb394 def normalize_embedding_modalities(data) # :nodoc:CODE
LOWlib/ruby_llm/models.rb416 def models_dev_model_attributes(model_data, provider_slug, provider_key) # :nodoc:CODE
LOWlib/ruby_llm/models.rb483 def models_dev_text_tokens_pricing(text_standard, cost) # :nodoc:CODE
LOWlib/ruby_llm/models.rb518 def normalize_models_dev_modalities(modalities) # :nodoc:CODE
LOWlib/ruby_llm/models.rb527 def normalize_models_dev_knowledge(value) # :nodoc:CODE
LOWlib/ruby_llm/models.rb801 def resolve_provider_registry_id(model_id, provider, config = nil)CODE
LOWlib/ruby_llm/provider_generator_cli.rb121 def initialize_git_repository(destination)CODE
LOWlib/ruby_llm/configuration.rb42 def register_provider_options(options) # :nodoc:CODE
LOWlib/ruby_llm/providers/openai.rb114 def batch_protocol_for_stored_batch(id)CODE
LOWlib/ruby_llm/providers/openai.rb119 def batch_protocol_for_endpoint(endpoint)CODE
LOWlib/ruby_llm/providers/vertexai.rb147 def batch_protocol_for_model_path(model_path)CODE
LOWlib/ruby_llm/providers/openrouter/chat.rb30 def log_ignored_compaction_options(compaction)CODE
LOWlib/ruby_llm/providers/openrouter/chat.rb189 def extract_thinking_signature(message_data)CODE
LOWlib/ruby_llm/providers/openrouter/models.rb42 def parse_list_models_response(response, slug)CODE
LOWlib/ruby_llm/providers/openrouter/models.rb92 def supported_parameters_to_capabilities(params)CODE
141 more matches not shown…
Over-Commented Block148 hits · 143 pts
SeverityFileLineSnippetContext
LOWspec/dummy/config/puma.rb1# frozen_string_literal: trueCOMMENT
LOWspec/dummy/config/puma.rb21# response time (latency) of the application.COMMENT
LOWspec/dummy/config/database.yml21 database: storage/test<%= ENV['TEST_ENV_NUMBER'] %>.sqlite3COMMENT
LOWspec/dummy/config/locales/en.yml1# Files in the config/locales directory are used for internationalization andCOMMENT
LOWspec/dummy/config/locales/en.yml21#COMMENT
LOWspec/dummy/config/environments/production.rb61 # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`COMMENT
LOWspec/dummy/config/environments/test.rb1# frozen_string_literal: trueCOMMENT
LOWspec/dummy/config/initializers/inflections.rb1# frozen_string_literal: trueCOMMENT
LOWspec/dummy/config/initializers/cors.rb1# frozen_string_literal: trueCOMMENT
LOWspec/dummy/db/seeds.rb1# frozen_string_literal: trueCOMMENT
LOWlib/ruby_llm.rb41loader.ignore("#{__dir__}/ruby_llm/railtie.rb")COMMENT
LOWlib/ruby_llm.rb61#COMMENT
LOWlib/ruby_llm.rb81# == RailsCOMMENT
LOWlib/ruby_llm.rb101 Instrumentation.instrument(...)COMMENT
LOWlib/ruby_llm.rb121 # Runs ordinary Ruby code as a named, instrumented workflow. Every RubyLLMCOMMENT
LOWlib/ruby_llm.rb141 # no arguments, uses the configured default model.COMMENT
LOWlib/ruby_llm.rb161COMMENT
LOWlib/ruby_llm.rb181 # embedding.vectors # => [0.018, -0.027, ...]COMMENT
LOWlib/ruby_llm.rb201 #COMMENT
LOWlib/ruby_llm.rb221 # to Video.animate.COMMENT
LOWlib/ruby_llm.rb241COMMENT
LOWlib/ruby_llm.rb261 # endCOMMENT
LOWlib/ruby_llm.rb281 # model: "voyageai/rerank-2.5-lite", provider: :openrouter)COMMENT
LOWlib/ruby_llm.rb301 # content = RubyLLM.download(file.id)COMMENT
LOWlib/ruby_llm.rb321 #COMMENT
LOWlib/ruby_llm.rb341 endCOMMENT
LOWlib/ruby_llm/image.rb21 # inline, or +nil+.COMMENT
LOWlib/ruby_llm/image.rb41 # an Array of Images instead of one. +with:+ passes one or more sourceCOMMENT
LOWlib/ruby_llm/image.rb141 # Writes the binary image to +path+, expanding it first. ReturnsCOMMENT
LOWlib/ruby_llm/video_job.rb1# frozen_string_literal: trueCOMMENT
LOWlib/ruby_llm/video_job.rb21 # The id of the model rendering the video.COMMENT
LOWlib/ruby_llm/tool.rb21 # class Weather < RubyLLM::ToolCOMMENT
LOWlib/ruby_llm/tool.rb81 endCOMMENT
LOWlib/ruby_llm/tool.rb101 # (defaults to <tt>'string'</tt>), +description:+, and +required:+COMMENT
LOWlib/ruby_llm/tool.rb121 # schematist DSL. Returns +self+.COMMENT
LOWlib/ruby_llm/tool.rb141 @parameters_schema_definition = SchemaDefinition.new(schema:, block:)COMMENT
LOWlib/ruby_llm/tool.rb161 # execute, +false+ to deny, or +nil+ while the decision is pending.COMMENT
LOWlib/ruby_llm/fallback.rb1# frozen_string_literal: trueCOMMENT
LOWlib/ruby_llm/video.rb1# frozen_string_literal: trueCOMMENT
LOWlib/ruby_llm/video.rb21 # The MIME type of the video, such as <tt>"video/mp4"</tt>.COMMENT
LOWlib/ruby_llm/video.rb41 # +model:+ selects the video model and defaults to the configuredCOMMENT
LOWlib/ruby_llm/cost.rb1# frozen_string_literal: trueCOMMENT
LOWlib/ruby_llm/cost.rb21 # every response), #total returns the reported amount instead of aCOMMENT
LOWlib/ruby_llm/tool_call.rb1# frozen_string_literal: trueCOMMENT
LOWlib/ruby_llm/workflow.rb1# frozen_string_literal: trueCOMMENT
LOWlib/ruby_llm/speech.rb41 @data = dataCOMMENT
LOWlib/ruby_llm/deprecator.rb21 # Raised when a deprecated API is used andCOMMENT
LOWlib/ruby_llm/agent.rb1# frozen_string_literal: trueCOMMENT
LOWlib/ruby_llm/agent.rb21 # that class instead.COMMENT
LOWlib/ruby_llm/agent.rb101 endCOMMENT
LOWlib/ruby_llm/agent.rb121 @chat_kwargs = optionsCOMMENT
LOWlib/ruby_llm/agent.rb141 # Called with no arguments, returns the configured options.COMMENT
LOWlib/ruby_llm/agent.rb161COMMENT
LOWlib/ruby_llm/agent.rb181 endCOMMENT
LOWlib/ruby_llm/agent.rb221 endCOMMENT
LOWlib/ruby_llm/agent.rb261COMMENT
LOWlib/ruby_llm/agent.rb301 #COMMENT
LOWlib/ruby_llm/agent.rb361 # declared names.COMMENT
LOWlib/ruby_llm/agent.rb381 # raiseCOMMENT
LOWlib/ruby_llm/agent.rb461COMMENT
88 more matches not shown…
Modern AI Meta-Vocabulary20 hits · 58 pts
SeverityFileLineSnippetContext
MEDIUMArchspec.rb10# User-facing objects and orchestration. These are nouns like Chat, Batch,COMMENT
MEDIUMdocs/_reference/upgrading.md469See [Driving the Loop Yourself]({% link _advanced/agentic-workflows.md %}#driving-the-loop-yourself) and [Agent HandoffsCODE
MEDIUMdocs/_advanced/error-handling.md93 # Reduce prompt size or use a model with a larger context windowCOMMENT
MEDIUMdocs/_core_features/embeddings.md246 embedding_result = RubyLLM.embed(content) # Uses default embedding modelCODE
MEDIUMdocs/_core_features/citations.md67## Citing Tool Results (RAG)COMMENT
MEDIUMlib/ruby_llm/tool.rb146 # agentic loop parks the tool call until a decision is recorded withCOMMENT
MEDIUMlib/ruby_llm/workflow.rb5 # orchestration in ordinary Ruby code.COMMENT
MEDIUMlib/ruby_llm/chat.rb18 # #ask runs the agentic loop to completion, executing tool calls until theCOMMENT
MEDIUMlib/ruby_llm/chat.rb118 # agentic loop to completion, executing tool calls along the way.COMMENT
MEDIUMlib/ruby_llm/chat.rb191 # Runs the agentic loop until #complete? is +true+ and returns the lastCOMMENT
MEDIUMlib/ruby_llm/chat.rb478 # going instead of overflowing the context window. The provider condensesCOMMENT
MEDIUMlib/ruby_llm/error.rb108 # Raised when the request exceeds the model's context window or tokenCOMMENT
MEDIUMlib/ruby_llm/embedding.rb76 # +model:+ selects the embedding model and defaults to theCOMMENT
MEDIUMlib/ruby_llm/embedding_request.rb21 # The Model of the embedding model the request targets.COMMENT
MEDIUMlib/ruby_llm/providers/openrouter/chat.rb22 # would overflow the model's context window. It summarizes nothingCOMMENT
MEDIUMlib/ruby_llm/providers/xai/responses.rb7 # Grok models. Usage counts agentic tool activity.COMMENT
MEDIUMlib/generators/ruby_llm/generator_helpers.rb170 # scaffold conventions without complicating scaffold templates.COMMENT
MEDIUMlib/generators/ruby_llm/chat_ui/chat_ui_generator.rb8 # Generates a simple chat UI scaffold for RubyLLMCOMMENT
MEDIUMlib/generators/ruby_llm/chat_ui/chat_ui_generator.rb43 # - `scaffold` should stay close to Rails scaffold ERB output.COMMENT
MEDIUMlib/generators/ruby_llm/chat_ui/chat_ui_generator.rb44 # - `tailwind` should stay close to tailwindcss-rails scaffold output.COMMENT
Self-Referential Comments6 hits · 18 pts
SeverityFileLineSnippetContext
MEDIUMspec/ruby_llm/chat_error_spec.rb73 # Create a huge conversation (matching <MASSIVE_TEXT> in spec_helper)COMMENT
MEDIUMspec/ruby_llm/chat_error_spec.rb76 # Create a few copies in the conversationCOMMENT
MEDIUMspec/ruby_llm/models_refresh_spec.rb169 # Create a temporary file for testingCOMMENT
MEDIUMspec/ruby_llm/chat_schema_spec.rb5# Define a test schema class for testing Schematist::Schema instancesCOMMENT
MEDIUM…ec/ruby_llm/active_record/acts_as_with_context_spec.rb37 # Create a different API key in custom contextCOMMENT
MEDIUMspec/ruby_llm/protocols/gemini/chat_spec.rb8 # Create a test object that includes the module to access private methodsCOMMENT
Hallucination Indicators1 hit · 10 pts
SeverityFileLineSnippetContext
CRITICALlib/generators/ruby_llm/generator_helpers.rb130 Rails.application.config.generators.options.dig(:active_record, :primary_key_type) || :bigintCODE
Synthetic Comment Markers1 hit · 8 pts
SeverityFileLineSnippetContext
HIGH.github/pull_request_template.md38## AI-generated codeCOMMENT
Fake / Example Data3 hits · 3 pts
SeverityFileLineSnippetContext
LOWspec/ruby_llm/chat_tools_spec.rb709 expect(response.content).to match(/simple PDF file|Lorem ipsum/i)CODE
LOWdocs/_getting_started/configuration-providers.md198 config.openai_api_key = ENV['CUSTOM_API_KEY'] # Or 'dummy-key' if not requiredCODE
LOWdocs/_getting_started/configuration-providers.md216 config.openai_api_key = "dummy-key" # If required by your serverCODE