feat(llm): OpenAI + Azure OpenAI providers + global-key fallback chain

↗ view on GitHub · Allen Morgan · 2026-05-08 · 16a0799f

Adds OpenAI and Azure OpenAI to the LLM adapter alongside the existing
Claude and Gemini providers, plus the supporting plumbing on the user-
profile and chat sides:

  * lib/llm/openai.ts            - streaming + completion adapter for
                                   plain OpenAI.  Tool-call assembly
                                   matches the upstream OpenAI tool
                                   schema, so Mike's existing tool
                                   surface passes through untouched.

  * lib/llm/azureOpenai.ts        - Azure OpenAI adapter (endpoint +
                                   apiVersion + deployment).  apiKey
                                   is optional so Managed-Identity
                                   auth can land later without an API
                                   change.

  * lib/llm/azureOpenaiDeployments.ts - lists deployments configured
                                   against the user's AOAI resource
                                   for the in-app model picker.

  * lib/llm/types.ts / models.ts  - Provider type now includes
                                   "openai" and "azureOpenai"; AOAI
                                   model ids use the prefix
                                   "aoai:<deployment>" so providerForModel
                                   can route them at runtime.

  * routes/llm.ts                 - GET /llm/azure-openai/deployments
                                   exposes the deployment list to the
                                   frontend model picker.

  * lib/userSettings.ts           - fast_model resolver now walks a
                                   fallback chain: user pick →
                                   Gemini Flash Lite → OpenAI nano →
                                   Claude Haiku → AOAI default
                                   deployment.  AzureOpenaiSettings is
                                   constructed from the persisted
                                   profile columns.

  * routes/{chat,tabular}.ts      - title_model → fast_model.  Title
                                   model name is no longer
                                   provider-coupled.

Adds the openai npm package as a runtime dep.
Repository Altien/mikeOssAzure
Author Allen Morgan <amorgan@altien.com>
Authored
Parents ff992534
Stats 12 files changed , +731 , -19
Part of OpenAI + Azure OpenAI providers + fast-model fallback chain

Capture this commit into my fork

Download a Markdown prompt that tells Claude how to port this exact commit into your working tree. Run it via claude -p < capture-commit-16a0799f.md from inside the repo you want the change in.

⬇ Download capture-commit-16a0799f.md