openmeter / llmcost /sync /normalizer.go
Leon4gr45's picture
Upload folder using huggingface_hub (part 5)
cee2387 verified
Raw
History Blame Contribute Delete
676 Bytes
package sync
import (
"github.com/openmeterio/openmeter/openmeter/llmcost"
)
// ModelIDNormalizer maps model identifiers to a canonical form.
// Source-specific normalization should be done by each Fetcher before
// returning prices; the normalizer only applies generic transforms.
type ModelIDNormalizer interface {
Normalize(modelID string, provider string) (canonicalProvider string, canonicalModelID string)
}
type defaultNormalizer struct{}
func NewDefaultNormalizer() ModelIDNormalizer {
return &defaultNormalizer{}
}
func (n *defaultNormalizer) Normalize(modelID string, provider string) (string, string) {
return llmcost.NormalizeModelID(provider, modelID)
}