Repository navigation
client side modelinfo overrides - #12101
Conversation
| /// Accepts: | ||
| /// - a path to a JSON file containing `ModelsResponse`, | ||
| /// - a JSON string containing a serialized `ModelsResponse`, or | ||
| /// - a TOML inline `ModelsResponse` object. |
There was a problem hiding this comment.
we could drop support for JSON string and get rid of the custom deserialize, but that would make it harder for codex web to supply a full ModelInfo object if files cant be put into containers.
| /// | ||
| /// `#[derive(ModelPatch)]` auto-generates `ModelInfoPatch`, which is used by `model_info.overrides` | ||
| /// in config to apply per-field updates. All fields are patchable unless marked `#[model_patch(skip)]`. | ||
| /// Patch updates are set-only. | ||
| #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, TS, JsonSchema, ModelPatch)] |
There was a problem hiding this comment.
use a macro to generate the partial ModelInfoPatch type from ModelInfo. a bit complex, but avoids statically defining a mirrored type in code and having ugly apply logic like was drafted here.
to avoid either approach, we could support passing overrides only via a catalog_json file path or a predetermined struct with a subset of ModelInfo fields that could be overridden. this would force codex web to put a file with the updated models catalog into the container though.
|
@codex review this |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 25fcef0850
ℹ️ 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".
| // todo(sayan): Make preset/list/default-model flows config-aware so | ||
| // `model_info.catalog_json` and `model_info.overrides` are reflected in | ||
| // picker/app-server model metadata as well (today only get_model_info uses them). |
There was a problem hiding this comment.
can do this as part of this pr or in a follow up, but it doesnt block the eval/codex web use cases because only UX currently misses the overrides.
There was a problem hiding this comment.
Should we do the loading inside load_remote_models_from_file? we decide which file to load from inside it.
There was a problem hiding this comment.
this would make the model catalog a replacement for the existing models.json rather than an overlay, but i think thats fair.
…acro for ModelInfo -> ModelInfoPatch
13a84bd to
e4e9625
Compare
TL;DR
Add top-level
model_catalog_jsonconfig support so users can supply a local model catalog override from a JSON file path (including adding new models) without backend changes.Problem
Codex previously had no clean client-side way to replace/overlay model catalog data for local testing of model metadata and new model entries.
Fix
model_catalog_jsonconfig field (JSON file path).ModelInfo:model_catalog_jsonmodel_context_window,model_supports_reasoning_summaries, etc.)Note
Will revisit per-field overrides in a follow-up
Tests
Added tests