Skip to content

feat(custom-providers): select Chat Completions, Responses, or Anthropic Messages transport - #8

Merged
pentoshi007 merged 1 commit into
mainfrom
hoplite/pella-cb3df839
Sep 5, 2026
Merged

feat(custom-providers): select Chat Completions, Responses, or Anthropic Messages transport#8
pentoshi007 merged 1 commit into
mainfrom
hoplite/pella-cb3df839

Conversation

@usehoplite

@usehoplite usehoplite Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Custom providers can now declare which API they speak instead of always being treated as OpenAI Chat Completions with a Responses probe.

  • The shared add-provider flow (used by both the Classic and TUI v2 UIs) gains an API type step offering OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages. The choice is persisted on CustomProviderDef.api.
  • api: "chat-completions" sends straight to /chat/completions with no Responses probing.
  • api: "responses" uses the existing Responses stack directly (/responses), including reasoning effort/summary payloads, encrypted reasoning replay, vision input blocks, tools, and streaming.
  • api: "anthropic-messages" routes through the native Anthropic transport at the configured base URL, keeping streaming, vision, tools, thinking, signed-thinking replay, and Anthropic auth (x-api-key + anthropic-version) for model discovery and ping.
  • Existing custom providers with no api keep the previous auto behavior (Responses first, Chat Completions fallback), so stored configs are unaffected.
  • buildAnthropicBody and the Anthropic provider accept a provider id and endpoint so results, request-plan profiles, and reasoning-artifact provenance are attributed to the custom provider rather than to anthropic.

Verification

  • npm run typecheck passes.
  • vitest run test/custom-providers.test.ts test/llm/anthropic-thinking.test.ts test/llm-anthropic-thinking-replay.test.ts test/llm-system-messages.test.ts — 53 tests pass, including two new regressions:
    • a Responses-only custom provider hits /responses exactly once with reasoning: { effort, summary } and returns api: "responses";
    • an Anthropic Messages custom provider hits <baseUrl>/messages with x-api-key, the custom default model, and returns api: "anthropic-messages".

This is a terminal UI change; no browser screenshots apply.

Open in Hoplite

Co-authored-by: Aniket Pandey <aniket00736@gmail.com>
@pentoshi007
pentoshi007 merged commit f2001ea into main Sep 5, 2026
8 checks passed
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