Repository navigation
feat(ai): add OpenAI text service tiers - #3285
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
FindingsActionable comments posted: 1
|
| Layer / File(s) | Summary |
|---|---|
Resolve and load service-tier settings internal/config/*, internal/ai/chatgpt/selection.go, internal/ai/chatgpt/selection_test.go |
Configuration accepts an empty tier, priority, or ultrafast. Resolution excludes ChatGPT auth and unsupported or invalid providers. Text configuration reads the effective setting. |
Send service tiers through the LLM client internal/ai/llm/*, internal/api/router.go, internal/api/handlers/admin_settings_checks.go, internal/api/handlers/admin_settings_checks_test.go, internal/api/handlers/admin_settings_check_service_test.go |
The LLM client sends non-empty tiers through Chat Completions. For ultrafast, it uses the Responses API. The Responses path handles response content and retryable or permanent errors. Server configuration and connection checks pass the tier to the client. |
Advertise tiers and add the admin selector internal/apiv2/admin_ai_chatgpt.go, internal/apiv2/admin_ai_chatgpt_test.go, web/src/api/v2/schema.ts, contracts/api/v2/openapi.json, web/src/pages/admin-settings/AISettings.tsx, web/src/lib/adminSettingsSearch.ts, docs/admin-settings-api.md |
Capabilities advertise default, priority, and ultrafast. The admin selector uses the advertised choices for supported OpenAI providers and stores Default as an empty value. Schemas and documentation describe the choices and behavior. |
Estimated code review effort: 3 (Moderate) | ~25 minutes
Sequence Diagram(s)
sequenceDiagram
participant ClientChat
participant ChatCompletions
participant APIResponses
ClientChat->>ChatCompletions: Send request for non-ultrafast tier
ClientChat->>APIResponses: Send request for ultrafast tier
APIResponses-->>ClientChat: Return completed text or error
Possibly related PRs
- Silo-Server/silo-server#3106: Adds the provider registry and text-provider selection used to resolve service-tier settings.
- Silo-Server/silo-server#3164: Changes reasoning configuration used by the new Responses request path.
Suggested reviewers: rhainland
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 53.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 15 functions across 21 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0be76145f3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Model: cfg.ChatModel, | ||
| Messages: messages, | ||
| ReasoningEffort: cfg.ReasoningEffort, | ||
| ServiceTier: cfg.ServiceTier, |
There was a problem hiding this comment.
Route Ultrafast requests through the Responses API
When an administrator selects Ultrafast for an OpenAI API-key provider, this sends service_tier: "ultrafast" to /v1/chat/completions, so connection checks and translation requests use a tier unsupported by that endpoint. The official Chat Completions reference lists only auto, default, flex, scale, priority, and fast; the Ultrafast documentation configures it through Responses. Route this selection through an API-key-authenticated Responses implementation, or stop advertising Ultrafast until that path is supported. The current serialization test uses a fake transport that accepts any tier, so it does not catch this incompatibility.
Useful? React with 👍 / 👎.
|
The new Service tier selector and explanatory text in Text model → Advanced ( Suggested fix: No diff — publish the prepared evidence and add its link under Evidence, or attach the captures to the PR. Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
| "ai.chat_model", | ||
| "ai.auth_mode", | ||
| "ai.reasoning_effort", | ||
| "ai.service_tier", |
There was a problem hiding this comment.
Unsupported settings requests occur because adding ai.service_tier unconditionally to TEXT_AI_KEYS also adds it to KEYS, causing useSettingsForm to request it from older servers; hiding the control when openai_service_tiers is absent does not gate that request. Keep the base keys separate, request ai.service_tier only when the server's settings capability revision supports it, and use the supported key set for connection checks.
Kody rule violation: Preserve explicit unlimited settings and apply metered defaults before playback
Prompt for LLM
File web/src/pages/admin-settings/AISettings.tsx:
Line 48:
Unsupported settings requests occur because adding ai.service_tier unconditionally to TEXT_AI_KEYS also adds it to KEYS, causing useSettingsForm to request it from older servers; hiding the control when openai_service_tiers is absent does not gate that request. Keep the base keys separate, request ai.service_tier only when the server's settings capability revision supports it, and use the supported key set for connection checks.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
733ee724-441e-4522-950d-d8ad5aa086ae
Files selected for processing: 21-
contracts/api/v2/openapi.jsondocs/admin-settings-api.mdinternal/ai/chatgpt/selection.gointernal/ai/chatgpt/selection_test.gointernal/ai/llm/client.gointernal/ai/llm/client_test.gointernal/ai/llm/text_config_test.gointernal/api/handlers/admin_settings_check_service_test.gointernal/api/handlers/admin_settings_checks.gointernal/api/handlers/admin_settings_checks_test.gointernal/api/router.gointernal/apiv2/admin_ai_chatgpt.gointernal/apiv2/admin_ai_chatgpt_test.gointernal/config/admin_settings.gointernal/config/ai_providers.gointernal/config/ai_settings_test.gointernal/config/config.gointernal/config/db_loader.goweb/src/api/v2/schema.tsweb/src/lib/adminSettingsSearch.tsweb/src/pages/admin-settings/AISettings.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
-
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
8298209 to
ce55364
Compare
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
Major changes
Minor change
The Suggested fix: No diff — keep the line and record the cases for re-validation after merge. Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
1cc47ffc-1388-480d-a22b-bee31766b189
Files selected for processing: 6-
docs/admin-settings-api.mdinternal/ai/llm/api_responses.gointernal/ai/llm/client.gointernal/ai/llm/client_test.gointernal/ai/llm/responses.gointernal/ai/llm/responses_test.go
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
-
| requests Fast/Priority processing through Chat Completions; `ultrafast` uses | ||
| API-key-authenticated Responses with storage disabled. Only completed text |
There was a problem hiding this comment.
Enforce the output guard for Chat Completions or narrow this statement.
priority uses Chat Completions, but chatCompletionResponse only checks for non-empty message.content. It does not inspect the response completion state. A response with partial content and a non-complete finish_reason can therefore return as successful text. The Responses path has separate completion and refusal checks, but those checks do not cover priority. Add equivalent validation to Chat Completions, or scope this guarantee to ultrafast Responses requests. (raw.githubusercontent.com)
|
Major validation impact: the shared The separate provider-compliance gate recorded under #1164 C4 remains blocked pending maintainer review; this PR does not unblock it. Validation tasks: changes #1165 C1; changes #1164 C4; changes #1213 C2 Suggested fix: No diff — keep the current task line and document the tier-specific re-validation rationale in the PR description. Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
Problem
Administrators cannot choose an OpenAI processing tier for subtitle and metadata translation. Add Default, Fast/Priority, and Ultrafast under Text model → Advanced for OpenAI API-key providers.
Related issue: N/A
Validation tasks: changes #1165 C1; changes #1164 C4; changes #1213 C2
Approach
Persist
ai.service_tierwith the text configuration. Fast/Priority uses Chat Completions; Ultrafast uses API-key-authenticated Responses with storage disabled, following OpenAI's Ultrafast guide. Incomplete or refused responses cannot replace source text. Default omits the parameter and preserves the OpenAI project's setting. Other providers, ChatGPT plans, speech, and embeddings ignore the saved tier.An optional
openai_service_tierscapability keeps older backends from offering an unsupported control. The API documentation and generated contracts are updated. Apple, Android, and Jellyfin need no protocol changes; the tier is applied by the server. Manual follow-up: Silo-Server/siloserver.org#157.Validation
priority,ultrafast, or no tier as appropriate.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-3285/
Surface and build: Web admin AI Services; baseline
5720a6465, changedce55364b6.Risks
Fast/Priority and Ultrafast can increase provider charges. Availability depends on the model and account; Silo does not silently retry at a lower tier after rejection. The backend must be updated before the frontend offers this control.
Checklist
AI Disclosure
gpt-6.1-sol.