modelrouting

package
v1.7.20 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	TierOpus   = "opus"
	TierSonnet = "sonnet"
	TierHaiku  = "haiku"
	// TierFable is Claude Code's top tier. It ranks above Opus, so a fable
	// request that reaches the pool without a mapped slot lands on the
	// strongest model rather than falling through to the Sonnet default.
	TierFable = "fable"
)

Variables

This section is empty.

Functions

func MapModel

func MapModel(requestedModel string, configuredModel string, availableModels []string) string

MapModel picks a concrete upstream model for a Claude-style request.

Precedence:

  1. A single configuredModel overrides mapping entirely.
  2. A comma-separated configuredModel is treated as the exclusive candidate pool.
  3. Otherwise availableModels is the candidate pool.

Matching order within the pool: exact (case-insensitive) name, then tier heuristics, then the first pool entry. An empty pool returns "" — callers must not invent a vendor-specific default such as deepseek-chat.

func SplitCSV

func SplitCSV(models string) []string

Types

This section is empty.

Jump to

Keyboard shortcuts

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