Documentation
¶
Overview ¶
Package modelmatch is the single implementation of the LLM "allowed models" matching rule. The proxy (request time), the LLM service (save time) and the failover validator all delegate here so a model that passes in one place passes everywhere.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Allowed ¶
Allowed reports whether modelName is permitted by the configured patterns.
Two behaviours worth stating plainly, because both surprise people:
- An empty pattern list allows EVERY model. An empty Allowed Models field is not a deny-all.
- Patterns are matched UNANCHORED, i.e. anywhere within the model name. So "gpt-4.*" -- the example the UI itself suggests -- also matches "legacy-gpt-4o" and "not-really-gpt-4". Anchor explicitly with ^ and $ if you mean the whole name.
The unanchored behaviour is kept deliberately: existing configurations rely on substring matching, and silently anchoring them would start rejecting models that are allowed today.
A pattern that fails to compile never matches; it does not turn into a wildcard. Use AllowedStrict when the caller wants to hear about it.
func AllowedStrict ¶
AllowedStrict is Allowed but surfaces an invalid pattern as an error instead of treating it as a non-match. Save-time validation uses this so an admin learns about a broken pattern rather than silently locking a model out.
Types ¶
This section is empty.