Pulling Built-in Models
To add existing models to your project, use thepull-models command:
- Show you available providers (like OpenAI, Anthropic)
- Let you select which models you want to use
- Add the appropriate models to your
agentmark.jsonfile underbuiltInModels
You’ll still need to register your models with your framework of choice in order to use them in your application.
Custom Model Schemas
You can define custom model schemas in youragentmark.json file under the modelSchemas property. This allows you to configure model-specific settings, pricing, and UI controls.
Basic Structure
Each model schema includes:- label: Display name for the model
- cost: Pricing configuration
- settings: Configuration options with UI controls
Cost Configuration
Thecost object defines pricing for the model:
- inputCost: Cost per unit for input tokens
- outputCost: Cost per unit for output tokens
- unitScale: Number of tokens per unit (e.g., 1000000 means cost is per million tokens)
Settings Configuration
Settings define the configurable parameters for your model. Each setting has:- label: Display name in the UI
- order: Determines the display order in the UI
- default: Default value for the setting
Slider / Number
For numeric values with a range:- type:
"slider"or"number" - ui: (optional)
"slider"to show a slider UI - minimum: Minimum allowed value
- maximum: Maximum allowed value
- multipleOf: Step increment value
Select
For dropdown selection:- type:
"string" - ui:
"select" - options: Array of
{ label, value }objects
Image Size
For image generation models:- type:
"string" - ui:
"imageSize"
Aspect Ratio
For aspect ratio selection:- type:
"string" - ui:
"aspectRatio"
Complete Example
Here’s a complete example of a custom model schema:Best Practices
- Use descriptive labels: Make it clear what each setting does
- Set appropriate ranges: Define minimum and maximum values that make sense for your model
- Order settings logically: Use the
orderproperty to arrange settings in a user-friendly way - Provide sensible defaults: Choose default values that work well for most use cases
- Document costs accurately: Ensure the cost configuration matches your provider’s pricing