Show HN: Erlangchain – A tiny Erlang client for LLMs Developer abhavk released Erlangchain, a minimal Erlang client for LLMs with zero third-party dependencies, supporting OpenAI and Anthropic APIs, tool use, and multimodal inputs. The open-source library provides a simple chat interface and built-in JSON utilities, aiming to bring LLM integration to the Erlang ecosystem. Minimal building blocks for talking to LLMs from Erlang, with zero third-party dependencies only OTP inets + ssl . | Module | Role | |---|---| llm | one-call chat client for OpenAI Responses API and Anthropic, with tool-use and multimodal support | json util | dependency-free JSON encode/decode | %% rebar.config {deps, {erlangchain, {git, "https://github.com/abhavk/erlangchain.git", {tag, "0.1.0"}}} }. Set OPENAI API KEY and/or ANTHROPIC API KEY in the environment a .env file in the working directory is loaded automatically if present . %% Simple completion defaults to openai/small : {ok, {content := Text}} = llm:chat {role = user, content = <<"hello" } , %% Pick provider + size: {ok, Resp} = llm:chat openai, big, Messages , %% Tool use — pass tool specs, get back tool calls to run and feed back: {ok, {tool calls := Calls}} = llm:chat openai, big, Messages, Tools . Messages are maps like {role = system|user|assistant, content = binary } , plus {role = tool result, tool use id = Id, content = Bin} to return tool output. See the header of src/llm.erl for the full message/response shapes. js <<"{\"a\":1}" = json util:encode {<<"a" = 1} , {<<"a" := 1} = json util:decode <<"{\"a\":1}" . MIT — see LICENSE /abhavk/erlangchain/blob/main/LICENSE .