Add modelconfig models generated from truss config schema#4
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new baseten.client.modelconfig package containing Pydantic models generated from the Truss config.schema.json, plus apigen plumbing to download/preprocess/postprocess the schema and generate the package.
Changes:
- Add apigen support for downloading Truss config schema and generating
baseten.client.modelconfigmodels (preprocess_truss_config_schema,postprocess_models,generate_modelconfig). - Check in the Truss config schema JSON and generated
modelconfigmodels + init exports. - Add tests validating parsing of representative Truss
config.yamlexamples; addpyyamldev dependency.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Adds pyyaml to dev deps; bumps ty lock to 0.0.33. |
| pyproject.toml | Adds pyyaml to dev dependency group; bumps ty constraint. |
| scripts/apigen/main.py | Downloads Truss config schema and generates client/modelconfig. |
| scripts/apigen/preprocess.py | Adds preprocessing to rename Truss* schema defs to Model*. |
| scripts/apigen/postprocess.py | Postprocesses generated models to fix datamodel-codegen typing issues. |
| scripts/apigen/specs/config.schema.json | Adds checked-in Truss config JSON schema used for generation. |
| baseten/client/modelconfig/_models.py | Adds generated Pydantic models for config schema. |
| baseten/client/modelconfig/init.py | Exports all generated model types. |
| tests/client/test_modelconfig.py | Adds tests validating parsing of sample config YAMLs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
marius-baseten
approved these changes
May 2, 2026
This was referenced May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Added new
baseten.client.modelconfigpackage with files generated from Truss config JSON schema. Also had to do some pre/post processing to fix names and minor bugs.Will also do for Go and JS (bit harder there).