GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||
GeezerVison is showing github.com — feat(ai): describe text models by api, baseURL and auth by rekram1-node · Pull Request #61501 · anomalyco/opencode Conversation
|
| File | Before | After |
|---|---|---|
session/model-request.ts |
base.model.route.endpoint.baseURL; AIModel.with(base.model, { route: base.model.route.with({ endpoint: { baseURL } }) }) |
base.model.baseURL; AIModel.with(base.model, { baseURL }) |
model-resolver.ts |
resolved.route.endpoint.baseURL; AIModel.with(model, { route: model.route.with({ auth: Auth.none }) }) |
resolved.baseURL; AIModel.with(model, { auth: Auth.none }) |
aisdk.ts, perf/snapshot.ts |
Model.make({ ..., route }) |
Model.make({ ..., api: route }) |
Model.with({ baseURL }) deploys the original API with the model's current auth, which is the same route the old route.with(...) chain produced (the Auth.none override from the resolver is kept). No plugin, SDK, server or config surface changes.
Checked locally: 36 sample models byte-identical (method, URL, headers, body vs a snapshot taken before the redesign); full catalog 8544 models, 0 requests differ (7732 send a request; the rest are AI SDK packages or need real cloud config). Both checks resolve models through ModelResolver and capture the request the AI package sends; they stay out of the repo.
<svg xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72" font-family="ui-monospace,monospace" font-size="9"> <rect width="240" height="72" rx="8" fill="#111"/> <text x="12" y="20" fill="#9cdcfe">Model.make({</text> <text x="22" y="34" fill="#ce9178">api: apis.openaiChat,</text> <text x="22" y="48" fill="#ce9178">baseURL: <tspan fill="#b5cea8">"localhost:1234"<animate attributeName="opacity" values="1;1;0;0;1" dur="4s" repeatCount="indefinite"/></tspan> </text> <text x="70" y="48" fill="#b5cea8" opacity="0">"gpu-box:1234"<animate attributeName="opacity" values="0;0;1;1;0" dur="4s" repeatCount="indefinite"/></text> <text x="12" y="62" fill="#9cdcfe">})</text> <circle cx="214" cy="36" r="6" fill="#4ec9b0"><animate attributeName="r" values="4;7;4" dur="2s" repeatCount="indefinite"/></circle> </svg>
baseURL, auth split out of their api), and deleting Route.model / MediaRoute.deployment with providers becoming presets over Model.make. That is the remaining step of the plan, together with the callable provider surface from refactor(ai): callable providers #60966.Model is not JSON-serializable (the api is a value with functions). api.id is enough for core today, so no toJSON yet.api stays a value, not the v2 protocol name string ("chat-completions", "responses", ...). Several package APIs share one v2 name with different dialects (OpenAI, Z.ai, Alibaba and Venice Chat; Bedrock Mantle's own metadata key and compaction), and provider presets attach transports and compaction to them, so a string would need a registry plus per-dialect compatibility first.baseURL stays optional: media and decision models carry theirs inside api until the next step. There is no top-level headers: deployment headers are options.headers, the same key a request uses.src +90 / -36 (the apis entry point and the baseURL/path/auth fields), tests +127 / -69 (mostly route: → api: in hand-built test models, plus test/model.test.ts).
bun typecheck and bun run typecheck:tsc in packages/ai, core, server, sdk, plugin: passbun test in packages/ai: 2048 pass, 0 failpackages/core: model-resolver, session-runner, config/provider, session-runner-recorded, plugin/: 900 pass, 0 failbun run check: pass
Sorry, something went wrong.
There was an error while loading. Please reload this page.
f40b4ac to
ae8b95c
Compare
daea909 to
3b98718
Compare
ae8b95c to
f0c28ab
Compare
3b98718 to
d93d8f8
Compare
f0c28ab to
40ed33d
Compare
d93d8f8 to
1aac3bd
Compare
40ed33d to
7f29f54
Compare
1aac3bd to
56caa75
Compare
7f29f54 to
260b913
Compare
56caa75 to
ccb3965
Compare
260b913 to
9dbebb5
Compare
ccb3965 to
4ae08ae
Compare
9dbebb5 to
a1798d3
Compare
|
Folded into #61499: the model is now a plain object, and |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.