bruteSourceBruteMiddlewareCompletion

module Completion

Completion middlewares are the terminal app of an agent pipeline: each one calls an LLM through a different Ruby library and appends the response to the session as a RubyLLM::Message (Brute's internal message format).

Pick one per agent, configured at point of use:

run Brute::Middleware::Completion::RubyLLM.new(provider: :ollama, model: "llama3.2:latest") run Brute::Middleware::Completion::LLMrb.new(provider: :openai, provider_options: key: ENV["OPENAI_API_KEY"]) run Brute::Middleware::Completion::OpenRouter.new(model: "anthropic/claude-sonnet-4") run Brute::Middleware::Completion::LangChain.new(llm: Langchain::LLM::OpenAI.new(api_key: ENV["OPENAI_API_KEY"]))

Anything not configured falls back to env, so an Agent's provider/model/tools still flow through.

Nested