Model Schemas
Configure models and their user interfaces in Puzzlet
Model schemas gives developers control over a few key aspects of Puzzlet:
-
Model Availability: Define which models (both built-in and custom) are available in your Puzzlet dashboard
-
User Interface Control: Precisely specify which parameters platform users can modify through the UI, while keeping sensitive or advanced configurations under developer control
-
Cost Customization: Customize the costs for your custom models. These allow you to see logs/metrics/traces for your custom models in Puzzlet.
When you run npx @puzzlet/cli@latest init
, it will create a puzzlet.json
file in your project root with default model schemas.
Adding Models
To add models to your project, use the pull-models
command:
This interactive command will:
- Show you available providers (like OpenAI, Anthropic)
- Let you select which models you want to use
- Add the appropriate model schemas to your
puzzlet.json
file
Model Schema Configuration
Each model schema allows you to:
- Set a user-friendly display label
- Configure available settings and their UI controls
- Define parameter constraints and defaults
- Control the order and presentation of settings
Here’s an example of a model schema:
Multiple Models
You can define multiple models in your schema, each with its own configuration:
Setting Properties
Each setting in a model schema can define:
- minimum/maximum: The allowed range for numeric values
- default: The initial value
- multipleOf: Step size for numeric inputs
- label: Display name in the UI
- order: Control the display order in forms
- type: The type of the setting (e.g. “number”, “string”, “boolean”)
- ui: The UI control to use for the setting (e.g. “slider”…more to come)
Custom Model Schemas
Puzzlet is fully extensible, so you can define your own model schemas.
Customizing Costs
You can also customize the costs for your custom models. These allow you to see logs/metrics/traces for your custom models in Puzzlet.
Model schemas define the UI and validation rules for model settings. The actual implementation details for each model are configured in your provider settings.
Was this page helpful?