Azure OpenAI / Foundry wired in as a third provider alongside Claude and Gemini

simkjels adds full Azure OpenAI support to the mike stack - backend adapter, frontend model picker, and three separate deployment slots for main, tabular, and title tiers. There are a few rough edges worth knowing about before you pull it in.

integrationinfrastructure

Commit 6de8751c introduces backend/src/lib/llm/azure.ts, a streaming/tool-loop adapter that follows the same interface as the Claude and Gemini drivers. Three env vars control which Azure deployment handles each tier: AZURE_OPENAI_MAIN_DEPLOYMENT, AZURE_OPENAI_TABULAR_DEPLOYMENT, and AZURE_OPENAI_TITLE_DEPLOYMENT. The frontend gets a new modelCatalog.ts that shows an "Azure" group in the model picker only when the matching NEXT_PUBLIC_AZURE_OPENAI_* deployment vars are set.

832920a9 revises the approach. The first cut used the AzureOpenAI SDK with an apiVersion query-param path; this commit drops that and switches to the plain OpenAI SDK pointed at Azure's /openai/v1/ endpoint, which mirrors the standard OpenAI API shape. AZURE_OPENAI_API_VERSION is removed entirely. The normalizer in azure.ts strips query strings and hashes, and case-insensitively rewrites any /openai or /openai/v1 suffix before appending the canonical path - so you can point AZURE_OPENAI_ENDPOINT at either the root resource URL or a full path and it will work.

ffad9905 is small but load-bearing. Next.js only inlines NEXT_PUBLIC_* vars when they're accessed as literal process.env.NAME expressions at build time. The original code passed the env var name as a string to a trimEnv(name) helper, which silently returned undefined in client bundles - meaning the Azure group never appeared in the picker. The fix reads each var directly and passes the resolved value into the label functions.

One behavioral caveat: models.ts resolves defaults via getDefaultMainModel(), and those helpers return an Azure deployment whenever the Azure env vars are present. That means deploying with Azure configured silently changes the default model for all users, even ones who haven't explicitly chosen it. Worth checking your deployment logic before adopting.

So what Worth a look if you want Azure-hosted OpenAI deployments behind the existing UI. The v1-endpoint approach in `832920a9` is the right long-term shape. Watch the default-flipping behavior in `getDefaultMainModel()` - if you run a mixed environment, you'll want to audit that before rolling out.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

3 commits from simkjels/mike, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
6de8751c Add Azure Foundry model support Simen Kjelsrud 2026-05-04 ↗ GitHub
832920a9 Use Azure OpenAI v1 endpoint flow Simen Kjelsrud 2026-05-04 ↗ GitHub
ffad9905 Fix Azure model picker env reads Simen Kjelsrud 2026-05-04 ↗ GitHub

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-94.md from inside the repo you want the changes in.

⬇ Download capture-thread-94.md