constant

package
v0.260418.2200 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Default authentication tokens
	DefaultUserToken  = "tingly-box-user-token"
	DefaultModelToken = "tingly-box-model-token"

	// Default mode name
	DefaultModeName = "tingly"
)
View Source
const (
	LogDirName = "log"

	// DebugLogFileName is the name of the debug log file
	DebugLogFileName = "bad_requests.log"

	// DefaultRequestTimeout is the default timeout for HTTP requests in seconds
	DefaultRequestTimeout = 1800
	// DefaultMaxTimeout in seconds
	DefaultMaxTimeout = 30 * 60
	// ModelFetchTimeout is the timeout for fetching models from provider API in seconds
	ModelFetchTimeout = 30

	// DefaultMaxTokens is the default max_tokens value for API requests
	DefaultMaxTokens = 8192
)
View Source
const (
	DefaultLatencyThresholdMs    = int64(2000) // Default latency threshold in milliseconds
	DefaultLatencySampleWindow   = 100         // Default number of latency samples to keep
	DefaultLatencyPercentile     = 0.95        // Default percentile for latency comparison (0.95 = p95)
	DefaultLatencyComparisonMode = "avg"       // Default comparison mode: "avg", "p50", "p95", "p99"
)

Latency-based routing defaults

View Source
const (
	DefaultMinSpeedSamples   = 5    // Minimum samples required before making speed-based decisions
	DefaultSpeedThresholdTps = 50.0 // Minimum acceptable tokens per second
	DefaultSpeedSampleWindow = 100  // Default number of speed samples to keep
)

Token speed-based routing defaults

View Source
const (
	DefaultTTFTThresholdMs    = int64(500) // Default TTFT threshold in milliseconds
	DefaultTTFTSampleWindow   = 100        // Default number of TTFT samples to keep
	DefaultTTFTPercentile     = 0.95       // Default percentile for TTFT comparison (0.95 = p95)
	DefaultTTFTComparisonMode = "p95"      // Default comparison mode: "avg", "p50", "p95", "p99"
)

TTFT (Time To First Token) based routing defaults

View Source
const (
	DefaultMinCacheHitRate = 0.3 // Minimum acceptable cache hit rate (30%)
	DefaultMinCacheSamples = 10  // Minimum samples before using cache data
)

Cache-aware routing defaults

View Source
const (
	DefaultMaxCostTokens  = int64(50000) // Default max token cost per window
	DefaultCostWindowSize = 3600         // Default cost window in seconds (1 hour)
)

Cost-optimized routing defaults

View Source
const (
	DefaultLatencyWeight = 0.25           // Weight for total latency in adaptive scoring
	DefaultTTFTWeight    = 0.20           // Weight for TTFT in adaptive scoring
	DefaultCacheWeight   = 0.15           // Weight for cache hit rate in adaptive scoring
	DefaultSpeedWeight   = 0.15           // Weight for token speed in adaptive scoring
	DefaultTokenWeight   = 0.15           // Weight for token usage in adaptive scoring
	DefaultHealthWeight  = 0.10           // Weight for health status in adaptive scoring
	DefaultScoringMode   = "weighted_sum" // Default scoring mode: "weighted_sum", "multiplicative", "rank_based"
)

Adaptive routing defaults (updated with new dimensions)

View Source
const ConfigDirName = ".tingly-box"
View Source
const DBDirName = "db"
View Source
const DBFileName = "tingly.db" // Unified SQLite database file
View Source
const DefaultTokenThreshold = int64(10000) // Default token threshold for token-based tactics

Load balancing threshold defaults

View Source
const MemoryDirName = "memory"

Variables

This section is empty.

Functions

func GetDBDir

func GetDBDir(baseDir string) string

func GetDBFile

func GetDBFile(baseDir string) string

func GetLogDir

func GetLogDir(baseDir string) string

GetLogDir returns the log directory path

func GetMemoryDir

func GetMemoryDir(baseDir string) string

GetMemoryDir returns the memory directory path

func GetTinglyConfDir

func GetTinglyConfDir() string

GetTinglyConfDir returns the config directory path (default: ~/.tingly-box)

Types

This section is empty.

Jump to

Keyboard shortcuts

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