Skip to content

[BOT ISSUE] llm.rb gem not instrumented #140

Description

@braintrust-bot

Summary

The llm.rb gem (RubyGems: llm.rb) is an actively maintained Ruby toolkit for building LLM-powered systems that is not instrumented by this SDK. It is a distinct library from ruby_llm (crmne/ruby_llm), which is already instrumented.

llm.rb has 69K+ downloads, reached v4.11.0 (April 2026), and provides execution-oriented API surfaces across 8 providers.

What is missing

No instrumentation exists for any llm.rb execution surface. Key APIs that should be instrumented:

Chat / Completions

  • LLM::Context#chat — stateful chat with conversation history
  • Streaming responses via structured callbacks
  • Stateless completions

Tool Calling

  • Automatic tool orchestration across providers
  • Concurrent tool execution (threads, fibers, async)
  • Tool execution during streaming

Embeddings

  • LLM::Provider#embed — vector embeddings generation

Agents

  • Reusable, preconfigured assistants with tool auto-execution

Supported Providers

OpenAI, Anthropic, Google, DeepSeek, xAI, zAI, Ollama, LlamaCpp

Braintrust docs status

not_found — No mention of llm.rb or llmrb anywhere in Braintrust documentation at https://www.braintrust.dev/docs. The Braintrust SDK integrations page at https://www.braintrust.dev/docs/integrations/sdk-integrations lists "Ruby LLM" (which refers to the ruby_llm gem, a different library).

Upstream sources

Local repo files inspected

  • lib/braintrust/contrib.rb (lines 195–205) — registers only 4 integrations: OpenAI, RubyOpenAI, RubyLLM, Anthropic. No llm.rb integration.
  • lib/braintrust/contrib/ — no directory or files for llm_rb or llmrb
  • Appraisals — no appraisal scenarios for llm.rb
  • braintrust.gemspec — no mention of llm.rb

Notes

llm.rb has built-in OpenTelemetry support, so users can get basic tracing via Braintrust's OTEL integration. However, dedicated instrumentation would capture richer provider-specific metadata (model parameters, token usage breakdowns, tool execution details, cost tracking) consistent with how the SDK instruments ruby_llm, openai, and anthropic today.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions