sonic182
Hi everyone, at Doofinder we have been building llm_composer for some new apps, and we thought it could be useful to share it with the community.
llm_composer is an Elixir library that simplifies working with large language models (LLMs) like OpenAI’s GPT, OpenRouter, Ollama, AWS Bedrock, and Google (Gemini).
It provides a streamlined way to build and execute LLM-based applications or chatbots, with features such as:
- Multi-provider support (OpenAI, OpenRouter, Ollama, Bedrock, Google Gemini/Vertex AI).
- System prompts and message history management.
- Streaming responses.
- Function calls with auto-execution.
- Structured outputs with JSON schema validation.
- Built-in cost tracking (currently for OpenRouter).
- Easy extensibility for custom use cases.
A key feature is the provider router that handles failover automatically.
It will use one provider until it fails, then fall back to the next provider in the list, applying an exponential backoff strategy. This makes it resilient in production environments where provider APIs can become temporarily unavailable.
Under the hood, llm_composer uses Tesla as the HTTP client.
For production setups, especially when using streaming, it is recommended to run it with Finch for optimal performance.
More info and docs:
HexDocs: LlmComposer — llm_composer v0.20.0
GitHub:
Trending in Announcing
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #ai
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 9- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
mercyf
This looks great
sonic182
Thanks!
We’ve also improved the README with clearer examples for different use cases:
So it should be much easier to get started now.
Feel free to check it out and let us know if you have any feedback!
Jskalc
Thanks for your efforts!
Could you highlight the differences from ReqLLM, discussed in this topic? I believe both libraries aim to solve the same problem.
sonic182
We started this lib about a year ago (we’d been using it internally even before that) and only now decided to share it here.
Both libraries aim at the same thing: wrapping LLM APIs behind a unified HTTP client.
The main differences are:
HTTP layer: we use Tesla, ReqLLM builds on Req.
Routing: llm_composer includes a router with fallback + retries.
API style: each library exposes a slightly different way to configure and work with “bots” or requests, so it depends which style you prefer.
sonic182
LlmComposer v0.12.0 released
This version removes deprecated configuration options and adds built-in cost tracking for multiple providers.
Removed (breaking changes)
:providerand:provider_optskeys. Use the:providerslist instead.:api_keyinSettings. Each provider should define its own key.Added
models.devand OpenRouter).CostInfostruct in responses with token usage and cost breakdowns.Changelog: https://github.com/doofinder/llm_composer/blob/master/CHANGELOG.md
Docs: https://hexdocs.pm/llm_composer/readme.html
sonic182
llm_composer v0.12.2 Released
November 6, 2025
This update focuses on a key licensing change for the project.
License change
From v0.12.2,
llm_composeris now released under the MIT license, replacing the previous GPL-3.0.Why
The project originally used GPL-3 without fully considering its implications.
After using depscheck to our dependency review process (internal stuffs), we realized that GPL-3 could limit adoption in some environments or organizations.
To avoid any restrictions and ensure the library remains freely usable in all kinds of projects—open-source or commercial—we’ve switched to the more permissive MIT license.
Other updates
0.12.xversion is seamless.Upgrade
Repository: https://github.com/doofinder/llm_composer
sonic182
llm_composer v0.16.0 released (Feb 23, 2026)
Quick update since the last post (v0.12.2 / MIT switch) — quite a bit has landed since then.
What’s new in 0.16.0
LlmComposer.Providers.OpenAIResponses— calls OpenAI’s/responsesAPI with support for structured outputs and reasoning (provider/model-specific params passed viarequest_params), normalized into the usualLlmResponseshape. Since it targets the/responsesAPI spec, it also works with compatible providers like x.ai (xAI/Grok), OpenRouter’s responses endpoint, and others.LlmComposer.StreamChunkstruct + provider-specific parsing turns raw stream events into typed values (:text_delta,:tool_call_delta,:done, …).LlmComposer.FunctionCallExtractors: centralizes function call extraction logic per provider.parse_stream_response: now comes in/2and/3arities and returns%StreamChunk{}values instead of raw decoded maps.LlmComposer.ProviderResponse+LlmComposer.ProviderStreamChunk) for cleaner normalization across providers.Notable releases since 0.12.2
FunctionExecutor+FunctionCallHelpers— breaking change, see changelog.request_params(e.g. Google’sgenerationConfig).LlmResponse.new/3now returns{:error, …}instead of raising on unknown provider formats.:json_engine(defaults toJSON, falls back toJason); Google provider now preservesadditionalPropertiesin response schemas.Upgrade
Full changelog: llm_composer/CHANGELOG.md at master · doofinder/llm_composer · GitHub
sonic182
LLM Composer update — v0.16.1 → v0.19.1
Hey everyone! A lot has landed since the last update (v0.16.0). Here’s a recap of the highlights.
The biggest news: Amazon Bedrock now has full feature parity with the other providers — streaming, tool calls, structured output, and cost tracking all landed in v0.19.0. More on that below.
Reasoning model support (v0.16.1 → v0.17.1)
:reasoning_deltastream chunks across OpenAI, OpenAI Responses, and Ollama.%LlmResponse{}:reasoning_tokens,provider_model,cached_tokens,response_id.previous_response_idsupport for stateful OpenAI Responses conversations.Cost tracking improvements (v0.17.0)
chunk.cost_infopopulated on the final stream chunk — no post-processing needed.cached_tokensandcache_read_price_per_millionadded to%CostInfo{}, billed at the lower cache-read rate when available.Cleaner function call API (v0.18.0)
function_callsmoved from%LlmResponse{}to%Message{}as a typed field, replacing themetadata[:tool_calls]indirection.StreamChunk cleanup (v0.18.2)
StreamChunk.tool_callrenamed totool_calls(typespec updated to match what parsers were already returning).Amazon Bedrock — full feature parity (v0.19.0)
Bedrock went from completion-only to fully featured:
ConverseStreamAPI.response_schema— mapped automatically to Bedrock’soutputConfig.LlmResponse.cost_infowhentrack_costs: true.Bedrock HTTP fix (v0.19.1)
Full details in the CHANGELOG. Feedback welcome!
sonic182
Hi all! Just released v0.20.0 — the headline is a new
LlmComposer.Agentmodule.LlmComposer.Agent— automatic tool-calling loopHandles the full ask → execute → repeat cycle so you don’t have to manage it manually. Supports sequential and parallel tool execution, a configurable iteration limit, and per-tool error recovery.
Streaming agent (
stream_response: true)The agent now supports streaming, returning a lazy stream of
StreamChunks::text_delta— model text as it arrives:tool_call— emitted after each tool execution, result included (no extra telemetry handler needed):done— terminal chunk with cumulative usage and the fullAgent.ResultWorks across all supported providers:
:open_ai,:open_router,:open_ai_responses,:google,:bedrock,:ollama.Telemetry improvements
Spans for
run_completionandproviders_runner, enriched agent events with per-tool arguments and reasoning deltas, plus a:telemetry_metadataoption to scope handlers to a single run.Full changelog: Comparing 0.19.6...0.20.0 · doofinder/llm_composer · GitHub