Skip to content

/provider rebuilds and re-compresses a ~5.5MB payload on every web UI page load #44180

Closed as not planned

Description

@camalolo

Description

Every web UI page load calls GET /provider. The handler walks the whole models.dev catalog through deep clones + per-model schema validation, then JSON.stringifys ~5.5MB and gzips it — every single request. Measured ~700ms p50, 2s+ p95 under load; profiling showed ~33% of server CPU in schema validation and 13% in JSON.stringify. Under concurrent load this starves unrelated endpoints (p95 up to 11.7s elsewhere while /provider churned).

The four inputs (config, models.dev catalog, connected providers, credentials) are reference-stable between reloads, so the encoded payload could be memoized on input identity and invalidated when a reload swaps any input. Same for gzip/deflate of identical response bodies.

With such a patch I measured p50 726ms → 22ms and ~5 → ~205 req/s. Happy to send it.

Plugins

None

OpenCode version

1.18.21

Steps to reproduce

  1. opencode serve with the web UI enabled and a populated models.dev cache
  2. Open the web UI, watch GET /provider in the browser network tab across page reloads
  3. Server re-validates and re-serializes the full catalog on every request; under concurrent load other endpoints slow down noticeably

Screenshot and/or share link

N/A

Operating System

Windows 11

Terminal

Windows Terminal

Activity

  1. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions