brainlid
Langchain - An Elixir LangChain-like library for integrating with LLMs like ChatGPT
LangChain is short for Language Chain. An LLM, or Large Language Model, is the “Language” part. This library makes it easier for Elixir applications to “chain” or connect different processes, integrations, libraries, services, or functionality together with an LLM.
LangChain is a framework for developing applications powered by language models. It enables applications that are:
- Data-aware: connect a language model to other sources of data
- Agentic: allow a language model to interact with its environment
The main value props of LangChain are:
- Components: abstractions for working with language models, along with a collection of implementations for each abstraction. Components are modular and easy-to-use, whether you are using the rest of the LangChain framework or not
- Off-the-shelf chains: a structured assembly of components for accomplishing specific higher-level tasks
Off-the-shelf chains make it easy to get started. For more complex applications and nuanced use-cases, components make it easy to customize existing chains or build new ones.
Announcement post for the initial release that explains and gives an overview:
Library on Github:
The library helps to integrate an Elixir app with an LLM (Large Language Model) like ChatGPT. It includes Livebook notebooks for easy experimental play. This supports defining your own functions to expose to an LLM which it can call, allowing your app to extend the functionality in interesting new ways.
Most Liked
brainlid
Published a DEMO project for using the Elixir LangChain library.
- writes the messages to a SQLite database
- can edit/delete messages
- can resubmit a conversation after making changes
- can cancel an in-process message
- message deltas are streamed in
- uses LiveView’s new Async Operations
Check it out!
brainlid
Elixir LangChain v0.3.0 is released!
This library makes it much easier to integrate your Elixir application with one or more LLMs. It’s an adapter, shielding your app from swapping out which LLM you want to target for that next feature.
Recent additions include:
- OpenAI o1 support
- Bumblebee Llama 3.x function calling
- Anthropic token caching
- built-in fallback to another preferred LLM
- and more!
Hire me!
I’m looking for full time, US-based employment with or without AI!
brainlid
I updated the DEMO project to include an Agent example. In this case, it’s an AI Personal Fitness Trainer! I created a YouTube video about it and wrote up an overview in a blog post.







