These scripts document early experiments exploring how to integrate LLMs into Elixir, progressing from raw API calls to a basic conversational prototype.
A direct HTTP call to Anthropic’s API using Req. This established the basics of authentication, request formatting, and inspecting raw JSON responses.
The same basic experiment using ReqLLM instead of raw HTTP. This reduced boilerplate and introduced structured response helpers for model output, token usage, and cost.
A simple command-line chatbot prototype that preserved conversation history between turns. This demonstrated the mechanics of multi-turn chat, while also showing the limitations of manually flattening history into prompt text instead of using structured chat messages.
(Above summary written by GPT-5.5)
export ANTHROPIC_API_KEY="your_key_here"
elixir llm_playground.exs
elixir req_llm_http_playground.exs
elixir req_llm_chat_lab.exs
(Scripts written mostly by varying GPT models)