GeezerVison is showing github.com — Performance issues in the model settings when signed in with OpenRouter · Issue #62583 · anomalyco/opencode
Performance issues in the model settings when signed in with OpenRouter #62583DescriptionDescription
I have OpenRouter and Kilo Gateway authenticated with OpenCode which means due to both of them listing tons of old models and variations thereof, the model list is hundreds of models long.
The WebUI seems like it has thus far only been designed or tested with a single account or OpenCode Zen/Go which dont list as many models in mind. When I do have these providers with tons of models authenticated, opening the model settings gets really laggy. It seems to do a ton of work on the DOM at once, no pagination or only loading models as I scroll to actually see them.
Search is also quite slow/laggy, like it processes/updates the entire list DOM every keystroke.
The experience of trimming down the enabled model list is also a big awkward. I dont see what provider I am currently looking at unless I scroll all the way up, and I cannot collapse all providers at once or collapse the current provider without scrolling all the way up. I am not entirely sure what the best way to improve this is (maybe make the provider name/collapse button sticky while scrolling), but pretty much any improvement in this area would be immensely welcome :)
Plugins
none
OpenCode version
2.2.6
Steps to reproduce
- Authenticate with OpenRouter, Kilo, or any other Model-Gateway accounts (if you have a powerful machine you might need to enable multiple accounts with lots of models for the performance issues to show)
- Open the OpenCode Web UI
- Go to Model settings
- Observe poor performance when opening them or typing in the search bar
Screenshot
Operating System
Arch Linux
Terminal
Ghostty Activityopencodejr commented on Nov 7, 2026 Thanks for the report. I reproduced this with a catalog of about 900 models, using three generated OpenAI-compatible providers with 300 models each to stand in for OpenRouter and Kilo. I ran the web UI in headless Chromium.
On 2.2.6:
- Opening Settings → Models renders all 911 model toggles at once, about 10,000 DOM nodes, and takes about 750 ms.
- Each keystroke in the search field takes about 600–650 ms before the next frame.
- About 900 rows stay rendered while searching, because searching expands every provider group.
On the latest dev (75dbf5b8): the numbers are the same, so the problem is still there.
The script below reproduces it, and the screenshots below show the tab during the test. The sticky provider header and "collapse all" ideas are good UX suggestions, but they're separate from the performance bug.


Reproduction script (web.mjs)
// Reproduces #62583: Settings > Models renders every model row at once and every search keystroke takes ~600 ms.
// Setup: an opencode.json with 3 custom @ai-sdk/openai-compatible providers x 300 models each (900 models), e.g.
// {"provider":{"gateway-a":{"npm":"@ai-sdk/openai-compatible","name":"Gateway-A","options":{"baseURL":"http://127.0.0.1:9/v1","apiKey":"x"},
// "models":{"vendor0/model-0":{"name":"Vendor0 Model 0"}, ... 300 entries}}, "gateway-b": ..., "gateway-c": ...}}
// then `opencode serve --port 4096` and use the printed server password. Install: `npm i playwright && npx playwright install chromium`.
// Usage: OC_URL=http://127.0.0.1:4096 OC_PASSWORD=... node web.mjs (needs `playwright` installed)
import { chromium } from "playwright"
const url = process.env.OC_URL ?? "http://127.0.0.1:4096"
const browser = await chromium.launch()
const ctx = await browser.newContext({ httpCredentials: { username: "opencode", password: process.env.OC_PASSWORD }, viewport: { width: 1280, height: 900 } })
const page = await ctx.newPage()
await page.goto(url + "/settings")
await page.waitForTimeout(3000)
if (await page.getByText("Use password").count()) {
await page.getByText("Use password").click()
await page.waitForTimeout(500)
await page.screenshot({ path: "/workspace/repro/login.png" })
const inputs = page.locator("input")
const n = await inputs.count()
for (let i = 0; i < n; i++) {
const type = await inputs.nth(i).getAttribute("type")
const ph = (await inputs.nth(i).getAttribute("placeholder")) ?? ""
if (type === "password") await inputs.nth(i).fill(process.env.OC_PASSWORD)
else if (/http|url|server/i.test(ph) || type === "url") await inputs.nth(i).fill(url)
}
await page.keyboard.press("Enter")
await page.waitForTimeout(4000)
await page.goto(url + "/settings")
await page.waitForTimeout(4000)
}
await page.screenshot({ path: "/workspace/repro/settings.png" })
const tab = page.getByText("Models", { exact: true }).first()
const t0 = Date.now()
await tab.click()
await page.waitForFunction(() => document.querySelectorAll(".settings-models [role=switch], .settings-models input[type=checkbox]").length > 0, null, { timeout: 60000 })
const openMs = Date.now() - t0
const counts = await page.evaluate(() => ({
switches: document.querySelectorAll(".settings-models [role=switch], .settings-models input[type=checkbox]").length,
nodes: document.querySelectorAll(".settings-models *").length,
}))
console.log("open models tab ms:", openMs, counts)
await page.screenshot({ path: "/workspace/repro/models.png" })
const input = page.locator(".settings-tab-header input").first()
await input.click()
// measure main-thread time per keystroke
const times = []
for (const ch of "model") {
const s = await page.evaluate(() => performance.now())
await page.keyboard.type(ch)
const e = await page.evaluate(() => new Promise((r) => requestAnimationFrame(() => setTimeout(() => r(performance.now())))))
times.push(Math.round(e - s))
}
console.log("per-keystroke ms (type -> next frame):", times)
const after = await page.evaluate(() => document.querySelectorAll(".settings-models [role=switch], .settings-models input[type=checkbox]").length)
console.log("switches rendered while searching:", after)
await page.screenshot({ path: "/workspace/repro/search.png" })
await browser.close()
Run it: bun web.mjs
neriousy commented on Nov 20, 2026 should be fixed in next release, done in #65189
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|