OpenAI Vision in Elixir: Analyze Uploaded Images in Phoenix LiveView
OpenAI vision in Elixir with Req: resize uploads, send images from Phoenix LiveView, get validated JSON back with Ecto, and keep cost and safety in check.
By Liam Killingback
We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
The blog
Tips, tricks & guides on building with Phoenix and Elixir.
OpenAI vision in Elixir with Req: resize uploads, send images from Phoenix LiveView, get validated JSON back with Ecto, and keep cost and safety in check.
By Liam Killingback
Use the OpenAI Batch API in Elixir with Req and Oban: build JSONL, submit, poll with snooze and write results back by custom_id, at about half the price.
By Liam Killingback
Elixir text to speech with the OpenAI audio API: generate MP3s with Req, cache by content hash, stream bytes and play AI answers aloud in Phoenix LiveView.
By Liam Killingback
Text chunking for RAG in Elixir: clean PDF text, split on headings, add word-aligned overlap, prefix context and re-embed only changed chunks with Oban and pgvector.
By Liam Killingback
Reranking in Elixir for better RAG: score your top 30 search results with a cross-encoder via Req or Bumblebee, keep the best 5, and measure the gain.
By Liam Killingback
Instructor in Elixir turns LLM responses into validated Ecto structs. Define a response model, validate with changesets, retry on errors and use it in LiveView.
By Liam Killingback
Build text-to-SQL in Elixir with Phoenix: let users query Postgres in plain English, with a read-only role, policy checks, timeouts and a LiveView UI.
By Liam Killingback
Content moderation in Elixir with the OpenAI Moderation API: per-surface thresholds, Ecto and Oban checks, LiveView chat, Req.Test stubs and a review queue.
By Liam Killingback
Ollama in Elixir, step by step: a Req client for local LLMs, token streaming into Phoenix LiveView, JSON output, embeddings and tests. No API key needed.
By Liam Killingback
Prompt injection in Elixir, explained with working Phoenix code: scope retrieval, validate LLM output with Ecto, gate tool calls and render model output safely.
By Liam Killingback
OpenAI image generation in Elixir, done properly: call the Images API with Req, run it in Oban, stream results to LiveView over PubSub and cap cost per user.
By Liam Killingback
AI document summarization in Elixir that scales past the context window: map-reduce long PDFs in parallel, cache every step, cite pages and stream progress to LiveView.
By Liam Killingback
Handle OpenAI rate limits in Elixir: Req retries that skip insufficient_quota, header-guided backoff, Oban snoozes, fallback models and a circuit breaker.
By Liam Killingback
Semantic caching in Elixir with pgvector: reuse LLM answers for prompts that mean the same thing, scope by tenant, tune the threshold and measure savings.
By Liam Killingback
Add two-factor authentication to Phoenix: TOTP secrets, QR enrolment, single-use recovery codes and the half-authenticated session phx.gen.auth leaves to you.
By Liam Killingback
A complete Phoenix LiveView S3 upload guide: presign a POST policy, wire the JS uploader, show progress and store the key. Working code and the real gotchas.
By Liam Killingback
Add Phoenix OAuth login with Google and GitHub on top of phx.gen.auth: Ueberauth setup, account linking, the hashed_password gotcha and the security checks.
By Liam Killingback
Elixir LLM evals with ExUnit: stub the model in unit tests, score a dataset with field match, embeddings and an LLM judge, then gate regressions in CI.
By Liam Killingback
Build an AI agent in Elixir: a supervised tool loop with OTP, hard token budgets, human approval gates, and live progress streamed into Phoenix LiveView.
By Liam Killingback
How to use the Claude API in Elixir with Req: messages, SSE streaming into LiveView, the tool-use loop, structured JSON output, prompt caching and retries.
By Liam Killingback
Build a Phoenix LiveView usage dashboard: blend ETS counters with Postgres rollups, push updates over PubSub, and chart usage with inline SVG.
By Liam Killingback
Build hybrid search in Elixir: combine pgvector semantic search with Postgres full-text, fuse both with Reciprocal Rank Fusion, and wire it into LiveView.
By Liam Killingback
A practical guide to Elixir Oban background jobs in Phoenix: setup, queues, retries, uniqueness, cron, rate limiting AI calls, testing and production tips.
By Liam Killingback
Need an OpenMeter alternative for Elixir? An honest comparison of both options, plus a BEAM-native metering pipeline built with ETS, Oban, Postgres and Stripe.
By Liam Killingback
Elixir Whisper transcription in Phoenix: upload audio in LiveView, call the OpenAI API with Req, split long files, and run Whisper locally with Bumblebee.
By Liam Killingback
Laravel Cashier for Phoenix: build Stripe subscriptions, webhooks, trials, plan gating and usage billing in Elixir, with real code and an honest comparison.
By Liam Killingback
An Elixir Bumblebee guide: run Hugging Face models locally in Phoenix with Nx.Serving for embeddings, Whisper and text generation, no API key needed.
By Liam Killingback
An Elixir LangChain guide for Phoenix: set up LLMChain with ChatOpenAI, add tool calling with app context, stream deltas into LiveView, and test it all.
By Liam Killingback
Phoenix feature gating done right: model plan entitlements as data, enforce in contexts and LiveView, cache with ETS, and handle overrides.
By Liam Killingback
Build an AI chatbot with Phoenix LiveView: persisted conversations, LiveView streams, context window budgeting, and tool calling with real authorisation.
By Liam Killingback
Stripe metered billing in Elixir: create Billing Meters, report usage idempotently from Oban, scale with the meter event stream, and reconcile the totals.
By Liam Killingback
Build an MCP server in Elixir from scratch: JSON-RPC, tools, stdio transport, and Claude Desktop. A practical Model Context Protocol guide for Phoenix devs.
By Liam Killingback
A complete guide to usage-based billing in Elixir and Phoenix: metering events on the ETS hot path, reporting usage to Stripe, and enforcing plan quotas.
By Liam Killingback
A complete guide to Elixir PDF AI extraction: pull text from a PDF, send it to a model with a strict JSON schema, handle scans with vision, and validate.
By Liam Killingback
Build real-time Phoenix usage metering with ETS: count API calls on an in-memory hot path, enforce plan quotas, and flush to Postgres for billing.
By Liam Killingback
Build a pgvector Elixir RAG pipeline on Postgres: embed content with the OpenAI API and Req, query nearest chunks with Ecto, answer in LiveView.
By Liam Killingback
Aurora Meter brings usage-based billing, real-time metering, and plan entitlements to Phoenix and Elixir — count, gate, and bill on the BEAM, from a free MIT core.
By Liam Killingback
Learn how to stream OpenAI responses in Phoenix LiveView token-by-token — using Req, async tasks, and clean error handling. Real Elixir code, no JS framework.
By Liam Killingback
Whether you want to explore structured data, test AI database integrations, or learn how to build secure AI-powered apps with Phoenix, MCP Chat Buddy is your new go-to starting point.
By Liam Killingback
Phoenix 1.8 has officially launched, bringing a host of enhancements that streamline development, bolster security, and improve user experience. Here's a breakdown of the key features and updates
By Liam Killingback
With the introduction of Phoenix Native, developers can extend their LiveView apps seamlessly to mobile platforms, bringing a whole new level of flexibility and power to the Elixir ecosystem.
By Liam Killingback
Do you need a seamless way to interact with PDFs in real-time? Meet pdfai, our latest website template on phxtemplates, designed for developers who want a robust PDF analysis solution built with Phoenix, LiveView, and OpenAI.
By Liam Killingback