Skip to content

OpenAI-compatible endpoints via base_url (v0.14.2) - #16

Merged
scr1p7k177y merged 1 commit into
mainfrom
feat/openai-compatible-adapter
Jun 29, 2026
Merged

scr1p7k177y merged 1 commit into
mainfrom
feat/openai-compatible-adapter

Conversation

@scr1p7k177y

Copy link
Copy Markdown
Member

Stacked on #15 (base = docs/sample-usage-and-offline-demo). Merge #15 first, then this — basing on main would conflict on the README/CHANGELOG/version lines #15 already touches.

What

dispatchOpenAI now reaches any service speaking the OpenAI /chat/completions REST shape — NVIDIA, Together, Groq, OpenRouter, vLLM, LM Studio. Plain fetch, no SDK dependency.

  • base_url from OPENAI_BASE_URL env (wins) or config/providers.openai.base_url, default https://api.openai.com/v1. Env-first mirrors getApiKey().
  • Reads reasoning_content when content is empty, so reasoning models (qwen3, deepseek-r1) aren't silently dropped.
  • Drops the uninstalled openai SDK require that made the old path unusable.

Why

The previous dispatchOpenAI hardcoded api.openai.com and require('openai') (never a dependency), so OpenAI-compatible providers were unreachable.

Tests / validation

  • 5 new unit tests for the path: URL + bearer auth, content/reasoning_content parsing, trailing-slash base_url, non-ok status throw, usage-estimate fallback. 204 tests pass, lint clean, npm ci clean.
  • Validated live end-to-end against NVIDIA meta/llama-3.3-70b-instruct: a real task ran researcher → self-eval through this code path (status=done, real TAM/SAM/SOM output, eval 4/5, provider=openai). Key supplied via env only; nothing secret committed.

Docs / version

README "OpenAI-compatible providers" section, commented NVIDIA example in providers.yaml, CHANGELOG [0.14.2], version bumped 0.14.1 to 0.14.2 (package.json, package-lock x2, server.js, README badge).

dispatchOpenAI now uses plain fetch with a configurable base_url
(OPENAI_BASE_URL or providers.openai.base_url), dropping the OpenAI SDK
dependency, and reads reasoning_content when content is empty so
reasoning models (qwen3, deepseek-r1) aren't silently lost.
Base automatically changed from docs/sample-usage-and-offline-demo to main June 29, 2026 14:54
@scr1p7k177y
scr1p7k177y merged commit b35789c into main Jun 29, 2026
2 checks passed
scr1p7k177y added a commit that referenced this pull request Oct 4, 2026
OpenAI-compatible endpoints via base_url (v0.14.2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant