Documentation
¶
Index ¶
- Constants
- type Cost
- type ModelCapabilities
- type ModelPricing
- type Registry
- func (r *Registry) Calculate(model string, usage litellm.Usage) (Cost, error)
- func (r *Registry) Capabilities(model string) (ModelCapabilities, bool)
- func (r *Registry) Get(model string) (ModelPricing, bool)
- func (r *Registry) LoadFromReader(reader io.Reader) error
- func (r *Registry) LoadFromURL(ctx context.Context, url string) error
- func (r *Registry) Set(model string, price ModelPricing) error
Constants ¶
View Source
const DefaultURL = "https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cost ¶
type ModelCapabilities ¶
type ModelCapabilities struct {
Provider string `json:"litellm_provider"`
MaxInputTokens int `json:"max_input_tokens"`
MaxOutputTokens int `json:"max_output_tokens"`
SupportsTools bool `json:"supports_function_calling"`
SupportsVision bool `json:"supports_vision"`
SupportsReasoning bool `json:"supports_reasoning"`
}
type ModelPricing ¶
type ModelPricing struct {
InputCostPerToken float64 `json:"input_cost_per_token"`
OutputCostPerToken float64 `json:"output_cost_per_token"`
CacheReadCostPerToken float64 `json:"cache_read_input_token_cost,omitempty"`
CacheWriteCostPerToken float64 `json:"cache_creation_input_token_cost,omitempty"`
}
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry() *Registry
func (*Registry) Capabilities ¶
func (r *Registry) Capabilities(model string) (ModelCapabilities, bool)
func (*Registry) LoadFromURL ¶
Click to show internal directories.
Click to hide internal directories.