Skip to content

Studio: rework Settings > Connections with status, a provider gallery and new connection types - #17753

Merged
danielhanchen merged 34 commits into
mainfrom
studio-connections-overhaul
Nov 14, 2026
Merged

danielhanchen merged 34 commits into
mainfrom
studio-connections-overhaul

Conversation

@shimmyshimmer

@shimmyshimmer shimmyshimmer commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

What changes for the user

Connections page

  • The page follows the standard settings layout: a "Your connections" section and an "Add a connection" section, with no boxed panels.
  • "Enable connections" is a pill switch in the page header.
  • Every connection has a status: Connected, Needs API key, Key rejected, No credit, Rate limited, Unreachable, Timed out, Sign in again or Off. A healthy row shows its endpoint and models; a broken one shows a short fix, with the server's full message on hover.
  • Opening the page checks each connection at most once per ten minutes. The header button shows how old the answers are ("Checked 2m ago") and re-checks all of them.
  • Every connection has an on/off switch. A switched-off connection stays in the list, dimmed, and is offered in no model picker. The backend already refused disabled connections; the UI could neither set the flag nor show a row that had it.
  • A provider gallery replaces the dropdown as the way to add a connection. It has four groups (Popular, Local, More providers, and a folded "Even more") and a search box. An empty list now shows the gallery instead of opening a form with one provider preselected.

Connection form

  • A pasted API key is checked as soon as it stops changing. The models it reaches are listed and, for a new connection, the newest ones are ticked. A rejected key is reported under the key field.
  • "Add connection" with nothing ticked lists the models and ticks the suggestions, instead of failing with "Load available models first".
  • "Test connection" checks the form as typed, before saving.
  • Token limit, extra headers, reasoning and new-model checks fold under "Advanced settings", which opens by itself when one of them is in use.
  • The provider dropdown uses the same groups and order as the gallery, with pill hovers and a fade at the edge when there is more to scroll.
  • The model list sits in a rounded box with edge fades and a scrollbar that shows on hover. Rows show the model name only; hovering a row opens a card with its inputs, reasoning levels and context window.
  • Models released more than a year ago fold behind an "Older models" link. A ticked model stays visible, search still finds folded ones, and "Select all" only ticks what is showing. Release dates come from the daily catalog refresh, so an existing install starts folding after its next refresh.
  • Each provider links to the page where its API key is created.
  • Descriptions across the form are shorter.

New connection types

Added to the gallery: xAI, NVIDIA NIM, Perplexity, Cohere, Vercel AI Gateway, Azure OpenAI, Amazon Bedrock, Google Vertex AI and SGLang.

  • Azure OpenAI, Amazon Bedrock and Google Vertex AI use the self-hosted form: an endpoint, a key and typed model IDs.
  • SGLang is a preset over the plain OpenAI-compatible form with its default local URL.
  • Types with no usable model list are checked by sending one 16-token chat to the first model.

None of these was exercised with a real key. They were wired from each service's published API reference.

Backend

  • POST /api/providers/test returns error_kind (auth, billing, rate_limit, not_found, unreachable, timeout, invalid_url, other) and has its own sentence for 402, 429 and read timeouts.
  • A custom endpoint check reports a named cause from /models instead of asking for a model ID or surfacing the fallback probe's plain 404.
  • GET /api/providers/registry carries api_key_url.
  • Catalog entries carry released (the model's release date) when the source has a well-formed one.

All of these are additive. An older frontend ignores the new fields; the new frontend falls back when an older backend omits them.

Logos

  • New transparent logos for the added connection types, plus transparent single-colour marks for four existing ones that sat in a white or black box. Single-colour marks invert in dark mode.
  • The Microsoft logo used by the Model hub lost its grey background square so one file serves both places.

Fixes found on the way

  • A model list answer that arrived after the form had moved to another connection was written into that connection's form.
  • The settings page and the sync it starts each fetched the registry; they now share one request.
  • The show/hide key button drifted off the input when a message rendered below it.

Behaviour changes worth a look

  • An empty Connections page no longer jumps into the add form. tests/connections-empty-opens-form.test.ts is rewritten for the new behaviour.
  • Opening the page now sends one check per enabled connection (a /models call, at most every ten minutes). Connections without a key are skipped.
  • The form's "Clear" button on a new connection is now "Cancel" and returns to the list.
  • A manual connection check no longer toasts on success; the row's status shows it. Failures still toast.
  • The "Selected" filter in the model list is removed.
  • Models over a year old are hidden by default in the model list.

Branch history

The branch contains a commit for cloud summary compaction and a later commit that takes it out again. That work has its own pull request (#17743), so the net diff here is the Connections work only.

Fixes during review

  • SGLang is saved as a plain custom server. The preset fell through to the OpenAI backend type, which sent every turn to /v1/responses, applied OpenAI's sampling rules and skipped reading the server's window.
  • A connection checked by a short chat (Azure, Bedrock, Perplexity, Vertex) now reports Unreachable and Timed out; the client turns those failures into error frames, which the check read as a plain failure.
  • A shared connection of those types is checked with one chat on a model the account may use, instead of a model listing it does not have.
  • Switching provider while models load no longer leaves the form on "Loading" with Save disabled.
  • The shared-connection check test expects the new error_kind field.
  • A switched-off connection keeps its browser-only options (output cap, headers, prompt caching) across a reload; the off rows are now saved like the on ones.
  • Azure chats and checks no longer send temperature, top_p or presence_penalty, which reasoning deployments reject; the deployment name hides the model, as on the custom Azure path.
  • NVIDIA NIM no longer offers an effort selector or thinking toggle: no request field reaches its models.
  • SGLang and Vertex read Studio tools, vision and thinking from the registry type they are sent as (custom, gemini), so Search, Tools, MCP and Docs stay on.
  • A Gemini connection on Vertex's OpenAI-compatible /endpoints/openapi URL stays on chat completions with Bearer auth, as before this PR; native Vertex URLs use the Gemini API.
  • Merged with main after Studio: summarize long cloud chats instead of dropping their oldest turns #17743: the connection form keeps the "Auto-compact after" field in this layout.

How it was checked

  • npm run typecheck, npm test (16286 pass, 0 fail) and npm run build in studio/frontend.
  • pytest on the provider test files in studio/backend/tests (connection checks, model capabilities, new cloud providers): 105 passed.
  • Driven by hand in a local CPU-only Studio against a mock provider: the list with each status, the switch, the gallery and its search, the grouped dropdown, the form with Advanced open, the model list with the older-models fold and hover card, dark and light themes for the gallery.

Not checked

  • No real provider keys were used, so no new connection type has made a live request.
  • No cross-platform staging run.
  • Desktop builds were not run.

Screenshot

An empty Connections page (left: main, right: this PR): the provider gallery replaces the form that opened by itself, with the new connection types listed.

Before and after: Connections page provider gallery

…ry and inline key checks

The Connections page was a list with no state and a form that opened with a
provider dropdown. A key was only checked on request, the result was a toast,
and a connection switched off through the API disappeared from settings.

List page
- Each connection shows one status line: Connected, Needs API key, Key
  rejected, No credit, Rate limited, Unreachable, Timed out, Sign in again
  or Off. Opening the page checks each connection at most once per ten
  minutes, and the header button shows how old the answers are and re-checks
  them all.
- Each connection has an on/off switch. A switched-off connection stays in
  the list, dimmed, and is offered in no picker. The backend already refused
  disabled connections; the UI had no way to set or see the flag.
- A provider gallery (Popular, Local and custom, More providers, with search)
  replaces the dropdown as the way in. An empty list now shows the gallery
  instead of jumping into a form with ChatGPT preselected.
- The models.dev catalog shows its age and can be refreshed on demand.

Form
- A pasted key is checked as soon as it stops changing. The models it reaches
  are listed and, for a new connection, the newest ones are ticked. A rejected
  key is reported under the key field. OpenRouter and Hugging Face keys get a
  real key check first, since their model list is public.
- "Add connection" with nothing ticked lists the models and ticks the
  suggestions instead of asking for a separate Load click.
- "Test connection" checks the form as typed, before saving.
- Token limit, extra headers, reasoning and new-model checks fold under
  Advanced, which opens by itself when one of them is in use.
- Model rows show context window, Vision and Reasoning from the catalog, and
  a Selected filter narrows a long list to what is ticked.
- Each provider links to the page where its API key is created.

Backend
- POST /api/providers/test returns error_kind and says what went wrong for
  402, 429 and read timeouts, not only 401/403 and connection failures.
- A custom endpoint check reports a named cause from /models instead of
  asking for a model ID or surfacing the fallback probe's plain 404.
- GET /api/providers/registry carries api_key_url.
- GET /api/providers/model-catalog?refresh=true refetches inside the daily
  TTL, at most once a minute.

Fixes found on the way
- A model list answer that arrived after the form had moved to another
  connection was written into that connection's form.
- The settings page and the sync it starts each fetched the registry; they
  now share one request.
- The show/hide key button drifted off the input when a message rendered
  below it.
…zure OpenAI, Amazon Bedrock and Vertex AI connections

Each is wired from the vendor's API docs.

- xAI: filters image, video and voice models from the list, sends
  max_completion_tokens, omits presence_penalty, and never sends an effort of
  none because Grok reasoning cannot be turned off.
- NVIDIA NIM: filters embedding, guard, OCR and translation models by name,
  caps temperature at 1 and omits presence_penalty, since its per-model
  schemas reject unknown fields.
- Perplexity: a fixed list of the Sonar models on the bare host, tools off.
- Cohere: the compatibility endpoint for chat, the native endpoint for the
  model list, and reasoning effort mapped onto none and high.
- Vercel AI Gateway: lists language models only and checks the key against
  /credits, because its model list is public.
- Azure OpenAI: the resource's /openai/v1 endpoint with typed deployment
  names, over chat completions.
- Amazon Bedrock: the OpenAI-compatible runtime route with a Bedrock API key
  as a bearer token, so no request signing. Model IDs are typed.
- Vertex AI: the native Gemini client pointed at the Vertex host with an API
  key. It is stored as a Gemini connection and shown as Vertex by its host.

Azure, Bedrock, Vertex and Perplexity have no usable model list, so their
connection check sends one short chat to the first model instead.

The seed model snapshot is regenerated from models.dev to include xAI, NVIDIA
and Cohere.
…urns

A chat on a cloud connection that outgrew its window used to lose its oldest
turns unless the provider compacted server-side (Anthropic direct, OpenAI
Responses). Claude through OpenRouter, Vercel AI Gateway or Bedrock, and every
other chat-completions provider, went down that path.

- Summary compaction: when a request would pass the threshold, Studio asks the
  same connection and model for a structured summary of the older turns, keeps
  the recent ones verbatim (up to 15,000 tokens or 30% of the prompt budget)
  and sends summary plus tail. The summary joins the system prompt, pinned
  instructions stay verbatim, and the summarized turns are archived so
  search_conversation still reaches them. A backlog too long for one call is
  folded in oldest first.
- The summary is saved per thread (chat_thread_summaries, keyed by a digest of
  the turns it covers) and reused on later turns; an edited or branched
  history does not match and gets its own. The transcript itself is untouched.
- If the summary call fails, the old eviction runs, so the chat never fails
  because of it.
- /compact works on a cloud model. OpenAI Responses and Anthropic compact
  natively for that request (their trigger is lowered to the documented
  floor); a Claude thread under 60K tokens and every other provider use the
  summary call.
- Connections have an "Auto-compact after" token setting under Advanced,
  stored with the connection. It replaces the default of 75% of the window and
  may pass the 200K default cap on Anthropic and OpenAI native compaction up
  to the model's window. Anthropic's 50K floor stays. Neither vendor documents
  an upper limit, only a floor (links in external_provider.py).
- If a provider refuses a request as too long before any output, Studio
  compacts once and resends. A second refusal is shown as the error. Off when
  auto-compact is off.
- The context meter shows a cloud model's catalogued window, marks where the
  chat compacts and names the trigger in its tooltip. The thread says
  "Earlier messages summarized" or "Older messages dropped" instead of one
  generic notice, and a progress frame is sent while the summary is written.
- A Compact chip appears next to send on a cloud thread over 50,000 tokens
  that has been idle past the provider's prompt cache lifetime. While it is
  on, the next message is sent after a summary; a click keeps the full history
  for that message.

Local GGUF, MLX and managed engines are unchanged.
… model list; drop the manual model data refresh
It has its own pull request, so this branch carries the Connections work only.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T18:06:42.782953Z 53032c7 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@danielhanchen danielhanchen self-assigned this Nov 14, 2026
shimmyshimmer and others added 5 commits November 14, 2026 03:50
…ed rows by chat

The chat probe reads the client's error frames, so a refused connection or read timeout
came back as a plain failure instead of Unreachable / Timed out. A shared Azure, Bedrock,
Perplexity or Vertex row was checked by listing models it does not have; check it with
one chat on a model the account may use. The shared failure result gained error_kind.
…a provider switch

The SGLang preset fell through to the openai backend type, which sends every turn to
/v1/responses with OpenAI's sampling rules and skips the served-window probe. Switching
provider during a model load retired the load without clearing its loading flag.

[skip ci]
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 14, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 14, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 14, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 14, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 14, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 14, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 14, 2026
@unslothai unslothai deleted a comment from shimmyshimmer Nov 14, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 9e148adacf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# Conflicts:
#	studio/backend/core/inference/provider_model_capabilities.py
#	studio/frontend/src/features/chat/chat-providers-dialog.tsx
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: ca3ce9d858

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen

Copy link
Copy Markdown
Member

Repo tests (CPU, studio) fails on this branch in tests/studio/test_provider_backfill_awaits_batch.py:

ReferenceError: useExternalProvidersStore is not defined
    at syncBackfillTail (.../harness.ts:1899:3)

The test slices the backfill tail of syncExternalProvidersFromBackend out of sync-external-providers.ts and runs it in a small harness that only provides the locals in TAIL_PARAMS. This PR's tail now reads useExternalProvidersStore.getState() (a module import), which the harness does not define. Either keep the store read above the sliced tail and pass the value in, or extend the harness to stub useExternalProvidersStore. Main is green on this test.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 14, 2026
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 576b7227a4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +110 to +111
if (configProviderType === "gemini" && isVertexBaseUrl(configBaseUrl)) {
return "vertex";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve Gemini continuation handling for Vertex connections

When a native Vertex response is stopped during thinking, before producing answer text, Continue cannot resume it: this normalization gives the connection the UI type vertex, but hasGeminiReplayContinuation in api/chat-adapter.ts still requires externalProvider.providerType === "gemini". Consequently, even with captured thought parts/signatures, the adapter throws “This response cannot be resumed” instead of sending the continuation. The same type check also skips Gemini continuation-history expansion. Normalize the alias in these native-Gemini paths, or retain the Gemini runtime identity separately from the gallery label.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 53032c7: one helper says a connection talks to the Gemini API by type (gemini or vertex), and the adapter's thought replay, resume check, continuation turns and thought capture, the composer's image-mode rule and the stop window all use it; tests added.

@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 53032c73c1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit c1ca45d into main Nov 14, 2026
@danielhanchen
danielhanchen deleted the studio-connections-overhaul branch November 14, 2026 19:36
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.

2 participants