Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 20 additions & 12 deletions crates/views/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1321,18 +1321,26 @@ async fn accounts(State(s): State<AppState>, _: GlobalAdmin) -> Response {
let health = &s.handler.state().health;
let mut data: Vec<Value> = Vec::with_capacity(cfg.accounts.len());
for a in &cfg.accounts {
let mut cooling = Vec::new();
for m in cfg.models.iter().filter(|m| {
a.protocols.contains(&m.protocol)
&& m.provider.as_deref().is_none_or(|p| p == a.provider)
}) {
if !health
.available(&gw_state::health_key(&a.name, &m.name))
.await
{
cooling.push(m.name.as_str());
}
}
let served: Vec<&str> = cfg
.models
.iter()
.filter(|m| {
a.protocols.contains(&m.protocol)
&& m.provider.as_deref().is_none_or(|p| p == a.provider)
})
.map(|m| m.name.as_str())
.collect();
let checks = futures::future::join_all(
served
.iter()
.map(|m| async move { health.available(&gw_state::health_key(&a.name, m)).await }),
)
.await;
let cooling: Vec<&str> = served
.into_iter()
.zip(checks)
.filter_map(|(m, ok)| (!ok).then_some(m))
.collect();
data.push(json!({
"name": a.name,
"provider": a.provider,
Expand Down
6 changes: 3 additions & 3 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ default, so the whole pipeline is testable offline:
- **`HealthStore`** — account cooldown/recovery, per account and served
model, so one model's refusals never bench the account for the others.
In-process breaker by default; `RedisHealth` with `storage.redis_url` — a
tripped account is skipped for that model by every instance. Only upstream faults count (5xx, timeouts,
broken streams, a 401/402/403 credential or billing refusal), never a
client-caused or rate-limit error.
tripped account is skipped for that model by every instance. Only upstream
faults count (5xx, timeouts, broken streams, a 401/402/403 credential or
billing refusal), never a client-caused or rate-limit error.
- **`Governance`** — rate/quota/TPM counters. In-process by default;
`RedisGovernance` shares them (including pooled tenant QPS) fleet-wide.
- **`Moderator`** — the external content review behind `security.moderate`;
Expand Down
Loading