Skip to main content
You can add both supported providers directly into AgentMark Cloud via our CLI, or define custom model schemas with full control over settings and cost information.

Pulling Built-in Models

To add existing models to your project, use the pull-models command:
npx @agentmark/cli@latest pull-models
This interactive command will:
  1. Show you available providers (like OpenAI, Anthropic)
  2. Let you select which models you want to use
  3. Add the appropriate models to your agentmark.json file under builtInModels
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 your agentmark.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
{
  "modelSchemas": {
    "my-custom-model": {
      "label": "My Custom Model",
      "cost": {
        "inputCost": 0.01,
        "outputCost": 0.03,
        "unitScale": 1000000
      },
      "settings": {
        // Settings configuration...
      }
    }
  }
}

Cost Configuration

The cost 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)
Example:
"cost": {
  "inputCost": 0.01,
  "outputCost": 0.03,
  "unitScale": 1000000
}
This means the model costs 0.01permillioninputtokensand0.01 per million input tokens and 0.03 per million output 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
The available setting types are:

Slider / Number

For numeric values with a range:
"temperature": {
  "label": "Temperature",
  "order": 1,
  "default": 0.7,
  "minimum": 0,
  "maximum": 2,
  "multipleOf": 0.1,
  "type": "slider",
  "ui": "slider"
}
For number inputs without a slider:
"max_tokens": {
  "label": "Max Tokens",
  "order": 2,
  "default": 1024,
  "minimum": 1,
  "maximum": 4096,
  "multipleOf": 1,
  "type": "number"
}
Properties:
  • 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:
"response_format": {
  "label": "Response Format",
  "order": 3,
  "default": "json",
  "type": "string",
  "ui": "select",
  "options": [
    { "label": "JSON", "value": "json" },
    { "label": "Text", "value": "text" }
  ]
}
Properties:
  • type: "string"
  • ui: "select"
  • options: Array of { label, value } objects

Image Size

For image generation models:
"image_size": {
  "label": "Image Size",
  "order": 4,
  "default": "1024x1024",
  "type": "string",
  "ui": "imageSize"
}
Properties:
  • type: "string"
  • ui: "imageSize"

Aspect Ratio

For aspect ratio selection:
"aspect_ratio": {
  "label": "Aspect Ratio",
  "order": 5,
  "default": "16:9",
  "type": "string",
  "ui": "aspectRatio"
}
Properties:
  • type: "string"
  • ui: "aspectRatio"

Complete Example

Here’s a complete example of a custom model schema:
{
  "modelSchemas": {
    "gpt-4-custom": {
      "label": "GPT-4 Custom",
      "cost": {
        "inputCost": 0.03,
        "outputCost": 0.06,
        "unitScale": 1000000
      },
      "settings": {
        "temperature": {
          "label": "Temperature",
          "order": 1,
          "default": 0.7,
          "minimum": 0,
          "maximum": 2,
          "multipleOf": 0.1,
          "type": "slider",
          "ui": "slider"
        },
        "max_tokens": {
          "label": "Max Tokens",
          "order": 2,
          "default": 2048,
          "minimum": 1,
          "maximum": 8192,
          "multipleOf": 1,
          "type": "number"
        },
        "response_format": {
          "label": "Response Format",
          "order": 3,
          "default": "text",
          "type": "string",
          "ui": "select",
          "options": [
            { "label": "Text", "value": "text" },
            { "label": "JSON", "value": "json" },
            { "label": "JSON Schema", "value": "json_schema" }
          ]
        }
      }
    },
    "dall-e-3": {
      "label": "DALL-E 3",
      "cost": {
        "inputCost": 0.04,
        "outputCost": 0,
        "unitScale": 1
      },
      "settings": {
        "image_size": {
          "label": "Image Size",
          "order": 1,
          "default": "1024x1024",
          "type": "string",
          "ui": "imageSize"
        },
        "quality": {
          "label": "Quality",
          "order": 2,
          "default": "standard",
          "type": "string",
          "ui": "select",
          "options": [
            { "label": "Standard", "value": "standard" },
            { "label": "HD", "value": "hd" }
          ]
        }
      }
    }
  }
}

Best Practices

  1. Use descriptive labels: Make it clear what each setting does
  2. Set appropriate ranges: Define minimum and maximum values that make sense for your model
  3. Order settings logically: Use the order property to arrange settings in a user-friendly way
  4. Provide sensible defaults: Choose default values that work well for most use cases
  5. Document costs accurately: Ensure the cost configuration matches your provider’s pricing