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.

6.0 Low AI signal View on GitHub

Analysis Overview

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

6.0
Adjusted Score
6.0
Raw Score
100%
Time Factor
2026-07-14
Last Push
4.2K
Stars
Ruby
Language
60.9K
Lines of Code
446
Files
305
Pattern Hits
2026-07-14
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 0HIGH 1MEDIUM 25LOW 279

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

Hyper-Verbose Identifiers156 hits · 163 pts
SeverityFileLineSnippetContext
LOWspec/ruby_llm/chat_tools_spec.rb5def skip_unless_supports_functions(provider, model)CODE
LOWspec/ruby_llm/chat_tools_spec.rb178 def assistant_tool_call_messages(chat)CODE
LOWspec/ruby_llm/uploaded_file_spec.rb113 def stub_default_model_provider(provider, config: RubyLLM.config)CODE
LOWspec/ruby_llm/chat_tool_attachments_spec.rb64 def chat_with_tool_attachment(model, provider, protocol: nil)CODE
LOWspec/ruby_llm/active_record/acts_as_spec.rb90 def complete_assistant_message(chat, input_tokens: 1_000, output_tokens: 2_000, content: 'Hi')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.rb96 def expect_broadcasting_model(CODE
LOWspec/ruby_llm/generators/chat_ui_generator_spec.rb131 def expect_chat_script_to_succeed(script)CODE
LOWdocs/_advanced/rails-persistence.md478 def persist_message_completion(message)CODE
LOWdocs/_core_features/image-generation.md225def generate_and_attach_image(product, prompt)CODE
LOWlib/ruby_llm/tool.rb227 def validate_keyword_arguments(arguments) # :nodoc:CODE
LOWlib/ruby_llm/streaming.rb138 def build_stream_error_response(parsed_data, env, status)CODE
LOWlib/ruby_llm/agent.rb453 def apply_passthrough_options(llm_chat)CODE
LOWlib/ruby_llm/agent.rb508 def apply_assume_model_exists(chat_object)CODE
LOWlib/ruby_llm/agent.rb528 def resolved_instructions_value(chat_object, runtime, inputs:)CODE
LOWlib/ruby_llm/agent.rb561 def runtime_instruction_target(chat_object)CODE
LOWlib/ruby_llm/model.rb196 def normalize_reasoning_options(options)CODE
LOWlib/ruby_llm/utils.rb75 def iso_date_prefix_to_utc_midnight_string(value)CODE
LOWlib/ruby_llm/chat.rb654 def extract_schema_definition(schema)CODE
LOWlib/ruby_llm/chat.rb857 def execute_pending_tool_calls(response)CODE
LOWlib/ruby_llm/chat.rb867 def handle_sequential_tool_calls(tool_calls)CODE
LOWlib/ruby_llm/chat.rb875 def handle_concurrent_tool_calls(tool_calls)CODE
LOWlib/ruby_llm/chat.rb882 def execute_tools_concurrently(tool_calls, &on_result)CODE
LOWlib/ruby_llm/chat.rb888 def execute_tool_with_callbacks(tool_call)CODE
LOWlib/ruby_llm/chat.rb956 def normalize_tool_concurrency(concurrency)CODE
LOWlib/ruby_llm/chat.rb986 def tool_name_for_choice_class(tool_class)CODE
LOWlib/ruby_llm/stream_accumulator.rb102 def parse_tool_call_arguments(arguments, response)CODE
LOWlib/ruby_llm/stream_accumulator.rb133 def initial_tool_call_arguments(tool_call)CODE
LOWlib/ruby_llm/stream_accumulator.rb140 def append_tool_call_fragment(stream_key, tool_call)CODE
LOWlib/ruby_llm/stream_accumulator.rb177 def append_text_with_thinking(text)CODE
LOWlib/ruby_llm/stream_accumulator.rb183 def append_thinking_from_chunk(chunk)CODE
LOWlib/ruby_llm/stream_accumulator.rb225 def consume_non_think_content(remaining, start_tag, output)CODE
LOWlib/ruby_llm/protocol.rb159 def maybe_normalize_temperature(temperature, _model)CODE
LOWlib/ruby_llm/protocol.rb180 def apply_before_request_hooks(payload, hooks)CODE
LOWlib/ruby_llm/protocol.rb218 def provider_file_upload_options(_attachment)CODE
LOWlib/ruby_llm/protocol.rb264 def parse_completion_response(response)CODE
LOWlib/ruby_llm/provider.rb454 def configured_remote_providers(config) # :nodoc:CODE
LOWlib/ruby_llm/models.rb313 def normalize_embedding_modalities(data) # :nodoc:CODE
LOWlib/ruby_llm/models.rb335 def models_dev_model_attributes(model_data, provider_slug, provider_key) # :nodoc:CODE
LOWlib/ruby_llm/models.rb419 def normalize_models_dev_modalities(modalities) # :nodoc:CODE
LOWlib/ruby_llm/models.rb428 def normalize_models_dev_knowledge(value) # :nodoc:CODE
LOWlib/ruby_llm/models.rb565 def resolve_provider_registry_id(model_id, provider)CODE
LOWlib/ruby_llm/configuration.rb42 def register_provider_options(options) # :nodoc:CODE
LOWlib/ruby_llm/providers/openai.rb79 def batch_protocol_for_stored_batch(id)CODE
LOWlib/ruby_llm/providers/openai.rb84 def batch_protocol_for_endpoint(endpoint)CODE
LOWlib/ruby_llm/providers/vertexai.rb128 def batch_protocol_for_model_path(model_path)CODE
LOWlib/ruby_llm/providers/gemini/capabilities.rb50 def critical_capabilities_for(model_id)CODE
LOWlib/ruby_llm/providers/openrouter/chat.rb149 def extract_thinking_signature(message_data)CODE
LOWlib/ruby_llm/providers/openrouter/models.rb14 def parse_list_models_response(response, slug, _capabilities)CODE
LOWlib/ruby_llm/providers/openrouter/models.rb59 def supported_parameters_to_capabilities(params)CODE
LOWlib/ruby_llm/providers/deepseek/capabilities.rb31 def critical_capabilities_for(model_id)CODE
LOWlib/ruby_llm/providers/xai/models.rb10 def parse_list_models_response(response, slug, _capabilities)CODE
LOWlib/ruby_llm/providers/bedrock/embedding_protocol.rb16 def parse_single_embedding_responses(responses, model:, text:)CODE
LOWlib/ruby_llm/providers/bedrock/embedding_protocol.rb24 def deep_merge_provider_options(payload, provider_options)CODE
LOWlib/ruby_llm/providers/bedrock/models.rb20 def parse_list_models_response(response, slug, _capabilities)CODE
LOWlib/ruby_llm/providers/bedrock/models.rb72 def normalize_inference_profile_id(model_id, inference_types, region)CODE
LOWlib/ruby_llm/providers/vertexai/batch_prediction.rb116 def vertex_batch_result_index(line, fallback_index)CODE
LOWlib/ruby_llm/providers/vertexai/batch_prediction.rb121 def parse_vertex_batch_result(_line, _fallback_index)CODE
LOWlib/ruby_llm/providers/vertexai/models.rb120 def build_model_from_api_data(model_data, model_id)CODE
96 more matches not shown…
Over-Commented Block121 hits · 118 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/schema.rb1# frozen_string_literal: trueCOMMENT
LOWspec/dummy/db/seeds.rb1# frozen_string_literal: trueCOMMENT
LOWlib/ruby_llm.rb41# RubyLLM is a Ruby interface to large language models. One API forCOMMENT
LOWlib/ruby_llm.rb61# configured chat (model, instructions, tools, schema) into a reusableCOMMENT
LOWlib/ruby_llm.rb101 # own configuration.COMMENT
LOWlib/ruby_llm.rb121 # chat = RubyLLM.chat(model: 'claude-sonnet-4-5')COMMENT
LOWlib/ruby_llm.rb141 # forwarded to Embedding.embed.COMMENT
LOWlib/ruby_llm.rb161 # are forwarded to Image.paint.COMMENT
LOWlib/ruby_llm.rb181 # forwarded to Transcription.transcribe.COMMENT
LOWlib/ruby_llm.rb201 # forwarded to UploadedFile.download.COMMENT
LOWlib/ruby_llm.rb221 Prompt.render(name, **locals)COMMENT
LOWlib/ruby_llm/image.rb1# frozen_string_literal: trueCOMMENT
LOWlib/ruby_llm/image.rb21 # The MIME type of the image data, such as <tt>"image/png"</tt>.COMMENT
LOWlib/ruby_llm/image.rb41 # supplies a Context whose configuration replaces the global one.COMMENT
LOWlib/ruby_llm/tool.rb21 # class Weather < RubyLLM::ToolCOMMENT
LOWlib/ruby_llm/tool.rb41COMMENT
LOWlib/ruby_llm/tool.rb61COMMENT
LOWlib/ruby_llm/tool.rb81 # Sets the JSON Schema for the tool's arguments. Accepts a schema hash,COMMENT
LOWlib/ruby_llm/tool.rb101 endCOMMENT
LOWlib/ruby_llm/fallback.rb1# frozen_string_literal: trueCOMMENT
LOWlib/ruby_llm/cost.rb1# frozen_string_literal: trueCOMMENT
LOWlib/ruby_llm/cost.rb21 PER_MILLION = 1_000_000.0 # :nodoc:COMMENT
LOWlib/ruby_llm/cost.rb161 # input tokens.COMMENT
LOWlib/ruby_llm/tool_call.rb1# frozen_string_literal: trueCOMMENT
LOWlib/ruby_llm/speech.rb41 @format = (format || 'mp3').to_sCOMMENT
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.rb101COMMENT
LOWlib/ruby_llm/agent.rb121 # instructions { "You are helping #{workspace.name}" }COMMENT
LOWlib/ruby_llm/agent.rb161 # the configured value.COMMENT
LOWlib/ruby_llm/agent.rb181 @citations = valueCOMMENT
LOWlib/ruby_llm/agent.rb221 # DSL; a lambda is evaluated when the chat is built. Called with noCOMMENT
LOWlib/ruby_llm/agent.rb321COMMENT
LOWlib/ruby_llm/agent.rb601 @resolved_chat_model = case @chat_modelCOMMENT
LOWlib/ruby_llm/agent.rb641COMMENT
LOWlib/ruby_llm/agent.rb661 # Returns the structured output schema set on the chat. See Chat#schema.COMMENT
LOWlib/ruby_llm/agent.rb681 # Registers tools on the chat. See Chat#with_tools.COMMENT
LOWlib/ruby_llm/agent.rb701 # Switches the chat to a different model. See Chat#with_model.COMMENT
LOWlib/ruby_llm/agent.rb721 # Clears the thinking configuration. See Chat#without_thinking.COMMENT
LOWlib/ruby_llm/agent.rb741 # Disables prompt caching. See Chat#without_caching.COMMENT
LOWlib/ruby_llm/agent.rb761 #COMMENT
LOWlib/ruby_llm/agent.rb781 #COMMENT
LOWlib/ruby_llm/agent.rb801 #COMMENT
LOWlib/ruby_llm/agent.rb821 #COMMENT
LOWlib/ruby_llm/agent.rb841 #COMMENT
LOWlib/ruby_llm/thinking.rb1# frozen_string_literal: trueCOMMENT
LOWlib/ruby_llm/model.rb1# frozen_string_literal: trueCOMMENT
LOWlib/ruby_llm/model.rb121 # tokens, or +nil+ if the registry has no such price. Valid kinds areCOMMENT
LOWlib/ruby_llm/uploaded_file.rb1# frozen_string_literal: trueCOMMENT
LOWlib/ruby_llm/uploaded_file.rb181 endCOMMENT
61 more matches not shown…
Modern AI Meta-Vocabulary14 hits · 41 pts
SeverityFileLineSnippetContext
MEDIUMArchspec.rb10# User-facing objects and orchestration. These are nouns like Chat, Batch,COMMENT
MEDIUMdocs/_advanced/error-handling.md98 # Reduce prompt size or use a model with a larger context windowCOMMENT
MEDIUMdocs/_core_features/embeddings.md235 embedding_result = RubyLLM.embed(content) # Uses default embedding modelCODE
MEDIUMdocs/_core_features/citations.md79## Citing Tool Results (RAG)COMMENT
MEDIUMlib/ruby_llm/agent.rb832 # Runs the agentic loop until nothing is left to do. See Chat#complete.COMMENT
MEDIUMlib/ruby_llm/chat.rb18 # #ask runs the agentic loop to completion, executing tool calls until theCOMMENT
MEDIUMlib/ruby_llm/chat.rb94 # agentic loop to completion, executing tool calls along the way.COMMENT
MEDIUMlib/ruby_llm/chat.rb153 # Runs the agentic loop until #complete? is +true+ and returns the lastCOMMENT
MEDIUMlib/ruby_llm/error.rb87 # Raised when the request exceeds the model's context window or tokenCOMMENT
MEDIUMlib/ruby_llm/embedding.rb46 # +model:+ selects the embedding model and defaults to theCOMMENT
MEDIUMlib/generators/ruby_llm/generator_helpers.rb175 # 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.rb45 # - `scaffold` should stay close to Rails scaffold ERB output.COMMENT
MEDIUMlib/generators/ruby_llm/chat_ui/chat_ui_generator.rb46 # - `tailwind` should stay close to tailwindcss-rails scaffold output.COMMENT
Self-Referential Comments11 hits · 33 pts
SeverityFileLineSnippetContext
MEDIUMspec/dummy/db/schema.rb3# This file is auto-generated from the current state of the database. InsteadCOMMENT
MEDIUMspec/dummy/db/schema.rb7# This file is the source Rails uses to define your schema when running `bin/railsCOMMENT
MEDIUMspec/ruby_llm/chat_error_spec.rb79 # Create a huge conversation (matching <MASSIVE_TEXT> in spec_helper)COMMENT
MEDIUMspec/ruby_llm/chat_error_spec.rb82 # Create a few copies in the conversationCOMMENT
MEDIUMspec/ruby_llm/models_refresh_spec.rb156 # Create a temporary file for testingCOMMENT
MEDIUMspec/ruby_llm/chat_schema_spec.rb5# Define a test schema class for testing RubyLLM::Schema instancesCOMMENT
MEDIUMspec/ruby_llm/active_record/acts_as_spec.rb512 # Define a second tool for testingCOMMENT
MEDIUMspec/ruby_llm/active_record/acts_as_spec.rb1337 # Create a known model firstCOMMENT
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
MEDIUMlib/ruby_llm/active_record/batch_methods.rb12 # Creating the record submits the staged chats to the provider in theCOMMENT
Synthetic Comment Markers1 hit · 8 pts
SeverityFileLineSnippetContext
HIGH.github/pull_request_template.md38## AI-generated codeCOMMENT
Fake / Example Data2 hits · 2 pts
SeverityFileLineSnippetContext
LOWdocs/_getting_started/configuration-providers.md147 config.openai_api_key = ENV['CUSTOM_API_KEY'] # Or 'dummy-key' if not requiredCODE
LOWdocs/_getting_started/configuration-providers.md165 config.openai_api_key = "dummy-key" # If required by your serverCODE