Skip to content

Add modelconfig models generated from truss config schema#4

Merged
cretz merged 1 commit into
mainfrom
modelconfig-gen
May 4, 2026
Merged

Add modelconfig models generated from truss config schema#4
cretz merged 1 commit into
mainfrom
modelconfig-gen

Conversation

@cretz
Copy link
Copy Markdown
Collaborator

@cretz cretz commented Apr 30, 2026

What changed

Added new baseten.client.modelconfig package 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).

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.modelconfig models (preprocess_truss_config_schema, postprocess_models, generate_modelconfig).
  • Check in the Truss config schema JSON and generated modelconfig models + init exports.
  • Add tests validating parsing of representative Truss config.yaml examples; add pyyaml dev 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.

Comment thread baseten/client/modelconfig/_models.py
Comment thread scripts/apigen/specs/config.schema.json
@cretz cretz requested a review from marius-baseten May 1, 2026 21:40
@cretz cretz merged commit 31e5023 into main May 4, 2026
8 of 20 checks passed
@cretz cretz deleted the modelconfig-gen branch May 4, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants