mirror of
https://github.com/chenyme/grok2api.git
synced 2026-12-06 16:01:07 +00:00
refactor: enhance request retry configuration and auto-disable logic; update documentation and tests for clarity
This commit is contained in:
1 parent
b789e8466d
commit
659ee8ca69
11 files changed
+165
-19
No files matched your search
@@ -413,7 +413,7 @@ qualityGuard:
|
||||
idleAccountCooldown: 15m
|
||||
```
|
||||
|
||||
`requestRetry` runs on the gateway request path and is independent of the sidecar. The example enables it. When enabled, a thinking-model stream with enough visible output and no streamed reasoning is **not delivered**; another account is tried. `autoDisable: true` disables an account on the first confirmed missing-thinking or degraded output-speed hit (soft-TPS, hard-TPS, or buffered-burst). If every attempt still has no reasoning, `onExhausted` either returns `503 quality_degraded` or delivers the last body. Image, video, stored-response, and ForcedEgress probe requests are unchanged. Grok TUI tool turns stay held so 0-thinking dumps cannot skip the gate.
|
||||
`requestRetry` runs on the gateway request path and is independent of the sidecar. The example above explicitly enables it; built-in defaults and `config.example.yaml` leave both `enabled` and `autoDisable` off. Either switch enables request-path quality checks and retries. A thinking-model stream with enough visible output and no streamed reasoning is **not delivered**; another account is tried. `autoDisable: true` disables an account on the first confirmed missing-thinking or degraded output-speed hit (soft-TPS, hard-TPS, or buffered-burst). The Account Maintenance switch controls `autoDisable`; turning it off restores the YAML `requestRetry.enabled` policy. If every attempt still has no reasoning, `onExhausted` either returns `503 quality_degraded` or delivers the last body. Context compaction is exempt from both missing-thinking and output-speed account penalties. Image, video, stored-response, and ForcedEgress probe requests are unchanged. Grok TUI tool turns stay held so 0-thinking dumps cannot skip the gate.
|
||||
|
||||
```bash
|
||||
docker compose --profile quality-guard up -d --build
|
||||
|
||||
+1
-1
@@ -379,7 +379,7 @@ qualityGuard:
|
||||
idleAccountCooldown: 15m
|
||||
```
|
||||
|
||||
`requestRetry` 在网关请求路径上生效,与 sidecar 探测/隔离相互独立。示例配置默认开启。开启后,可见输出达到 `minOutputTokens` 且全程无流式 reasoning 时**不发给用户**,排除该账号再试;`autoDisable: true` 会在首次确认缺 thinking 或吞吐降智(soft/hard/burst)时直接禁用账号。全部仍无推理则按 `onExhausted` 返回 `503 quality_degraded` 或放出最后一枪。不处理图/视频、stored response 钉账号和 ForcedEgress 探针。Grok TUI 带 tools 的回合仍会 hold,避免 0-thinking 降智流跳过闸门。
|
||||
`requestRetry` 在网关请求路径上生效,与 sidecar 探测/隔离相互独立。上面的示例显式开启;内置默认值和 `config.example.yaml` 均将 `enabled`、`autoDisable` 设为关闭。任一开关开启后都会启用请求内质量检测与重试。可见输出达到 `minOutputTokens` 且全程无流式 reasoning 时**不发给用户**,排除该账号再试;`autoDisable: true` 会在首次确认缺 thinking 或吞吐降智(soft/hard/burst)时直接禁用账号。管理页面的“自动停用降智账号”控制 `autoDisable`,关闭后恢复 YAML 中 `requestRetry.enabled` 的原有策略。全部仍无推理则按 `onExhausted` 返回 `503 quality_degraded` 或放出最后一枪。上下文压缩同时豁免缺 thinking 和输出速度的账号惩罚。不处理图/视频、stored response 钉账号和 ForcedEgress 探针。Grok TUI 带 tools 的回合仍会 hold,避免 0-thinking 降智流跳过闸门。
|
||||
|
||||
```bash
|
||||
docker compose --profile quality-guard up -d --build
|
||||
|
||||
@@ -493,7 +493,10 @@ func accountAutoCleanConfig(value config.AccountsConfig) accountapp.AutoCleanCon
|
||||
func qualityRetryRuntime(value config.QualityGuardConfig) gateway.QualityRetryRuntime {
|
||||
retry := value.RequestRetry
|
||||
return gateway.QualityRetryRuntime{
|
||||
Enabled: retry.Enabled,
|
||||
// Auto-disable needs request-path detection even when the YAML retry
|
||||
// switch is off. Derive this at runtime so turning auto-disable off
|
||||
// restores the original policy without persisting a second switch.
|
||||
Enabled: retry.Enabled || retry.AutoDisable,
|
||||
MaxAttempts: retry.MaxAttempts,
|
||||
HoldTimeout: retry.HoldTimeout.Value(),
|
||||
MinOutputTokens: int64(retry.MinOutputTokens),
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/chenyme/grok2api/backend/internal/application/gateway"
|
||||
settingsapp "github.com/chenyme/grok2api/backend/internal/application/settings"
|
||||
"github.com/chenyme/grok2api/backend/internal/infra/config"
|
||||
"github.com/chenyme/grok2api/backend/internal/infra/persistence/relational"
|
||||
"github.com/chenyme/grok2api/backend/internal/infra/security"
|
||||
)
|
||||
|
||||
func TestDegradedAccountSwitchAppliesAndRestoresRequestRetryPolicy(t *testing.T) {
|
||||
for _, retryEnabled := range []bool{false, true} {
|
||||
t.Run(fmt.Sprintf("yaml_retry_%t", retryEnabled), func(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
path := filepath.Join(t.TempDir(), "config.yaml")
|
||||
if err := os.WriteFile(path, []byte(`secrets:
|
||||
jwtSecret: "12345678901234567890123456789012"
|
||||
credentialEncryptionKey: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
|
||||
`), 0o600); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
cfg, err := config.Load(path)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
cfg.QualityGuard.RequestRetry.Enabled = retryEnabled
|
||||
db, err := relational.OpenSQLite(ctx, filepath.Join(t.TempDir(), "settings.db"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer db.Close()
|
||||
if err := db.InitializeSchema(ctx); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
cipher, err := security.NewCipher(cfg.Secrets.CredentialEncryptionKey)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
repo := relational.NewRuntimeSettingsRepository(db, cipher)
|
||||
var applied gateway.QualityRetryRuntime
|
||||
service := settingsapp.NewService(cfg, time.Time{}, 0, repo, nil, func(next config.Config) {
|
||||
applied = qualityRetryRuntime(next.QualityGuard)
|
||||
if next.QualityGuard.RequestRetry.Enabled != retryEnabled {
|
||||
t.Fatal("management switch changed the YAML retry policy")
|
||||
}
|
||||
})
|
||||
for _, autoDisable := range []bool{true, false} {
|
||||
snapshot := service.Get()
|
||||
input := snapshot.Config
|
||||
input.Accounts.AutoDisableDegradedAccounts = autoDisable
|
||||
input.Accounts.AutoDisableDegradedAccountsProvided = true
|
||||
if _, err := service.Update(ctx, snapshot.Revision, input); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
wantEnabled := retryEnabled || autoDisable
|
||||
if applied.Enabled != wantEnabled || applied.AutoDisable != autoDisable {
|
||||
t.Fatalf("hot reload: autoDisable=%t runtime=%#v", autoDisable, applied)
|
||||
}
|
||||
reloaded, _, _, err := settingsapp.LoadPersisted(ctx, cfg, repo)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
runtime := qualityRetryRuntime(reloaded.QualityGuard)
|
||||
if runtime.Enabled != wantEnabled || runtime.AutoDisable != autoDisable || reloaded.QualityGuard.RequestRetry.Enabled != retryEnabled {
|
||||
t.Fatalf("restart: autoDisable=%t runtime=%#v", autoDisable, runtime)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -596,6 +596,11 @@ func (s *Service) applyMissingThinkingPenalty(ctx context.Context, requestID str
|
||||
}
|
||||
|
||||
func (s *Service) applyOutputSpeedPenalty(ctx context.Context, record audit.Record, credential accountdomain.Credential, cfg QualityRetryRuntime, forcedEgress bool) error {
|
||||
// Both explicit and TUI compaction are classified in the audit record.
|
||||
// System summaries stay exempt from account quality penalties.
|
||||
if record.Operation == audit.OperationCompaction {
|
||||
return nil
|
||||
}
|
||||
if !cfg.Enabled || !cfg.AutoDisable || forcedEgress || credential.Provider != accountdomain.ProviderBuild || !record.Streaming || record.FirstTokenMS == nil || record.OutputTokens < cfg.MinOutputTokens || !auditRequestSucceeded(record.StatusCode, record.ErrorCode) {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -255,6 +255,15 @@ func TestAutoDisableFirstOutputSpeedHit(t *testing.T) {
|
||||
t.Fatalf("below-threshold hit must remain scheduled: %#v, err=%v", healthy, err)
|
||||
}
|
||||
record.DurationMS = 1_200
|
||||
record.Operation = audit.OperationCompaction
|
||||
if err := service.applyOutputSpeedPenalty(ctx, record, credential, cfg, false); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
compacted, err := accounts.Get(ctx, credential.ID)
|
||||
if err != nil || !compacted.Enabled {
|
||||
t.Fatalf("compaction must remain exempt from speed penalties: %#v, err=%v", compacted, err)
|
||||
}
|
||||
record.Operation = audit.OperationResponses
|
||||
if err := service.applyOutputSpeedPenalty(ctx, record, credential, cfg, false); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -253,6 +253,9 @@ func TestGatewayFailsOverBeforeReturningBody(t *testing.T) {
|
||||
t.Fatalf("ownership = %#v, err = %v", ownership, err)
|
||||
}
|
||||
|
||||
service.UpdateQualityRetry(QualityRetryRuntime{
|
||||
Enabled: true, AutoDisable: true, MinOutputTokens: 32, SoftTPS: 1, HardTPS: 2,
|
||||
})
|
||||
compacted, err := service.CreateResponse(ctx, Input{
|
||||
RequestID: "req-compact", ClientKey: clientKey, PublicModel: "grok-test", PromptCacheSeed: "claude-session",
|
||||
Body: []byte(`{"model":"grok-test","stream":true,"input":[{"role":"user","content":"continue"},{"type":"compaction_trigger"}]}`), Streaming: true,
|
||||
@@ -265,12 +268,25 @@ func TestGatewayFailsOverBeforeReturningBody(t *testing.T) {
|
||||
t.Fatal("first token marker is nil")
|
||||
}
|
||||
compacted.MarkFirstToken()
|
||||
compacted.Finalize(Usage{}, "resp-compact", "")
|
||||
time.Sleep(2 * time.Millisecond)
|
||||
compacted.Finalize(Usage{Reported: true, OutputTokens: 120}, "resp-compact", "")
|
||||
_ = compacted.Body.Close()
|
||||
logs, total, err = auditRepo.List(ctx, 0, 10)
|
||||
if err != nil || total != 2 || logs[0].Operation != audit.OperationCompaction || !logs[0].Streaming || logs[0].FirstTokenMS == nil {
|
||||
t.Fatalf("compaction audit = %#v, total=%d, err=%v", logs, total, err)
|
||||
}
|
||||
assertCompactionSpeedExempt := func(record audit.Record) {
|
||||
t.Helper()
|
||||
class, _, _ := audit.ClassifyOutputSpeed(record.OutputTokens, record.ReasoningTokens, *record.FirstTokenMS, record.DurationMS, 1, 2, 1000, false)
|
||||
if class == "" {
|
||||
t.Fatal("compaction fixture must exceed the speed threshold")
|
||||
}
|
||||
credential, err := accountRepo.Get(ctx, second.ID)
|
||||
if err != nil || !credential.Enabled {
|
||||
t.Fatalf("compaction must not disable its account: %#v, err=%v", credential, err)
|
||||
}
|
||||
}
|
||||
assertCompactionSpeedExempt(logs[0])
|
||||
if _, err := responseRepo.Get(ctx, "resp-compact", clientKey.ID, time.Now().UTC()); !errors.Is(err, repository.ErrNotFound) {
|
||||
t.Fatalf("compaction response ownership err = %v", err)
|
||||
}
|
||||
@@ -279,7 +295,7 @@ func TestGatewayFailsOverBeforeReturningBody(t *testing.T) {
|
||||
// the quality hold and is labeled compaction only in the audit record, so
|
||||
// Provider routing and stored-response ownership must remain intact.
|
||||
service.UpdateQualityRetry(QualityRetryRuntime{
|
||||
Enabled: true, MaxAttempts: 2, MinOutputTokens: 32,
|
||||
Enabled: true, AutoDisable: true, MaxAttempts: 2, MinOutputTokens: 32, SoftTPS: 1, HardTPS: 2,
|
||||
OnExhausted: qualityRetryFailClosed, HoldTimeout: time.Second,
|
||||
})
|
||||
adapter.resetAttempts()
|
||||
@@ -298,7 +314,8 @@ func TestGatewayFailsOverBeforeReturningBody(t *testing.T) {
|
||||
t.Fatalf("TUI compaction body = %q", tuiBody)
|
||||
}
|
||||
tuiCompacted.MarkFirstToken()
|
||||
tuiCompacted.Finalize(Usage{}, "resp-tui-compact", "")
|
||||
time.Sleep(2 * time.Millisecond)
|
||||
tuiCompacted.Finalize(Usage{Reported: true, OutputTokens: 120}, "resp-tui-compact", "")
|
||||
_ = tuiCompacted.Body.Close()
|
||||
if len(adapter.attempts) != 1 || adapter.lastOperation != string(audit.OperationResponses) {
|
||||
t.Fatalf("TUI compaction attempts = %#v, Provider operation = %q", adapter.attempts, adapter.lastOperation)
|
||||
@@ -307,6 +324,7 @@ func TestGatewayFailsOverBeforeReturningBody(t *testing.T) {
|
||||
if err != nil || total != 3 || logs[0].Operation != audit.OperationCompaction {
|
||||
t.Fatalf("TUI compaction audit = %#v, total=%d, err=%v", logs, total, err)
|
||||
}
|
||||
assertCompactionSpeedExempt(logs[0])
|
||||
if ownership, err := responseRepo.Get(ctx, "resp-tui-compact", clientKey.ID, time.Now().UTC()); err != nil || ownership.AccountID != second.ID {
|
||||
t.Fatalf("TUI compaction ownership = %#v, err=%v", ownership, err)
|
||||
}
|
||||
|
||||
@@ -295,6 +295,7 @@ type QualityGuardRequestRetryConfig struct {
|
||||
HoldTimeout Duration `yaml:"holdTimeout"`
|
||||
MinOutputTokens int `yaml:"minOutputTokens"`
|
||||
OnExhausted string `yaml:"onExhausted"`
|
||||
// AutoDisable also enables request-path detection without changing Enabled.
|
||||
AutoDisable bool `yaml:"autoDisable"`
|
||||
AccountCooldown Duration `yaml:"accountCooldown"`
|
||||
// IdleAccountCooldown cools an account after a truly empty upstream
|
||||
@@ -741,6 +742,15 @@ func validateQualityGuardConfig(value QualityGuardConfig) error {
|
||||
if err := validateQualityGuardRequestRetry(value.RequestRetry); err != nil {
|
||||
return err
|
||||
}
|
||||
// Automatic account disabling uses these thresholds without the sidecar.
|
||||
if value.Enabled || value.RequestRetry.AutoDisable {
|
||||
if value.SoftTPS < 1 || value.HardTPS <= value.SoftTPS || value.HardTPS > 10000 {
|
||||
return errors.New("qualityGuard TPS 阈值无效")
|
||||
}
|
||||
if value.MinimumGenerationWindow.Value() < time.Millisecond || value.MinimumGenerationWindow.Value() > 2*time.Minute {
|
||||
return errors.New("qualityGuard.minimumGenerationWindow 必须在 1 毫秒到 2 分钟之间")
|
||||
}
|
||||
}
|
||||
if !value.Enabled {
|
||||
return nil
|
||||
}
|
||||
@@ -759,9 +769,6 @@ func validateQualityGuardConfig(value QualityGuardConfig) error {
|
||||
if value.PassivePollInterval.Value() < time.Second || value.PassivePollInterval.Value() > 5*time.Minute {
|
||||
return errors.New("qualityGuard.passivePollInterval 必须在 1 秒到 5 分钟之间")
|
||||
}
|
||||
if value.SoftTPS < 1 || value.HardTPS <= value.SoftTPS || value.HardTPS > 10000 {
|
||||
return errors.New("qualityGuard TPS 阈值无效")
|
||||
}
|
||||
if value.ConsecutiveSoft < 1 || value.ConsecutiveSoft > 20 || value.ConsecutiveErrors < 1 || value.ConsecutiveErrors > 20 {
|
||||
return errors.New("qualityGuard 连续异常次数必须在 1 到 20 之间")
|
||||
}
|
||||
@@ -774,9 +781,6 @@ func validateQualityGuardConfig(value QualityGuardConfig) error {
|
||||
if value.MaxOutputTokens < 32 || value.MaxOutputTokens > 4096 {
|
||||
return errors.New("qualityGuard.maxOutputTokens 必须在 32 到 4096 之间")
|
||||
}
|
||||
if value.MinimumGenerationWindow.Value() < time.Millisecond || value.MinimumGenerationWindow.Value() > 2*time.Minute {
|
||||
return errors.New("qualityGuard.minimumGenerationWindow 必须在 1 毫秒到 2 分钟之间")
|
||||
}
|
||||
if value.RotationTimeout.Value() < 5*time.Second || value.RotationTimeout.Value() > 5*time.Minute {
|
||||
return errors.New("qualityGuard.rotationTimeout 必须在 5 秒到 5 分钟之间")
|
||||
}
|
||||
@@ -793,7 +797,7 @@ func validateQualityGuardConfig(value QualityGuardConfig) error {
|
||||
}
|
||||
|
||||
func validateQualityGuardRequestRetry(value QualityGuardRequestRetryConfig) error {
|
||||
if !value.Enabled {
|
||||
if !value.Enabled && !value.AutoDisable {
|
||||
return nil
|
||||
}
|
||||
if value.MaxAttempts != 0 && (value.MaxAttempts < 1 || value.MaxAttempts > 6) {
|
||||
|
||||
@@ -231,6 +231,34 @@ func TestDefaultQualityGuardRequestRetryContract(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestAutoDisableValidatesRequestPolicyWithoutSidecar(t *testing.T) {
|
||||
t.Parallel()
|
||||
base := defaultConfig().QualityGuard
|
||||
base.RequestRetry.AutoDisable = true
|
||||
if err := validateQualityGuardConfig(base); err != nil {
|
||||
t.Fatalf("auto-disable with default policy: %v", err)
|
||||
}
|
||||
for _, test := range []struct {
|
||||
name string
|
||||
change func(*QualityGuardConfig)
|
||||
}{
|
||||
{"retry limit", func(c *QualityGuardConfig) { c.RequestRetry.MaxAttempts = 7 }},
|
||||
{"hold timeout", func(c *QualityGuardConfig) { c.RequestRetry.HoldTimeout = Duration(time.Minute) }},
|
||||
{"output floor", func(c *QualityGuardConfig) { c.RequestRetry.MinOutputTokens = 1 }},
|
||||
{"soft TPS", func(c *QualityGuardConfig) { c.SoftTPS = 0 }},
|
||||
{"hard TPS", func(c *QualityGuardConfig) { c.HardTPS = c.SoftTPS }},
|
||||
{"generation window", func(c *QualityGuardConfig) { c.MinimumGenerationWindow = 0 }},
|
||||
} {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
cfg := base
|
||||
test.change(&cfg)
|
||||
if err := validateQualityGuardConfig(cfg); err == nil {
|
||||
t.Fatal("invalid active request-path policy must be rejected even when the sidecar is disabled")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestQualityGuardRequestRetryAccountCooldownBounds(t *testing.T) {
|
||||
t.Parallel()
|
||||
for _, test := range []struct {
|
||||
|
||||
+6
-4
@@ -150,8 +150,8 @@ qualityGuard:
|
||||
nodeIDs: []
|
||||
rotatableNodeIDs: []
|
||||
# Optional request-path withhold/retry for thinking models.
|
||||
# Recommended lab values are filled in; enabled stays false so stock
|
||||
# installs do not intercept. Set enabled: true to turn the hold on.
|
||||
# Recommended lab values are filled in; enabled and autoDisable stay false
|
||||
# so stock installs do not intercept. Either switch enables detection.
|
||||
# Observe up to 30s for real reasoning evidence. A reasoning-item stub plus
|
||||
# enough visible output at the deadline is withheld (TUI dump after 30s),
|
||||
# not released as late ciphertext. Empty stub-only streams keep waiting.
|
||||
@@ -172,8 +172,10 @@ qualityGuard:
|
||||
onExhausted: fail_closed # fail_open | fail_closed
|
||||
# Immediately disable an account on its first confirmed missing-thinking
|
||||
# or degraded output-speed hit (soft-TPS, hard-TPS, or buffered-burst).
|
||||
# When false, missing-thinking keeps the historical cooldown/second-hit policy.
|
||||
autoDisable: true
|
||||
# Also enables request-path detection independently of enabled above.
|
||||
# When false, enabled controls the historical cooldown/second-hit policy.
|
||||
# Context compaction and forced egress probes remain exempt.
|
||||
autoDisable: false
|
||||
accountCooldown: 12h
|
||||
# Empty SSE / idle-timeout penalty. Independent of accountCooldown.
|
||||
# Single-account pools should set this lower; toggling enabled does not
|
||||
|
||||
@@ -1045,7 +1045,7 @@ const resources = {
|
||||
title: "账号维护",
|
||||
degradedAccountTitle: "降智账号处理",
|
||||
autoDisableDegradedAccounts: "自动停用降智账号",
|
||||
autoDisableDegradedAccountsHelp: "开启后,首次确认缺少 thinking 或吞吐降智时立即停用账号;关闭后不因吞吐降智停用,缺少 thinking 则恢复为首次冷却、再次确认后停用。",
|
||||
autoDisableDegradedAccountsHelp: "开启后启用请求内质量检测与重试,首次确认缺少 thinking 或吞吐降智时立即停用账号;关闭后不因吞吐降智停用,缺少 thinking 的拦截与冷却按原有配置执行。",
|
||||
invalidationTitle: "自动拦截判定",
|
||||
botRiskSchedulingTitle: "风控调度",
|
||||
excludeBuildBotFlaggedFromScheduling: "风控 Build 号移出调度",
|
||||
@@ -1818,7 +1818,7 @@ const resources = {
|
||||
errorFrameCount_one: "{{count}} error frame",
|
||||
errorFrameCount_other: "{{count}} error frames",
|
||||
},
|
||||
settings: { title: "Runtime settings", description: "Manage hot-reloadable gateway runtime parameters.", saved: "Settings saved and applied", restartRequired: "Restart required", invalidValue: "Enter a valid value", durationUnit: "Duration unit", groups: { providers: "Providers", delivery: "Media & network", policies: "Runtime policies", audit: "Audit & Logs", accounts: "Account maintenance", about: "About" }, server: { title: "Service capacity", maxConcurrentRequests: "API request concurrency limit", maxConcurrentRequestsHelp: "Maximum simultaneous /v1 requests per instance. Lowering the limit does not interrupt active requests." }, provider: { title: "Grok Build provider", baseURL: "Upstream URL", baseURLHelp: "Primary upstream endpoint used for Grok Build requests.", fallbackBaseURL: "XAI fallback URL", fallbackBaseURLHelp: "Endpoint used when routing to XAI or falling back from Grok Build.", clientVersion: "Client version", clientVersionHelp: "Version sent with Build requests. Use a version that has passed compatibility validation.", clientIdentifier: "Client identifier", clientIdentifierHelp: "Client identity sent with requests; keep it aligned with the upstream protocol.", tokenAuth: "Token auth", tokenAuthHelp: "Client protocol identifier sent with Grok Build requests; normally keep xai-grok-cli.", userAgent: "User-Agent", userAgentHelp: "Used by Grok Build inference requests and their egress nodes. Direct XAI media requests derive the official xai-grok-build User-Agent from the client version.", recommendedVersion: "Recommended {{version}}", syncRecommendedVersion: "Sync latest version", recommendedVersionApplied: "Recommended version active", syncRecommendedVersionDescription: "Fill the form with the validated version and User-Agent; save to apply." }, web: { title: "Grok Web", baseURL: "Upstream URL", baseURLHelp: "Base endpoint used for Grok Web API calls and account operations.", statsigMode: "x-statsig source", statsigModeHelp: "Use a fixed value or retrieve request identity dynamically from a signer service.", statsigManual: "Manual", statsigURL: "Fetch from URL", statsigValue: "x-statsig-id", statsigValueHelp: "Fixed x-statsig-id attached to Grok Web requests.", statsigConfigured: "Configured", statsigKeepConfigured: "Leave blank to keep the current value", statsigValuePlaceholder: "Paste x-statsig-id", statsigSignerURL: "Signer URL", statsigSignerURLHelp: "Internal signer endpoint used to retrieve x-statsig-id per request.", quotaTimeout: "Quota timeout", quotaTimeoutHelp: "Maximum time to wait for upstream quota and account-status queries.", chatTimeout: "Chat timeout", chatTimeoutHelp: "Maximum time to wait for a Grok Web chat request to complete.", streamIdleTimeout: "Stream idle timeout", streamIdleTimeoutHelp: "Maximum period without upstream data for raw text-chat streams; image, video, and other media requests are unaffected.", imageTimeout: "Image timeout", imageTimeoutHelp: "Maximum time to wait for image generation or editing to complete.", videoTimeout: "Video timeout", videoTimeoutHelp: "Maximum time to wait for a Grok Web video generation request to complete.", freeVideoDurationCap: "Free-account video duration cap", freeVideoDurationCapHelp: "Caps duration sent to Grok Web for free-tier accounts so requests over the upstream limit do not 429 and rotate accounts uselessly. Default 6 seconds, range 1–15.", mediaConcurrency: "Media job concurrency", mediaConcurrencyHelp: "Image and video jobs one instance may run concurrently. Changes require a restart.", recoveryBackoffBase: "Quota recovery backoff", recoveryBackoffBaseHelp: "Initial retry interval after consecutive quota-recovery check failures.", recoveryBackoffMax: "Maximum recovery backoff", recoveryBackoffMaxHelp: "Maximum interval reached by exponential backoff for quota-recovery checks.", allowNSFW: "Allow NSFW images", allowNSFWHelp: "Allow Grok Web image requests to enable the adult-content preference.", clearanceMode: "Clearance management", clearanceModeHelp: "Maintain Cloudflare credentials manually or let FlareSolverr acquire and refresh them on the actual egress.", clearanceManual: "Manual", clearanceFlareSolverr: "FlareSolverr", flareSolverrURL: "FlareSolverr URL", flareSolverrURLHelp: "Internal FlareSolverr endpoint used to solve Cloudflare Clearance.", clearanceTimeout: "Solve timeout", clearanceTimeoutHelp: "Maximum time allowed for one FlareSolverr solve.", clearanceRefresh: "Refresh interval", clearanceRefreshHelp: "Periodic refresh interval for fixed egress; account-bound proxies are maintained independently during requests." }, console: { baseURLHelp: "Base endpoint used for Grok Console requests and account operations.", chatTimeoutHelp: "Maximum time to wait for a Grok Console chat request to complete.", streamIdleTimeout: "Stream idle timeout", streamIdleTimeoutHelp: "Maximum period without upstream data for text SSE only; media and non-streaming requests are unaffected." }, batch: { title: "BaLine truncated
|
||||
settings: { title: "Runtime settings", description: "Manage hot-reloadable gateway runtime parameters.", saved: "Settings saved and applied", restartRequired: "Restart required", invalidValue: "Enter a valid value", durationUnit: "Duration unit", groups: { providers: "Providers", delivery: "Media & network", policies: "Runtime policies", audit: "Audit & Logs", accounts: "Account maintenance", about: "About" }, server: { title: "Service capacity", maxConcurrentRequests: "API request concurrency limit", maxConcurrentRequestsHelp: "Maximum simultaneous /v1 requests per instance. Lowering the limit does not interrupt active requests." }, provider: { title: "Grok Build provider", baseURL: "Upstream URL", baseURLHelp: "Primary upstream endpoint used for Grok Build requests.", fallbackBaseURL: "XAI fallback URL", fallbackBaseURLHelp: "Endpoint used when routing to XAI or falling back from Grok Build.", clientVersion: "Client version", clientVersionHelp: "Version sent with Build requests. Use a version that has passed compatibility validation.", clientIdentifier: "Client identifier", clientIdentifierHelp: "Client identity sent with requests; keep it aligned with the upstream protocol.", tokenAuth: "Token auth", tokenAuthHelp: "Client protocol identifier sent with Grok Build requests; normally keep xai-grok-cli.", userAgent: "User-Agent", userAgentHelp: "Used by Grok Build inference requests and their egress nodes. Direct XAI media requests derive the official xai-grok-build User-Agent from the client version.", recommendedVersion: "Recommended {{version}}", syncRecommendedVersion: "Sync latest version", recommendedVersionApplied: "Recommended version active", syncRecommendedVersionDescription: "Fill the form with the validated version and User-Agent; save to apply." }, web: { title: "Grok Web", baseURL: "Upstream URL", baseURLHelp: "Base endpoint used for Grok Web API calls and account operations.", statsigMode: "x-statsig source", statsigModeHelp: "Use a fixed value or retrieve request identity dynamically from a signer service.", statsigManual: "Manual", statsigURL: "Fetch from URL", statsigValue: "x-statsig-id", statsigValueHelp: "Fixed x-statsig-id attached to Grok Web requests.", statsigConfigured: "Configured", statsigKeepConfigured: "Leave blank to keep the current value", statsigValuePlaceholder: "Paste x-statsig-id", statsigSignerURL: "Signer URL", statsigSignerURLHelp: "Internal signer endpoint used to retrieve x-statsig-id per request.", quotaTimeout: "Quota timeout", quotaTimeoutHelp: "Maximum time to wait for upstream quota and account-status queries.", chatTimeout: "Chat timeout", chatTimeoutHelp: "Maximum time to wait for a Grok Web chat request to complete.", streamIdleTimeout: "Stream idle timeout", streamIdleTimeoutHelp: "Maximum period without upstream data for raw text-chat streams; image, video, and other media requests are unaffected.", imageTimeout: "Image timeout", imageTimeoutHelp: "Maximum time to wait for image generation or editing to complete.", videoTimeout: "Video timeout", videoTimeoutHelp: "Maximum time to wait for a Grok Web video generation request to complete.", freeVideoDurationCap: "Free-account video duration cap", freeVideoDurationCapHelp: "Caps duration sent to Grok Web for free-tier accounts so requests over the upstream limit do not 429 and rotate accounts uselessly. Default 6 seconds, range 1–15.", mediaConcurrency: "Media job concurrency", mediaConcurrencyHelp: "Image and video jobs one instance may run concurrently. Changes require a restart.", recoveryBackoffBase: "Quota recovery backoff", recoveryBackoffBaseHelp: "Initial retry interval after consecutive quota-recovery check failures.", recoveryBackoffMax: "Maximum recovery backoff", recoveryBackoffMaxHelp: "Maximum interval reached by exponential backoff for quota-recovery checks.", allowNSFW: "Allow NSFW images", allowNSFWHelp: "Allow Grok Web image requests to enable the adult-content preference.", clearanceMode: "Clearance management", clearanceModeHelp: "Maintain Cloudflare credentials manually or let FlareSolverr acquire and refresh them on the actual egress.", clearanceManual: "Manual", clearanceFlareSolverr: "FlareSolverr", flareSolverrURL: "FlareSolverr URL", flareSolverrURLHelp: "Internal FlareSolverr endpoint used to solve Cloudflare Clearance.", clearanceTimeout: "Solve timeout", clearanceTimeoutHelp: "Maximum time allowed for one FlareSolverr solve.", clearanceRefresh: "Refresh interval", clearanceRefreshHelp: "Periodic refresh interval for fixed egress; account-bound proxies are maintained independently during requests." }, console: { baseURLHelp: "Base endpoint used for Grok Console requests and account operations.", chatTimeoutHelp: "Maximum time to wait for a Grok Console chat request to complete.", streamIdleTimeout: "Stream idle timeout", streamIdleTimeoutHelp: "Maximum period without upstream data for text SSE only; media and non-streaming requests are unaffected." }, batch: { title: "BaLine truncated
|
||||
|
||||
egressProxyProfiles: { title: "Proxy address library", libraryTitle: "Proxy address library", libraryDescription: "Manage reusable proxy addresses in one place. Changes sync to every node using the address.", description: "Save proxy addresses that need to be reused across nodes.", add: "Add proxy address", addTitle: "Add proxy address", editTitle: "Edit proxy address", dialogDescription: "Changing the proxy address updates every bound node. Capacity and operational state remain isolated per node.", name: "Address name", endpoint: "Proxy address", nodes: "Used by", search: "Search address names", empty: "No proxy addresses", emptyLibrary: "The library is empty. Add an address to reuse it across nodes.", noMatches: "No matching proxy addresses", loadingSelection: "Loading selected address…", selectionUnavailable: "Proxy address #{{id}} is unavailable", saved: "Proxy address saved", deleted: "Proxy address deleted", deleteTitle: "Delete proxy address?", deleteDescription: "This deletes {{name}}. Addresses currently used by nodes cannot be deleted.", deleteBlocked: "Used by {{count}} nodes", assignment: "Proxy address source", assignmentHelp: "Select an address from the library to reuse it across Provider nodes. Health, capacity, User-Agent, and Clearance remain isolated per node.", independent: "Configure this node separately", managedByProfile: "Managed by the proxy address library", nodeCount: "{{count}} nodes", backToLibrary: "Back to address library", createFromPicker: "Add and use a proxy address", refreshNodes: "Refresh proxy nodes", reveal: "Reveal full proxy URL", hide: "Hide full proxy URL", revealUnavailable: "Only a saved proxy address can reveal its URL" },
|
||||
settingsBuildTransport: { responseHeaderTimeout: "Response header timeout", responseHeaderTimeoutHelp: "Maximum time to wait for the first Grok Build response headers after the request body is sent.", streamIdleTimeout: "Stream idle timeout", streamIdleTimeoutHelp: "Maximum wait for useful generated content or tool progress. Keepalives and private control events do not extend the deadline." },
|
||||
|
||||
Reference in new issue
Block a user