Repository navigation
Write context window and max tokens into Pi's models.json on configure - #37
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
Co-Authored-By: john <john@requesty.ai>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
AI CostNo spend detected for branch Updated 2026-10-07T11:13Z · last 30 days · data from Requesty |
| // modelConfig describes model in models.json with the capacities the model | ||
| // list reports, since Pi caps a model without them at 128k tokens. When the | ||
| // list cannot be fetched, the launch defaults stand in. | ||
| func (p *PiHarness) modelConfig(model string) piModelConfig { |
There was a problem hiding this comment.
I'm not sure what you're doing here. If we have access to the Model, don't we also have the context window information?
There was a problem hiding this comment.
Agreed, refetching wasn't needed. The TUI model picker already has the full client.Model. In dfe9c5f the picker copies ContextWindow/MaxOutputTokens into ConfigureOptions with the ID, and Pi builds its entry from those with piCatalogModelFrom. That drops the network call and the httptest server. If the list has no values, the launch defaults (200k / 8192) apply.
Co-Authored-By: john <john@requesty.ai>
Summary
Before this change,
requesty configurefor Pi wrote only{"id": "<model>"}into~/.pi/agent/models.json. Pi then used its custom-model defaults (contextWindow ?? 128000,maxTokens ?? 16384inmodel-registry.ts), so a 1M-context model run through plainpistopped at 128k.The TUI model picker already loads
client.Modelfrom/v1/models. It now copies the picked model'sContextWindowandMaxOutputTokensintoConfigureOptions. In both configure paths, Pi builds its entry from those withpiCatalogModelFrom, the same function therequesty pilaunch catalog uses:{"id": "openai/gpt-5.5", "contextWindow": 1050000, "maxTokens": 128000}If the list has no value for one of these, the launch defaults are written (
piCatalogContextWindow200k,piCatalogMaxTokens8192). Other harnesses ignore the new options.Link to Devin session: https://app.devin.ai/sessions/feb93c6a56e847888cf65ee01f6e6559
Open in Devin Desktop: https://app.devin.ai/desktop/session/feb93c6a56e847888cf65ee01f6e6559?variant=devin
Requested by: @requesty-JohnCosta27