llm

package
v1.0.31 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultRefreshInterval = 12 * time.Hour

Functions

This section is empty.

Types

type LLMModelPricingOption

type LLMModelPricingOption func(*ModelPricing)

func WithInterval

func WithInterval(interval time.Duration) LLMModelPricingOption

func WithOnError

func WithOnError(onError func(error)) LLMModelPricingOption

func WithOnUpdate

func WithOnUpdate(onUpdate func(int)) LLMModelPricingOption

type ModelPrice

type ModelPrice struct {
	OutputCostPerToken float64 `json:"output_cost_per_token"`
	InputCostPerToken  float64 `json:"input_cost_per_token"`
	Provider           string  `json:"litellm_provider"`
	Mode               string  `json:"mode"` // chat, embedding, moderation, audio_speech, audio_transcription, etc
}

type ModelPricing

type ModelPricing struct {
	// contains filtered or unexported fields
}

func NewLLMModelPricing

func NewLLMModelPricing(ctx context.Context, options ...LLMModelPricingOption) *ModelPricing

func (*ModelPricing) Close

func (p *ModelPricing) Close()

func (*ModelPricing) GetPrice

func (p *ModelPricing) GetPrice(model string) *ModelPrice

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL