Files
lukaszraczyloandGitHub 4c61d19a72 feat(router): smart routers and per-member rate limits (#9)
Add smart routers: virtual models that score each request and route it to admin-defined model tiers. A retryable failure moves the request to a higher tier. The classifier v2 extracts prose, finds the original ask in long tool loops, adds an uncertainty margin and reads tool-output failures. Sessions, outcome signals, bounded calibration, adaptive selection within a tier, gated saturation downgrade, a first-byte timeout and an opt-in timeout fallback are included. Every new feature is off by default.

Add per-member group limits, a tokensPerMinute window that counts uncached input and output, rate-limit headers in three dialects, soft pacing before the hard limit, and a limitExemptKinds list so embedding and reranking traffic never counts toward or hits a limit.

Fix yaegi named-result state that made smartContentSize grow between calls.
2026-11-25 00:40:30 +00:00

188 lines
3.1 KiB
JSON

[
{
"id": "ho-cc01",
"group": "chitchat",
"lang": "en",
"intent": "chitchat",
"wire": "openai",
"request": {
"model": "smart/auto",
"messages": [
{
"role": "user",
"content": "yo"
}
]
},
"session": null,
"minTier": 0,
"maxTier": 0,
"notes": "one-word greeting"
},
{
"id": "ho-cc02",
"group": "chitchat",
"lang": "en",
"intent": "chitchat",
"wire": "anthropic",
"request": {
"model": "smart/auto",
"max_tokens": 4096,
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "lol ok thx bye"
}
]
}
]
},
"session": null,
"minTier": 0,
"maxTier": 0,
"notes": "sign-off"
},
{
"id": "ho-cc03",
"group": "chitchat",
"lang": "en",
"intent": "chitchat",
"wire": "openai",
"request": {
"model": "smart/auto",
"messages": [
{
"role": "user",
"content": "whats a good name for a black cat"
}
]
},
"session": null,
"minTier": 0,
"maxTier": 0,
"notes": "light creative naming"
},
{
"id": "ho-cc04",
"group": "chitchat",
"lang": "en",
"intent": "chitchat",
"wire": "openai",
"request": {
"model": "smart/auto",
"messages": [
{
"role": "user",
"content": "hey, i'm bored. tell me something weird about octopuses"
}
]
},
"session": null,
"minTier": 0,
"maxTier": 0,
"notes": "trivia small talk"
},
{
"id": "ho-cc05",
"group": "chitchat",
"lang": "en",
"intent": "chitchat",
"wire": "anthropic",
"request": {
"model": "smart/auto",
"max_tokens": 4096,
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "how tall is mt everest in feet?"
}
]
}
]
},
"session": null,
"minTier": 0,
"maxTier": 0,
"notes": "single fact lookup"
},
{
"id": "ho-cc06",
"group": "chitchat",
"lang": "en",
"intent": "chitchat",
"wire": "openai",
"request": {
"model": "smart/auto",
"messages": [
{
"role": "user",
"content": "good morning! it's raining again here, any ideas for a cozy sunday?"
}
]
},
"session": null,
"minTier": 0,
"maxTier": 0,
"notes": "small talk with mild suggestion"
},
{
"id": "ho-cc07",
"group": "chitchat",
"lang": "en",
"intent": "chitchat",
"wire": "openai",
"request": {
"model": "smart/auto",
"messages": [
{
"role": "user",
"content": "hi"
},
{
"role": "assistant",
"content": "Hello! How can I help?"
},
{
"role": "user",
"content": "nothing really just testing if you're up"
}
]
},
"session": null,
"minTier": 0,
"maxTier": 0,
"notes": "history small talk"
},
{
"id": "ho-cc08",
"group": "chitchat",
"lang": "en",
"intent": "chitchat",
"wire": "anthropic",
"request": {
"model": "smart/auto",
"max_tokens": 4096,
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "recommend a sci-fi book like Dune but shorter"
}
]
}
]
},
"session": null,
"minTier": 0,
"maxTier": 1,
"notes": "recommendation, low can do it"
}
]