Appearance
Track Cost for Custom Models
If you omit pricing_json, the SDK picks pricing automatically for common models.
To match prices configured in ARMS, or to cover custom and fine-tuned models, pass your own pricing file or the public pricing export / Manage Models SDK Pricing URL.
Using a Custom Pricing File
Pass your own pricing_json value, either a file path or a URL pointing to a custom JSON file. This file should contain pricing details such as model names and their associated costs for chat-based models.
Example usage:
To load pricing details from an external URL:
python
elsai_arms.init(pricing_json="https://example.com/path/to/your/pricing.json")To load pricing details from a local file path:
python
elsai_arms.init(pricing_json="/path/to/your/local/pricing.json")Important considerations
JSON structure: The custom pricing JSON must follow the same structure as the SDK's default pricing format. If the structure does not match, ARMS will not be able to accurately calculate costs based on the custom pricing file.
Initialization: The SDK initializes by pulling data from the provided or default JSON source. Ensure that the path or URL is accessible during initialization.
Updates: If pricing details change, update your custom JSON file accordingly. If using a URL, update the file at that URL; if using a local file, update it on disk.
Automatic pricing: If you do not set
pricing_json, the SDK picks a default table automatically.