Changelog
Unreleased
Changes since v5.4.0.
v5.4.0
Changes since v5.3.0.
This release expands tracer support around agentic execution. It
lets LLM::Agent define scoped tracers through the agent
DSL and fixes concurrent tool execution so those scoped tracers stay
attached when work crosses thread, task, fiber, and skill
boundaries.
Change
- Add agent-scoped tracers
LetLLM::Agentclasses definetracer ...ortracer { ... }so an agent can carry its own tracer without replacing the provider's default tracer. The resolved tracer is scoped to that agent's turns, tool loops, and pending tool access. Available through theacts_as_agentand Sequel agent plugintracerDSL too.
Fix
- Preserve scoped tracers across concurrent tool
work
Keep agent- and request-scoped tracers attached when tool execution crosses:thread,:task, or:fiberboundaries, including skill execution, so spawned work does not fall back to the provider default tracer.
v5.3.0
Changes since v5.2.1.
This release deepens llm.rb's request-rewriting and tool-definition
surface. It adds transformer lifecycle hooks to
LLM::Stream so UIs can surface work like PII scrubbing
before a request is sent, and it adds a more explicit OmniAI-style tool
DSL form with parameter plus separate
required declarations while keeping the older param
... required: true style working.
Change
-
Add transformer stream lifecycle hooks
Addon_transformandon_transform_finishtoLLM::Streamso UIs can surface request rewriting work such as PII scrubbing before a request is sent to the model. -
Add a separate
requiredtool DSL form
Addparameteras an alias ofparamand supportrequired %i[...]as a separate declaration, inspired by OmniAI-style tools, while keeping the existingparam ... required: trueform working too.
v5.2.1
Changes since v5.2.0.
This release tightens the streamed queue fix from
v5.2.0 for concurrent workloads. Request-local streams now
stay bound long enough for wait to drain queued work and
then clear cleanly so later waits fall back to the context's configured
stream.
Fix
- Reset request-local streams after
waitdrains queued work
Keep per-callstream:bindings alive throughLLM::Context#waitso queued streamed tool work still resolves correctly, then clear the request-local stream after the wait completes to avoid leaking it into later turns.
v5.2.0
Changes since v5.1.0.
This release adds current DeepSeek V4 support through refreshed
provider metadata, including deepseek-v4-flash and
deepseek-v4-pro, while fixing request-local queue handling
for concurrent streamed workloads so wait and interruption
use the active per-call stream correctly.
Change
-
Add
LLM::MCP#runfor scoped MCP client lifecycle
AddLLM::MCP#runso MCP clients can be started for the duration of a block and then stopped automatically, which simplifies the usualstart/stoppattern in examples and application code. -
Refresh provider model metadata
Add current DeepSeek and OpenAI model metadata todata/and update the Google Gemma model entry to match the current provider naming.
Fix
-
Reject unsupported DeepSeek multimodal prompt objects early
RaiseLLM::PromptErrorforimage_url,local_file, andremote_filein DeepSeek chat requests instead of sending invalid OpenAI-compatible payloads that the provider rejects at runtime. -
Preserve DeepSeek reasoning content across tool turns
Replayreasoning_contentwhen serializing prior assistant messages for DeepSeek chat completions, so thinking-mode tool calls can continue into follow-up requests without triggering invalid request errors. -
Default DeepSeek to
deepseek-v4-flash
ChangeLLM::DeepSeek#default_modeltodeepseek-v4-flashso new contexts and default provider usage align with the current preferred chat model. -
Use per-call streams when waiting on streamed tool work
Track request-local streams bound throughtalk(..., stream:)andrespond(..., stream:)soLLM::Context#waitand interruption-aware queue handling use the active stream instead of falling back to pending function spawning.
v5.1.0
Changes since v5.0.0.
This release tightens streamed tool execution around the actual
request-local runtime state. It fixes streamed resolution of
per-request tools and makes that streamed path work cleanly with
LLM.function(...), MCP tools, bound tool instances, and
normal tool classes.
Fix
-
Resolve request-local tools during streaming
Resolve streamed tool calls throughLLM::Streamrequest-local tools before falling back to the global registry, so per-request tools and bound tool instances work correctly during streaming. -
Support
LLM.function(...)and MCP tools in streamed tool resolution
Let streamed tool resolution use the current request tool set, soLLM.function(...), MCP tools, bound tool instances, and normalLLM::Toolclasses all work through the same streamed tool path.
v5.0.0
Changes since v4.23.0.
This release expands llm.rb from an execution runtime into a more
explicit supervision and transformation runtime. It adds context-level
guards, transformers, and loop supervision through
LLM::LoopGuard, while deepening long-lived context
behavior through compaction, interruption hooks, and streamed
ctx.spawn(...) tool execution.
Change
-
Make compactor thresholds explicit
Requiremessage_threshold:andtoken_threshold:to be opted into explicitly, soLLM::Compactoronly compacts automatically when one of those thresholds is configured. Context-window-derived token limits can be computed by the caller when needed. -
Allow assigning a compactor through
LLM::Context
LetLLM::Contextacceptctx.compactor = ...in addition to the constructorcompactor:option, so compactor config can be assigned or replaced after context initialization. -
Mark compaction summaries in message metadata
Mark compaction summaries withextra[:compaction]andLLM::Message#compaction?, so applications can detect or hide synthetic summary messages in conversation history. -
Add cooperative tool interruption hooks
Letctx.interrupt!notify queued tool work throughon_interrupt, so running tools can clean up cooperatively when a context is cancelled. -
Add
LLM::Contextguards
Add a newguardcapability toLLM::Contextso execution can be supervised at the runtime level. The built-inLLM::LoopGuarddetects repeated tool-call patterns and stops stuck agentic loops through in-bandLLM::GuardErrorreturns.LLM::Agentenables this guard by default. -
Add
LLM::Contexttransformers
Add a newtransformercapability toLLM::Contextso prompts and params can be rewritten before provider requests are sent. This makes it possible to apply context-wide behaviors such as PII scrubbing or request-level param injection without rewriting everytalkandrespondcall site.
v4.23.0
Changes since v4.22.0.
This release expands llm.rb's runtime surface for long-lived
contexts and stateful tools. It adds built-in context compaction
through LLM::Compactor, lets explicit tools:
arrays accept bound LLM::Tool instances, and fixes
OpenAI-compatible no-arg tool schemas for stricter providers such as
xAI.
Change
-
Add
LLM::Compactorfor long-lived contexts
Add built-in context compaction throughLLM::Compactor, so older history can be summarized, retained windows can stay bounded, compaction can run on its ownmodel:, thresholds can be configured explicitly, andLLM::Streamcan observe the lifecycle throughon_compactionandon_compaction_finish. -
Allow bound tool instances in explicit tool lists
Let explicittools:arrays acceptLLM::Toolinstances such asMyTool.new(foo: 1), so tools can carry bound state without changing the global tool registry model.
Fix
- Fix xAI/OpenAI-compatible no-arg tool
schemas
Send an empty object schema for tools without declared parameters instead ofnull, so stricter providers such as xAI accept mixed tool sets that include no-arg tools.
v4.22.0
Changes since v4.21.0.
This release deepens the runtime shape of llm.rb. It reduces helper-method surface on persisted ORM models, expands real ORM coverage, and makes skills behave more like bounded sub-agents with inherited recent context and proper instruction injection.
Change
-
Reduce ActiveRecord wrapper model surface
Move helper methods such as option resolution, column mapping, serialization, and persistence intoUtilsfor the ActiveRecord wrappers so wrapped models include fewer internal helper methods. -
Reduce Sequel wrapper model surface
Move helper methods such as option resolution, column mapping, serialization, and persistence intoUtilsfor the Sequel wrappers so wrapped models include fewer internal helper methods. -
Expand ORM integration coverage
Add broader ActiveRecord and Sequel coverage for persisted context and agent wrappers, including real SQLite-backed records and cassette-backed OpenAI persistence paths. -
Make skills inherit recent parent context
RunLLM::Skillwith a curated slice of recent parent user and assistant messages, prefixed withRecent context:, so skills behave more like task-scoped sub-agents instead of instruction-only helpers.
Fix
-
Fix Sequel
plugin :agentload order
Require the shared Sequel plugin support fromLLM::Sequel::Agentsoplugin :agentcan load independently without raisinguninitialized constant LLM::Sequel::Plugin. -
Make skill execution inherit parent context request settings
RunLLM::Skillthrough a parentLLM::Contextinstead of a bare provider so nested skill agents inherit context-level settings such asmode: :responses,store: false, streaming, and other request defaults, while still keeping skill-local tools and avoiding parent schemas. -
Keep agent instructions when history is preseeded
InjectLLM::Agentinstructions once unless a system message is already present, so agents and nested skills still get their instructions when they start with inherited non-system context.
v4.21.0
Changes since v4.20.2.
This release expands higher-level composition in llm.rb. It adds
Sequel agent persistence through plugin :agent and
introduces directory-backed skills that load from
SKILL.md, resolve named tools, and plug directly into
LLM::Context and LLM::Agent.
Change
-
Add
plugin :agentfor Sequel models
Add Sequel support forplugin :agent, similar to ActiveRecord'sacts_as_agent, so models can wrapLLM::Agentwith built-in persistence. -
Load directory-backed skills through
LLM::ContextandLLM::Agent
Addskills:toLLM::Contextandskills ...toLLM::Agentso directories withSKILL.mdcan be loaded, resolved into tools, and run through the normal llm.rb tool path.
v4.20.2
Changes since v4.20.1.
This patch release improves runtime behavior around interruption and mixed concurrency waits. It also rounds out response API uniformity for Google completion responses.
Fix
-
Expose Google completion response IDs through
.id
AddLLM::Response#idsupport to Google completion responses so tracer and caller code can rely on the same API used by other providers. -
Track interrupt ownership on the active request
BindLLM::Contextinterruption to the fiber runningtalkorrespondsointerrupt!works correctly when requests are started outside the context's initialization fiber.
Change
- Allow mixed concurrency strategies in
wait(...)
LetLLM::Context#wait,LLM::Stream#wait, andLLM::Agent.concurrencyaccept arrays such as[:thread, :ractor]so mixed tool sets can wait on more than one concurrency strategy.
v4.20.1
Changes since v4.20.0.
This patch release fixes ORM option resolution in the Sequel and
ActiveRecord wrappers. Symbol-based provider: and
context: hooks now resolve correctly, and internal default
option constants are referenced explicitly instead of relying on nested
constant lookup.
Fix
-
Fix symbol-based ORM option hooks for provider and context hashes
Makeprovider:andcontext:resolve symbol hooks through the model in the Sequel plugin and ActiveRecord wrappers instead of falling back to an empty hash. -
Fix ORM wrapper constant lookup for option defaults
Qualify internalEMPTY_HASH/DEFAULTSreferences in the Sequel plugin and ActiveRecord wrappers so option resolution does not depend on nested constant lookup quirks.
v4.20.0
Changes since v4.19.0.
This release adds better support for tagged prompt content.
LLM::Context can now serialize and restore
image_url, local_file, and
remote_file content cleanly, and LLM::Message
now exposes helpers for inspecting tagged image and file
attachments.
Change
-
Round-trip tagged prompt objects through
LLM::Context
TeachLLM::Contextserialization and restore to preserveimage_url,local_file, andremote_filecontent acrossto_json/restore. -
Add attachment helpers to
LLM::Message
Addimage_url?,image_urls,file?, andfilesso callers can inspect messages for tagged image and file content more directly.
v4.19.0
Changes since v4.18.0.
This release tightens the ActiveRecord and ORM integration layer. It
adds inline agent DSL blocks to acts_as_agent so agent
defaults can be defined where the wrapper is declared, and it exposes
the resolved provider through public llm methods on the
ActiveRecord and Sequel wrappers.
Change
-
Make ORM provider access public through
llm
Expose the resolved provider on the Sequel plugin and the ActiveRecordacts_as_llm/acts_as_agentwrappers through a publicllmmethod. -
Allow inline agent DSL blocks in
acts_as_agent
Let ActiveRecord models configuremodel,tools,schema,instructions, andconcurrencydirectly inside theacts_as_agentdeclaration block.
v4.18.0
Changes since v4.17.0.
This release improves tracing and tool execution behavior across
llm.rb. It makes provider tracers default to the provider instance,
adds LLM::Provider#with_tracer for scoped overrides,
restores tool tracing for concurrent and streamed tool execution,
extends streamed tracing to MCP tools, and adds symbol-based ORM option
hooks alongside experimental ractor tool concurrency.
Change
-
Make provider tracers default to the provider instance
Changellm.tracer = ...so it sets a provider default tracer instead of relying on scoped fiber-local state alone. This makes tracer configuration behave more predictably across normal tasks, threads, and fibers that share the same provider instance. -
Add
LLM::Provider#with_tracerfor scoped overrides
Addwith_traceras the opt-in escape hatch for request- or turn-scoped tracer overrides. Use it when you want temporary tracing on the current fiber without replacing the provider's default tracer. -
Trace concurrent tool calls outside ractors
Make tool tracing fire correctly when functions run through:thread,:task, or:fiberconcurrency. Experimental:ractorexecution still does not emit tool tracer events. -
Trace streamed tool calls, including MCP tools
Bind stream metadata throughLLM::Stream#extraso streamed tool calls inherit tracer and model context before they are handed toon_tool_call. This restores tool tracing for streamed MCP and local tool execution. -
Support symbol-based ORM option hooks
Letprovider:,context:, andtracer:on the Sequel plugin and the ActiveRecordacts_as_llm/acts_as_agentwrappers resolve through model method names as well as procs. -
Add experimental ractor tool concurrency
Add:ractorsupport toLLM::Function#spawn,LLM::Function::Array#wait,LLM::Stream#wait, andLLM::Agent.concurrencyso class-based tools with ractor-safe arguments and return values can run in Ruby ractors and report their results back into the normal LLM tool-return path. MCP tools are not supported by the current:ractormode, but mixed workloads can still branch ontool.mcp?and choose a supported strategy per tool.:ractoris especially useful for CPU-bound tools, while:task,:fiber, or:threadmay be a better fit for I/O-bound work.
v4.17.0
Changes since v4.16.1.
This release expands agent support across llm.rb. It brings
LLM::Agent closer to LLM::Context, adds
configurable automatic tool concurrency including experimental ractor
support for class-based tools, extends persisted ORM wrappers with more
of the context runtime surface and tracer hooks, and introduces
built-in ActiveRecord agent persistence through
acts_as_agent.
Change
-
Add configurable tool concurrency to
LLM::Agent
Add the class-levelconcurrencyDSL toLLM::Agentso automatic tool loops can run with:call,:thread,:task,:fiber, or experimental:ractorsupport for class-based tools instead of always executing sequentially. -
Bring
LLM::Agentcloser toLLM::Context
ExpandLLM::Agentso it exposes more of the same runtime surface asLLM::Context, including returns, interruption, mode, cost, context window, structured serialization, and other context-backed helpers, while still auto-managing tool loops. -
Refresh agent docs and coverage
Update the README and deep dive to explain the current role ofLLM::Agent, add examples that show automatic tool execution and concurrency, and add focused specs for the expanded agent surface and tool-loop behavior. -
Add ORM tracer hooks for persisted contexts
Addtracer:to both the Sequel plugin andacts_as_llmso models can resolve and assign tracers onto the provider used by their persistedLLM::Context. -
Bring persisted ORM wrappers closer to
LLM::Context
Expand both the Sequel plugin andacts_as_llmso record-backed contexts expose more of the same runtime surface asLLM::Context, including mode, returns, interruption, prompt helpers, file helpers, and tracer access. -
Add ActiveRecord agent persistence with
acts_as_agent
Addacts_as_agentfor ActiveRecord models that should wrapLLM::Agent, reusing the same record-backed runtime shape asacts_as_llmwhile letting tool execution be managed by the agent.
v4.16.1
Changes since v4.16.0.
This release tightens ORM persistence by removing an unnecessary
JSON round-trip when restoring structured :json and
:jsonb context payloads.
Change
- Restore structured ORM payloads directly
TeachLLM::Context#restoreto accept parsed data payloads and use that path from the ActiveRecord and Sequel persistence wrappers forformat: :jsonand:jsonb, avoiding a redundantHash -> JSON string -> Hashround-trip on restore.
v4.16.0
Changes since v4.15.0.
This release expands ORM support with built-in ActiveRecord persistence and improves compatibility with OpenAI-compatible gateways, proxies, and self-hosted servers that use non-standard API root paths.
Change
-
Support OpenAI-compatible base paths
Addbase_path:to provider configuration so OpenAI-compatible endpoints can vary both host and API prefix. This supports providers, proxies, and gateways that keep OpenAI request shapes but use non-standard URL layouts such as DeepInfra's/v1/openai/.... -
Add ActiveRecord context persistence with
acts_as_llm
Add a built-in ActiveRecord wrapper that mirrors the Sequel plugin API so applications can persistLLM::Contextstate on records with default columns, provider/context hooks, validation-backed writes, andformat: :string,:json, or:jsonbstorage.
v4.15.0
Changes since v4.14.0.
Change
-
Reduce OpenAI stream parser merge overhead
Special-case the most common single-field deltas, streamline incremental tool-call merging, and avoid repeated JSON parse attempts until streamed tool arguments look complete. -
Cache streaming callback capabilities in parsers
Cache callback support checks once at parser initialization time in the OpenAI, OpenAI Responses, Anthropic, Google, and Ollama stream parsers instead of repeatingrespond_to?checks on hot streaming paths. -
Reduce OpenAI Responses parser lookup overhead
Special-case the hot Responses API event paths and cache the current output item and content part so streamed output text deltas do less repeated nested lookup work. -
Add a Sequel context persistence plugin
Addplugin :llmfor Sequel models so apps can persistLLM::Contextstate with default columns and pass provider setup throughprovider:when needed. The plugin now also supportsformat: :string,:json, or:jsonbfor text and native JSON storage when Sequel JSON typecasting is enabled. -
Improve streaming parser performance
In the local replay-basedstream_parserbenchmark versusv4.14.0(median of 20 samples, 5000 iterations), plain Ruby is a small overall win: the generic eventstream path is about 0.4% faster, the OpenAI stream parser is about 0.5% faster, and the OpenAI Responses parser is about 1.6% faster, with unchanged allocations. Under YJIT on the same benchmark, the generic eventstream path is about 0.9% faster and the OpenAI stream parser is about 0.4% faster, while the OpenAI Responses parser is about 0.7% slower, also with unchanged allocations.
Compared to v4.13.0, the larger v4.14.0
streaming gains still hold. The generic eventstream path remains
dramatically faster than v4.13.0, the OpenAI stream parser
remains modestly faster, and the OpenAI Responses parser is roughly
flat to slightly better depending on runtime. In other words, current
keeps the large eventstream win from v4.14.0, adds only
small incremental changes beyond that, and does not turn the
post-v4.14.0 parser work into another large benchmark
jump.
v4.14.0
Changes since v4.13.0.
This release adds request interruption for contexts, reworks provider HTTP internals for lower-overhead streaming, and fixes MCP clients so parallel tool calls can safely share one connection.
Add
- Add request interruption support
AddLLM::Context#interrupt!,LLM::Context#cancel!, andLLM::Interruptfor interrupting in-flight provider requests, inspired by Go's context cancellation.
Change
-
Rework provider HTTP transport internals
Rework provider HTTP aroundLLM::Provider::Transport::HTTPwith explicit transient and persistent transport handling. -
Reduce SSE parser overhead
Dispatch raw parsed values to registered visitors instead of building anEventobject for every streamed line. -
Reduce provider streaming allocations
Decode streamed provider payloads directly inLLM::Provider::Transport::HTTPbefore handing them to provider parsers, which cuts allocation churn and gives a smaller streaming speed bump. -
Reduce generic SSE parser allocations
Keep unread event-stream buffer data in place until compaction is worthwhile, which lowers allocation churn in the remaining generic SSE path. -
Improve streaming parser performance
In the local replay-basedstream_parserbenchmark versusv4.13.0(median of 20 samples, 5000 iterations): Plain Ruby: the generic eventstream path is about 53% faster with about 32% fewer allocations, the OpenAI stream parser is about 11% faster with about 4% fewer allocations, and the OpenAI Responses parser is about 3% faster with unchanged allocations. YJIT on the current parser benchmark harness: the current tree is about 26% faster than non-YJIT on the generic eventstream path, about 18% faster on the OpenAI stream parser, and about 16% faster on the OpenAI Responses parser, with allocations unchanged.
Fix
-
Support parallel MCP tool calls on one client
Route MCP responses by JSON-RPC id so concurrent tool calls can share one client and transport without mismatching replies. -
Use explicit MCP non-blocking read errors
UseIO::EAGAINWaitReadablewhile continuing to retry onIO::WaitReadable.
v4.13.0
Changes since v4.12.0.
This release expands MCP prompt support, improves reasoning support in the OpenAI Responses API, and refreshes the docs around llm.rb's runtime model, contexts, and advanced workflows.
Add
- Add
LLM::MCP#promptsandLLM::MCP#find_promptfor MCP prompt support.
Change
- Rework the README around llm.rb as a runtime for AI systems.
- Add a dedicated deep dive guide for providers, contexts, persistence, tools, agents, MCP, tracing, multimodal prompts, and retrieval.
Fix
All of these fixes apply to MCP:
- fix(mcp): raise
LLM::MCP::MismatchErroron mismatched response ids. - fix(mcp): normalize prompt message content while preserving the original payload.
All of these fixes apply to OpenAI's Responses API:
- fix(openai): emit
on_reasoning_contentfor streamed reasoning summaries. - fix(openai): skip
previous_response_idonstore: falsefollow-up calls. - fix(openai): fall back to an empty object schema for tools without params.
- fix(openai): preserve original tool-call payloads on re-sent assistant tool messages.
- fix(openai): emit
output_textfor assistant-authored response content. - fix(openai): return
nilforsystem_fingerprinton normalized response objects.
v4.12.0
Changes since v4.11.1.
This release expands advanced streaming and MCP execution while reframing llm.rb more clearly as a system integration layer for LLMs, tools, MCP sources, and application APIs.
Add
- Add
persistentas an alias forpersist!on providers and MCP transports. - Add
LLM::Stream#on_tool_returnfor observing completed streamed tool work. - Add
LLM::Function::Return#error?.
Change
- Expect advanced streaming callbacks to use
LLM::Streamsubclasses instead of duck-typing them onto arbitrary objects. Basic#<<streaming remains supported.
Fix
- Fix Anthropic tools without params by always emitting
input_schema. - Fix Anthropic tool-only responses to still produce an assistant message.
- Fix Anthropic tool results to use the
userrole. - Fix Anthropic tool input normalization.
v4.11.1
Changes since v4.11.0.
Fix
- Cast OpenTelemetry tool-related values to strings.
Otherwise they're rejected by opentelemetry-sdk as invalid attributes.
v4.11.0
Changes since v4.10.0.
Add
- Add
LLM::Streamfor richer streaming callbacks, includingon_content,on_reasoning_content, andon_tool_callfor concurrent tool execution. - Add
LLM::Stream#waitas a shortcut forqueue.wait. - Add
LLM::Context#waitas a shortcut for the configured stream'swait. - Add
LLM::Context#call(:functions)as a shortcut forfunctions.call. - Add
LLM::Function.registryand enhanced support for MCP tools inLLM::Tool.registryfor tool resolution during streaming. - Add normalized
LLM::Responsefor OpenAI Responses, providingcontent,content!,messages/choices,usage, andreasoning_content. - Add
mode: :responsestoLLM::Contextfor routingtalkthrough the Responses API. - Add
LLM::Context#returnsfor collecting pending tool returns from the context. - Add persistent HTTP connection pooling for repeated MCP tool
calls via
LLM.mcp(http: ...).persist!. - Add explicit MCP transport constructors via
LLM::MCP.stdio(...)andLLM::MCP.http(...).
Fix
- Fix Google tool-call handling by synthesizing stable ids when Gemini does not provide a direct tool-call id.
v4.10.0
Changes since v4.9.0.
Add
- Add HTTP transport for MCP with
LLM::MCP::Transport::HTTPfor remote servers - Add JSON Schema union types (
any_of,all_of,one_of) with parser integration - Add JSON Schema type array union support (e.g.,
"type": ["object", "null"]) - Add JSON Schema type inference from
const,enum, ordefaultfields
Change
- Update
LLM::MCPconstructor for exclusivehttp:orstdio:transport - Update
LLM::MCPdocumentation for HTTP transport support
v4.9.0
Changes since v4.8.0.
Add
- Add fiber-based concurrency with
LLM::Function::FiberGroupandLLM::Function::TaskGroupclasses for lightweight async execution. - Add
:thread,:task, and:fiberstrategy parameter toLLM::Function#spawnfor explicit concurrency control. - Add stdio MCP client support, including remote tool discovery and
invocation through
LLM.mcp,LLM::Context, and existing function/tool APIs. - Add model registry support via
LLM::Registry, including model metadata lookup, pricing, modalities, limits, and cost estimation. - Add context access to a model context window via
LLM::Context#context_window. - Add tracking of defined tools in the tool registry.
- Add
LLM::Schema::Enum, enablingEnum[...]as a schema/tool parameter type. - Add top-level Anthropic system instruction support using Anthropic's provider-specific request format.
- Add richer tracing hooks and extra metadata support for LangSmith/OpenTelemetry-style traces.
- Add rack/websocket and Relay-related example work, including MCP-focused examples.
- Add concurrent tool execution with
LLM::Function#spawn,LLM::Function::Array(call,wait,spawn), andLLM::Function::ThreadGroup. - Add
LLM::Function::ThreadGroup#alive?method for non-blocking monitoring of concurrent tool execution. - Add
LLM::Function::ThreadGroup#valuealias forThreadGroup#waitfor consistency with Ruby'sThread#value.
Change
- Rename
LLM::SessiontoLLM::Contextthroughout the codebase to better reflect the concept of a stateful interaction environment. - Rename
LLM::GeminitoLLM::Googleto better reflect provider naming. - Standardize model objects across providers around a smaller common interface.
- Switch registry cost internals from
LLM::EstimatetoLLM::Cost. - Update image generation defaults so OpenAI and xAI consistently return base64-encoded image data by default.
- Update
LLM::Botdeprecation warning from v5.0 to v6.0, giving users more time to migrate toLLM::Context. - Rework the README and screencast documentation to better cover MCP, registry, contexts, prompts, concurrency, providers, and example flow.
- Expand the README with architecture, production, and provider guidance while improving readability and example ordering.
Fix
- Fix local schema
$refresolution inLLM::Schema::Parser. - Fix multiple MCP issues around stdio env handling, request IDs, registry interaction, tool registration, and filtering of MCP tools from the standard tool registry.
- Fix stream parsing issues, including chunk-splitting bugs and safer handling of streamed error responses.
- Fix prompt handling across contexts, agents, and provider adapters so prompt turns remain consistent in history and completions.
- Fix several tool/context issues, including function return wrapping, tool lookup after deserialization, unnamed subclass filtering, and thread-safety around tool registry mutations.
- Fix Google tool-call handling to preserve
thoughtSignature. - Fix
LLM::Tracer::Loggerargument handling. - Fix packaging/docs issues such as registry files in the gemspec and stale provider docs.
- Fix Google provider handling of
nilfunction IDs during context deserialization. - Fix MCP stdio transport by increasing poll timeout for better reliability.
- Fix Google provider to properly cast non-Hash tool results into Hash format for API compatibility.
- Fix schema parser to support recursive normalization of
Array,LLM::Object, and nested structures. - Fix DeepSeek provider to tolerate malformed tool arguments.
- Fix
LLM::Function::TaskGroup#alive?to properly delegate toAsync::Task#alive?. - Fix various RuboCop errors across the codebase.
- Fix DeepSeek provider to handle JSON that might be valid but unexpected.
Notes
Notable merged work in this range includes:
feat(function): add fiber-based concurrency for async environments (#64)feat(mcp): add stdio MCP support (#134)Add LLM::Registry + cost support (#133)Consistent model objects across providers (#131)Add rack + websocket example (#130)feat(gemspec): add changelog URI (#136)feat(function): alias ThreadGroup#wait as ThreadGroup#value (#62)- README and screencast refresh across
#66,#67,#68,#71, and#72 chore(bot): update deprecation warning from v5.0 to v6.0fix(deepseek): tolerate malformed tool argumentsrefactor(context): Rename Session as Context (#70)
Comparison base:
- Latest tag:
v4.8.0(6468f2426ee125823b7ae43b4af507b125f96ffc) - HEAD used for this changelog:
915c48da6fda9bef1554ff613947a6ce26d382e3