Repository navigation
feat(recommendations): choose the embedding provider from AI Services - #3107
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. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Provider binding and legacy migration internal/config/ai_providers.go, internal/config/ai_providers_test.go, internal/config/config.go, internal/config/admin_settings.go, internal/config/db_loader.go, docs/architecture/ai-provider-authentication.md, docs/admin-settings-api.md, docs/architecture/v1-scope.md |
The provider registry adds an embeddings binding and migrates eligible legacy settings. Configuration resolves the endpoint and token from the selected provider, removes defaults for the embedding model, and rejects legacy setting writes. |
Provider changes and embedding-lock checks internal/api/handlers/admin_ai_providers.go, internal/api/handlers/admin_ai_providers_test.go, internal/api/handlers/admin_settings_checks.go, internal/api/handlers/admin_settings_checks_test.go, internal/api/handlers/admin_settings_credential_binding_test.go, internal/api/handlers/admin_settings_embedding_check_test.go, internal/recommendations/embedding_lock.go, internal/recommendations/embedding_reset.go, internal/recommendations/embedding_reset_test.go, internal/recommendations/search_query_vector.go, internal/recommendations/similar.go, internal/recommendations/embed_backfill.go, internal/recommendations/embed_backfill_test.go, docs/admin-recommendations-api.md, docs/architecture/recommendations.md |
Provider endpoint changes are marked as requiring restart. Lock checks compare model names after trimming and removing vendor prefixes, and retain dimension checks. Connection checks resolve embedding providers through registry bindings. |
Runtime configuration and credentials cmd/silo/main.go, internal/recommendations/engine.go, internal/recommendations/embed_backfill.go, internal/recommendations/embeddings/client.go, internal/recommendations/embeddings/client_test.go, docs/architecture/recommendations.md |
The engine applies a changed API key when the endpoint and model match its configuration. Embedding work stays idle or returns a configuration error when provider or model settings are absent. Embedding request URLs account for existing API versions. |
Provider selection in admin and setup flows web/src/pages/admin-settings/AIProviders.tsx, web/src/pages/AdminRecommendations.tsx, web/src/pages/AdminRecommendations.test.tsx, web/src/pages/admin-settings/AISettings.tsx, web/src/pages/admin-settings/recommendationsSettings.ts, web/src/pages/setup-wizard/steps/FeaturesStep.tsx, web/src/lib/adminSettingsSearch.ts, web/src/lib/recommendation-provider-presets.ts, web/src/lib/recommendation-provider-presets.test.ts, docs/subtitles-api.md |
Recommendation settings and setup use shared provider and model fields instead of embedding presets and endpoint or token fields. AI Services displays the selected embedding provider and model. Provider creation can select a newly created embedding provider. |
Priority:
Estimated code review effort: 4 (Complex) | ~45 minutes
Change: Feature
Sequence Diagram(s)
sequenceDiagram
participant ConfigWatcher
participant RecommendationsEngine
participant EmbeddingsClient
ConfigWatcher->>RecommendationsEngine: Apply updated recommendation settings
RecommendationsEngine->>EmbeddingsClient: Update API key when endpoint and model match
Possibly related PRs
- Silo-Server/silo-server#3106: Adds the shared provider registry that this change extends with an embeddings binding and migration.
- Silo-Server/silo-server#3041: Documents restart behavior for saved embedding settings, which this change also specifies for embedding-provider endpoint changes.
Suggested labels: needs-review, impact: usability, evidence-required
Suggested reviewers: rhainland
Merge Risk: 
Low · previous review 451f5
-
Embedding provider selection and lock behavior look consistent with the documented design. The API documentation does not say that rotating a provider key applies without restart, which could mislead administrators. This is a minor follow-up that does not block merge.
Security architecture risk: 
Low · up to 451f5
-
Shared credentials increase the operational scope of provider changes, but administrative controls and endpoint-specific credential checks remain in place. No new exploitable path was established in the reviewed flows. Migration, restart, and downgrade behavior still warrant care.
Retained concerns
No architecture-level concerns identified.Security review details
-
Security Blast Radius
- inferred — A shared provider edit can affect every job bound to it, now including installation-wide catalog embedding work. The reviewed sensitive outcomes are outbound provider requests using stored credentials and changes to shared embedding state and downstream recommendation caches.
Trust Boundaries and Controls
- observed — The reviewed provider operations retain acting-admin authorization. Stored-key reuse across URL paths on the same scheme, host, and port is an existing authority policy, not a newly introduced control relaxation; moving to another authority requires an explicit credential.
- observed — A reloaded credential reaches the running embedding client only when the endpoint and model exactly match its startup configuration. Credential replacement is atomic, requests retain their starting credential, and the client does not follow redirects that could forward credential headers.
Resilience and Maintainability Implications
- observed — Settings mutations serialize read, validation, and persistence across processes under a transaction-scoped advisory lock. Embedding reset also refuses when saved endpoint or model settings differ from the running configuration, containing reset behavior during a pending restart.
-
Pre-merge checks: 
3 · 
2
-
Failed checks: 2 warnings Passed checks: 3 passed-
Full details: Out of Scope Changes check
-
Explanation
The changed configuration, migration, provider registry, Recommendations and setup-wizard UI, AI Services link, embedding client, lock handling, API behavior, documentation, and tests support the provider consolidation in
#3082. No unrelated change is demonstrated by the supplied PR evidence.
Full details: Description check
-
Explanation
The pull request description directly explains the shared AI provider migration for recommendation embeddings, including provider selection, migration, UI changes, restart behavior, embedding locks, tests, and risks. It matches the changeset.
-
Full details: Linked Issues check
-
Explanation
Issue
#3082requires the shared, capability-aware provider registry to serve the listed AI features, including Text AI and translation, Metadata AI, Subtitle AI, and speech. This PR implements the registry binding, migration, capability filtering, and model selection for recommendation embeddings and the setup wizard, but it does not add shared provider selection to those remaining feature pages. The recommendation-specific embedding and lock requirements are implemented. The supplied PR evidence does not show a coding implementation for the broader issue scope.Resolution
Add capability-aware provider and model selection for the remaining AI feature pages named in
#3082, with shared credentials and automated tests. Alternatively, split the recommendation embedding work into a separately scoped issue and update#3082before merging.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 52.94% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 51 functions across 28 files. (3 skipped: 3 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.
|
The PR changes visible web-admin and setup-wizard screens, but the Evidence section contains the literal
Name the surface and build or commit for each capture, or replace the placeholder with the evidence page URL. Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8014c8f3ec
ℹ️ 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".
|
The Validation tasks line is stale: its “no results recorded yet” claim is outdated. The task comments now contain build-specific results for #1145/#1146 and the linked Apple and Android surfaces. Server C1–C3 remain blocked pending the rubric/window decision; Android TV C3 is tracked separately by #676. This PR does not invalidate or unblock those results: the recorded runs use the legacy Ollama/all-minilm setup, which the conversion carries forward for enabled or locked installations. The ranking, recommendation read/access APIs, and client rendering paths are unchanged. Please replace the line with:
Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
|
The embedding-provider/model resolution feeds vector backfill, taste profiles, and cached recommendation rows consumed by every Recommendations client. The parent also tracks iOS, tvOS, Android, and Android TV C1 cases, so the current Please update the line to:
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: 3

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:
2d817eb3-0508-4028-bb7a-b242c8f451f9
Files selected for processing: 9-
docs/architecture/v1-scope.mdinternal/config/ai_providers.gointernal/config/ai_providers_test.gointernal/recommendations/embeddings/client.gointernal/recommendations/embeddings/client_test.goweb/src/pages/AdminRecommendations.test.tsxweb/src/pages/AdminRecommendations.tsxweb/src/pages/admin-settings/AIProviders.tsxweb/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; 0 remain after this review.
-
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dc6dd6a0b6
ℹ️ 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".
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

Minor · Clarify that a provider key rotation applies without restart. · admin-settings-api.md:60-61
docs/admin-settings-api.md:60-61
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winClarify that a provider key rotation applies without restart.
The text says
recommendations.embedding_provider_idis "applied at restart, like everyrecommendations.*setting". The PR objectives say a provider key rotation takes effect without restart when the endpoint and model still match the running configuration. Line 97 also says every job switches at once on a provider edit. A contributor can read these lines as a contradiction for embeddings.Name the exception here. A binding change or an endpoint move applies at restart. A key change with the same endpoint and model applies without restart.

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:
dbe9ca3b-a95c-43af-9c19-2986abab8a76
Files selected for processing: 3-
cmd/silo/main.godocs/admin-settings-api.mdinternal/config/ai_providers.go
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
-
Recommendation embeddings pick a provider and model from the AI provider registry instead of keeping their own base URL and token. The older embedding settings convert into providers once at startup. OpenRouter serves embeddings, and the embedding lock follows the model rather than the provider, so the same model through another provider needs no reset. Co-Authored-By: Claude Opus 5.5 <[email protected]>
451f5cc to
5165c4d
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:
|
SameEmbeddingModel stripped every namespace, so team-a/embed and team-b/embed passed as one model. Names now match when equal or when one is the other behind a prefix. The Recommendations note no longer says a provider move needs a reset. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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:
|
Problem
Closes #3082
Related issue: N/A
Validation tasks: none. The #1145 and #1146 results recorded on 2026-10-23 used an embedding setup that the upgrade carries over unchanged, and ranking, the recommendation reads, and client rendering do not change.
Builds on #3106, which is merged.
Recommendations keep their own embedding base URL and token, apart from the provider list #3106 added. A server that uses OpenAI or Gemini for text enters the same key again on Recommendations, and a rotated key leaves that copy stale. The page offers three presets (Gemini, Ollama, OpenAI) plus a custom URL, and a ChatGPT-plan household has no clear answer for embeddings.
This PR makes recommendation embeddings choose a provider and model from the shared list.
Approach
recommendations.embedding_provider_idselects the provider. The model staysrecommendations.embedding_model, which no longer has a default. Both are read at startup, like everyrecommendations.*setting.lock_conflictask for a provider.Validation
make lint-changedclean; tests pass for config, api/handlers, apiv2, recommendations, and contractspec.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-3107/
Surface and build: web admin, Recommendations and AI Services, at this branch.
Risks
google/gemini-embedding-001through OpenRouter matches agemini-embedding-001lock. New vectors are stored under the lock's model name, so search and similar-title queries keep matching the existing ones. Moving the embedding provider marks a restart as required; only another model or vector size needs a reset.recommendations.embedding_*,recommendations.openai_*, andrecommendations.embedding_providerrows stay in place, unread; writes to them are rejected. A server that never stored an endpoint but ran recommendations gets an Ollama provider at the old built-in default.Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Select recommendation embedding provider from AI Services instead of legacy URL/token settings
recommendations.embedding_provider_idbound through the AI provider registry; the endpoint and token resolve from the selected provider. Legacy base URL, token, and OpenAI embedding settings are retired and rejected byNormalizeAdminSetting.PlanAIProviderConversion/convertLegacyEmbeddingsin ai_providers.go) migrates legacy settings to a provider binding, falling back to the built-in Ollama endpoint when recommendations are enabled or a lock exists.recommendations.embedding_modelno longer has a default.SameEmbeddingModelaccepts vendor-prefixed model names. The running engine can hot-swap the embedding API key viaEngine.ApplyEmbeddingCredentialwithout a restart.EmbeddingProviderFieldselector on the Recommendations page, AI Settings, and the setup wizard's Features step.recommendations.embedding_base_url, token, OpenAI model/key/provider) return 400 on v1 admin settings writes; embedding endpoint and model changes require a server restart;LoadFromDBin db_loader.go no longer defaults a missing embedding model and leaves embedding fields empty without a resolvable binding.Macroscope summarized 414c781.