feat(providers): add chat-completions provider (OpenAI Chat Completions-compatible endpoints) - #127
Merged
Merged
Conversation
Added chat-completions as an official provider, supporting any OpenAI Chat Completions-compatible endpoint (llama.cpp, vLLM, LM Studio, LocalAI, etc.). Changes: - loader.py: added 'chat-completions' to _VALID_PROVIDER_MODULES - provider_sources.py: added to KNOWN_PROVIDERS and PROVIDER_CATALOG, with a dedicated resolve_credential_detailed branch that correctly routes CHAT_COMPLETIONS_BASE_URL (required) into base_url and optional CHAT_COMPLETIONS_API_KEY into api_key (not clobbered by host config) 🤖 Generated with Amplifier Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
…le stub Updated bundle.md to add provider-chat-completions to the providers install-only stub list, ensuring it cold-prepares uniformly with the other providers. Updated all provider documentation and references: - README.md: six providers (was five) - docs/CONFIGURATION.md: env-var and config docs for CHAT_COMPLETIONS_BASE_URL/API_KEY - docs/spec/providers-and-models.md: detailed chat-completions spec and examples - docs/spec/host-config.md: config schema entry - docs/spec/bundle-and-cache.md: six providers reference - docs/LAYERS_AND_RELEASES.md: six providers reference - docs/INTEGRATION.md: six providers reference - docs/architecture/architecture.dot: six providers reference - skills/amplifier-agent/SKILL.md: six providers reference - CHANGELOG.md: [Unreleased] entry for chat-completions provider 🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
Salil Das (sadlilas)
force-pushed
the
add-provider-chat-completions
branch
from
August 18, 2026 05:06
33155e2 to
a731075
Compare
This was referenced Aug 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
chat-completionsas a first-class provider in amplifier-agent's provider catalog, wiring up the existing official moduleamplifier-module-provider-chat-completions. It speaks the OpenAI Chat Completions wire format (/v1/chat/completions) and targets any compatible server — llama.cpp, vLLM, LM Studio, LocalAI, SGLang, TGI, and other OpenAI-compatible endpoints.The module is listed in the ecosystem
MODULES.mdbut was not selectable from amplifier-agent, whose provider set is hardcoded.ISSUES.mdalready notes this seam ("adding a provider requires editing five literals … nothing enforces agreement across them"); this PR makes them agree forchat-completions.Note: this is distinct from the existing
openaiprovider, which uses the OpenAI Responses API and therefore cannot be pointed at a llama.cpp/vLLM server. Filling that gap is the point of this provider.What changed
Code
config/loader.py: addchat-completionsto_VALID_PROVIDER_MODULESsoprovider.module: chat-completionspasses config validation.provider_sources.py: add toKNOWN_PROVIDERSandPROVIDER_CATALOG; add a dedicatedresolve_credential_detailedbranch that readsCHAT_COMPLETIONS_BASE_URL(required) and optionalCHAT_COMPLETIONS_API_KEY. A dedicated branch (rather than aPROVIDER_CREDENTIAL_VARSentry) is required because the generic path routes the primary env var intoapi_key; here the value must land inbase_url.bundle.md: declareprovider-chat-completionsin the install-only stub list so it cold-prepares uniformly with the other providers.Docs: README,
docs/spec/providers-and-models.md,docs/spec/host-config.md,docs/CONFIGURATION.md,docs/spec/bundle-and-cache.md,docs/LAYERS_AND_RELEASES.md,docs/INTEGRATION.md,skills/amplifier-agent/SKILL.md,docs/architecture/architecture.dot,CHANGELOG.md.Verification (Digital Twin, real model — no mocks)
Verified end-to-end in an isolated container running the patched build (
amplifier-agent 0.12.0) against a real Ollama server servingqwen2.5:0.5b:providers list:chat-completionsappears; reportsresolvable=false/source=nonewithoutCHAT_COMPLETIONS_BASE_URL, and flips toresolvable=true/source=envwhen it is set — exercises both the catalog entry and the credential-resolution branch.provider.moduleis rejected withmust be one of [… 'chat-completions' …]— proves the loader gate now includes it (an unpatched build rejectschat-completionsoutright).amplifier-agent rundrove realPOST /v1/chat/completionscalls into the endpoint (confirmed in Ollama's own request log, all HTTP 200) and real, non-empty completions flowed back through the provider — not a silent fallback to another provider.bundle.md; the prepared bundle declares all six providers includingprovider-chat-completions.Honest caveat: a fully-terminated
runenvelope was not captured because prompt prefill of a 0.5B model on aarch64 CPU (~12 tok/s) makes each agentic call ~4–5 min; the provider path itself is proven by the routing + real-completion evidence above. On a GPU host or a hosted OpenAI-compatible endpoint the same config completes in seconds.