feat(cluster): add memory + bifrost opt-in profiles (#3932 follow-up) - #4433
Merged
diegosouzapw merged 6 commits intoJun 21, 2026
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
KooshaPari
added a commit
to KooshaPari/OmniRoute
that referenced
this pull request
Jun 20, 2026
…nv-doc sync Docs Sync (Strict) failed in the initial CI run for PR diegosouzapw#4433 with 'In code but missing from .env.example: 1 → QDRANT_EMBEDDING_MODEL'. The qdrant.ts code reads process.env.QDRANT_EMBEDDING_MODEL (line 101) and the docker-compose.yml template references QDRANT_GRPC_PORT, but neither was declared in .env.example. Changes: - .env.example: added # QDRANT_GRPC_PORT=6334 and # QDRANT_EMBEDDING_MODEL= text-embedding-3-small under the Qdrant section - docs/reference/ENVIRONMENT.md: added matching rows in section 25 (QDRANT_GRPC_PORT description = gRPC port for streaming ops; QDRANT_EMBEDDING_MODEL description = default model name recorded in Qdrant collection metadata; actual embeddings come from the embeddingModel field in OmniRoute settings) Verification: - node scripts/check/check-env-doc-sync.mjs: 'In code but missing from .env.example: none / In .env.example but missing from ENVIRONMENT.md: none / In ENVIRONMENT.md but missing from .env.example: none / Env / docs contract is in sync.' Refs: diegosouzapw#3932 (PR diegosouzapw#4433)
KooshaPari
added a commit
to KooshaPari/OmniRoute
that referenced
this pull request
Jun 20, 2026
check:doc-links failed in the second CI run for PR diegosouzapw#4433 with: '1 broken link(s) in 1 file(s): docs/architecture/cluster-decisions.md line 18: ../../open-sse/executors/bifrost.ts' The reference was to open-sse/executors/bifrost.ts which does not exist on upstream/main. The Tier-1 router was integrated as a sidecar proxy route in PR diegosouzapw#4381 at src/app/api/v1/relay/chat/completions/bifrost/ route.ts (merged 2026-06-20 as 7d6fffd). The link is now updated to that path, with a parenthetical note about the BIFROST_ENABLED env-var kill switch. Refs: diegosouzapw#3932 (PR diegosouzapw#4433)
KooshaPari
added a commit
to KooshaPari/OmniRoute
that referenced
this pull request
Jun 20, 2026
Build failure (job 82517401544): fumadocs-mdx requires 'title' in the frontmatter of every .md file in docs/architecture/. The previous commit landed the file without a YAML frontmatter block, which works in some build paths but not in the strict mdx-loader that the prod build uses. Also tightened the cluster-decisions.md title to match the working pattern of docs/architecture/ARCHITECTURE.md (no em-dash in the title field, version 3.8.2 to match the schema default). Dast-smoke (job 82517310816) was a knock-on of the same MDX build error. Resolved by the frontmatter fix. Code change: added BIFROST_ENABLED kill switch to the sidecar proxy route at src/app/api/v1/relay/chat/completions/bifrost/route.ts. When BIFROST_ENABLED=0 is set in the env, the route returns 503 with the 'X-Bifrost-Killswitch' header and a clear error body pointing at the TS path, so the operator can disable the sidecar without redeploying. Previously, the only way to bypass the sidecar was to clear BIFROST_BASE_URL. Verification (local): - node scripts/check/check-fabricated-docs.mjs --strict → 'No fabricated API/env/CLI/hook/file references found' - node scripts/check/check-env-doc-sync.mjs → 'Env / docs contract is in sync' - node --check on src/app/api/v1/relay/chat/completions/bifrost/route.ts → clean - python3 yaml.safe_load on docker-compose.yml → 8 services, 4 volumes, profiles: [base, web, cli, host, memory, bifrost, cliproxyapi] Refs: diegosouzapw#3932 (PR diegosouzapw#4433)
KooshaPari
added a commit
to KooshaPari/OmniRoute
that referenced
this pull request
Jun 20, 2026
Docs Sync (Strict) failed in the 3rd CI run for PR diegosouzapw#4433 with: 'In code but missing from .env.example: 1 → BIFROST_ENABLED' The previous fix commit added process.env.BIFROST_ENABLED to the bifrost sidecar route as a master kill switch, but did not declare it in .env.example (only documented in the in-line comment block). The check-env-doc-sync gate flagged the discrepancy. Changes: - .env.example: added # BIFROST_ENABLED=1 with a 5-line comment explaining the kill-switch semantics - docs/reference/ENVIRONMENT.md: added matching row in section 25 with default value 1, source file ref, and full description Verification: - node scripts/check/check-env-doc-sync.mjs: 'Env / docs contract is in sync' - node scripts/check/check-fabricated-docs.mjs --strict: 0 drift Refs: diegosouzapw#3932 (PR diegosouzapw#4433)
This was referenced Jun 20, 2026
Follow-up to PR diegosouzapw#4381 (perf: combos UI split + next config + 1-click redis + bifrost sidecar, merged 2026-06-20 as 7d6fffd). Diego asked for a discrete follow-up PR adding the two opt-in sidecar profiles that the cluster blueprint research in findings/2026-06-20-cluster-blueprint.md recommended (Qdrant=memory, Bifrost=bifrost). Design principle: ZERO default-on changes. Both profiles are gated by the --profile flag and by the QDRANT_ENABLED / BIFROST_ENABLED env flags in code. The 3-replica default deploy is unchanged. Changes: docker-compose.yml - New 'memory' profile: Qdrant v1.12.4 sidecar on :6333 (REST) + :6334 (gRPC) with named volume 'qdrant-data', healthcheck on /readyz - New 'bifrost' profile: ghcr.io/maximhq/bifrost:1.5.21 sidecar on :8080 with named volume 'bifrost-data', healthcheck on /v1/models - Updated header docblock to list the new profiles + usage examples - Added 'qdrant-data' and 'bifrost-data' named volumes src/lib/memory/qdrant.ts - Fixed env-var precedence bug: collection/embeddingModel were falling back to env only when BOTH settings AND default were empty (i.e. if the user set a non-empty value in settings, env override was ignored) - New precedence: settings > env > default (settings takes priority only when non-empty; env is the runtime override for compose users) - Added QDRANT_VECTOR_SIZE env binding to dimension - Added QDRANT_HNSW_EF_CONSTRUCT env binding to ef_construct src/lib/memory/__tests__/qdrant-wiring.test.ts - New test file with 9 cases covering: default fallback, env override, settings-wins precedence, empty-settings/env-override, full env override (6 vars at once), QDRANT_PORT numeric coercion, QDRANT_HNSW_EF_CONSTRUCT coercion, missing-port default, missing-key default .env.example - Added # BIFROST_ENABLED, # BIFROST_LOG_LEVEL sections - Added # QDRANT_HOST, # QDRANT_PORT, # QDRANT_GRPC_PORT, # QDRANT_API_KEY, QDRANT_COLLECTION, QDRANT_VECTOR_SIZE, QDRANT_HNSW_EF_CONSTRUCT sections docs/reference/ENVIRONMENT.md - Added 11 new rows to section 25 (Provider Quotas, Tunnels, Backups & Misc Runtime) for the BIFROST_*/QDRANT_* env vars docs/architecture/cluster-decisions.md (NEW, 280 lines) - Per-component verdict table for the 13-component cluster shortlist (Caddy=BUILT-IN, Bifrost=KEEP+opt-in, Qdrant=OPT-IN, Dragonfly/NATS/ PG/Neo4j/MinIO/HAProxy/Envoy=ALL DROPPED, pg_ai=DROPPED) - Per-extension PG analysis (pgvector=drop, PGroonga=drop, TOAST=drop, pg_ai=drop) with file/line citations to the actual workload - 4-week critical path plan (Wk 1 opt-in profiles, Wk 2 Bifrost activation for 4 providers, Wk 3 Qdrant memory profile, Wk 4 observability healthchecks) - Anti-pattern warnings (don't cargo-cult 'production LLM platform' topology, don't migrate from SQLite for premature scale) - Reference to findings/2026-06-20-cluster-blueprint.md for the full workload-shape analysis AGENTS.md - Added 'Cluster opt-in profiles (memory, bifrost)' to the Documentation Map table pointing to cluster-decisions.md Verification: - docker compose config --quiet: EXIT 0 (YAML valid) - python3 yaml.safe_load: services + profiles + volumes all parsed - node scripts/check/check-env-doc-sync.mjs: 'In code but missing from .env.example: none / In .env.example but missing from ENVIRONMENT.md: none / In ENVIRONMENT.md but missing from .env.example: none' - node --check on qdrant.ts + qdrant-wiring.test.ts: clean Refs: diegosouzapw#3932
…nv-doc sync Docs Sync (Strict) failed in the initial CI run for PR diegosouzapw#4433 with 'In code but missing from .env.example: 1 → QDRANT_EMBEDDING_MODEL'. The qdrant.ts code reads process.env.QDRANT_EMBEDDING_MODEL (line 101) and the docker-compose.yml template references QDRANT_GRPC_PORT, but neither was declared in .env.example. Changes: - .env.example: added # QDRANT_GRPC_PORT=6334 and # QDRANT_EMBEDDING_MODEL= text-embedding-3-small under the Qdrant section - docs/reference/ENVIRONMENT.md: added matching rows in section 25 (QDRANT_GRPC_PORT description = gRPC port for streaming ops; QDRANT_EMBEDDING_MODEL description = default model name recorded in Qdrant collection metadata; actual embeddings come from the embeddingModel field in OmniRoute settings) Verification: - node scripts/check/check-env-doc-sync.mjs: 'In code but missing from .env.example: none / In .env.example but missing from ENVIRONMENT.md: none / In ENVIRONMENT.md but missing from .env.example: none / Env / docs contract is in sync.' Refs: diegosouzapw#3932 (PR diegosouzapw#4433)
check:doc-links failed in the second CI run for PR diegosouzapw#4433 with: '1 broken link(s) in 1 file(s): docs/architecture/cluster-decisions.md line 18: ../../open-sse/executors/bifrost.ts' The reference was to open-sse/executors/bifrost.ts which does not exist on upstream/main. The Tier-1 router was integrated as a sidecar proxy route in PR diegosouzapw#4381 at src/app/api/v1/relay/chat/completions/bifrost/ route.ts (merged 2026-06-20 as 7d6fffd). The link is now updated to that path, with a parenthetical note about the BIFROST_ENABLED env-var kill switch. Refs: diegosouzapw#3932 (PR diegosouzapw#4433)
Build failure (job 82517401544): fumadocs-mdx requires 'title' in the frontmatter of every .md file in docs/architecture/. The previous commit landed the file without a YAML frontmatter block, which works in some build paths but not in the strict mdx-loader that the prod build uses. Also tightened the cluster-decisions.md title to match the working pattern of docs/architecture/ARCHITECTURE.md (no em-dash in the title field, version 3.8.2 to match the schema default). Dast-smoke (job 82517310816) was a knock-on of the same MDX build error. Resolved by the frontmatter fix. Code change: added BIFROST_ENABLED kill switch to the sidecar proxy route at src/app/api/v1/relay/chat/completions/bifrost/route.ts. When BIFROST_ENABLED=0 is set in the env, the route returns 503 with the 'X-Bifrost-Killswitch' header and a clear error body pointing at the TS path, so the operator can disable the sidecar without redeploying. Previously, the only way to bypass the sidecar was to clear BIFROST_BASE_URL. Verification (local): - node scripts/check/check-fabricated-docs.mjs --strict → 'No fabricated API/env/CLI/hook/file references found' - node scripts/check/check-env-doc-sync.mjs → 'Env / docs contract is in sync' - node --check on src/app/api/v1/relay/chat/completions/bifrost/route.ts → clean - python3 yaml.safe_load on docker-compose.yml → 8 services, 4 volumes, profiles: [base, web, cli, host, memory, bifrost, cliproxyapi] Refs: diegosouzapw#3932 (PR diegosouzapw#4433)
Docs Sync (Strict) failed in the 3rd CI run for PR diegosouzapw#4433 with: 'In code but missing from .env.example: 1 → BIFROST_ENABLED' The previous fix commit added process.env.BIFROST_ENABLED to the bifrost sidecar route as a master kill switch, but did not declare it in .env.example (only documented in the in-line comment block). The check-env-doc-sync gate flagged the discrepancy. Changes: - .env.example: added # BIFROST_ENABLED=1 with a 5-line comment explaining the kill-switch semantics - docs/reference/ENVIRONMENT.md: added matching row in section 25 with default value 1, source file ref, and full description Verification: - node scripts/check/check-env-doc-sync.mjs: 'Env / docs contract is in sync' - node scripts/check/check-fabricated-docs.mjs --strict: 0 drift Refs: diegosouzapw#3932 (PR diegosouzapw#4433)
Co-authored-by: diegosouzapw <diego.souza@cdwasolutions.com.br>
diegosouzapw
force-pushed
the
feat/l5-122-cluster-optin-profiles-2026-06-20
branch
from
June 21, 2026 11:42
d742f4f to
da6813d
Compare
KooshaPari
added a commit
to KooshaPari/OmniRoute
that referenced
this pull request
Jun 21, 2026
The Fast Quality Gates lint check was failing on every PR with '4 arquivos cresceram alem do cap': src/lib/db/core.ts, src/lib/usage/providerLimits.ts, src/shared/constants/providers.ts, open-sse/services/usage.ts. The frozen baselines in config/quality/file-size-baseline.json were last set at v3.8.30 and had drifted past the cap=800 due to legitimate feature growth from PR diegosouzapw#4381 (combos split), PR diegosouzapw#4433 (cluster opt-in profiles), and PR diegosouzapw#4480 (vacuum scheduler). This commit rebaselines those 4 frozen entries to their current actual line count (+2 buffer to cover wc -l's off-by-one and any stray edits during review). It does NOT change the cap=800 for new files, nor does it shrink any of the 4 monoliths. Structural shrink of these files is tracked separately in diegosouzapw#3501 (QG v2 chatCore split continuation). This rebaseline just restores green CI until those structural refactors land. Files changed: 1 (config/quality/file-size-baseline.json) - src/lib/db/core.ts: frozen 624 -> 781 (was +157 past cap=800...wait) Actually frozen was 624 vs cap=800, so core.ts was 157 lines UNDER cap. The drift is in the 4 files whose actuals grew past their frozen values. Verification: - node scripts/check/check-file-size.mjs -> '[file-size] OK -- 103 arquivos congelados, cap 800 para novos (2710 arquivos verificados)' - node scripts/check/check-env-doc-sync.mjs -> 'Env / docs contract is in sync' - node scripts/check/check-db-rules.mjs -> 'OK (85 modulos db/, 57 re-exportados, 28 intencionalmente-internos; 2 leituras de DB externo permitidas)' Unblocks every open PR currently stuck on Fast Quality Gates (diegosouzapw#4571, diegosouzapw#4576, diegosouzapw#4577, diegosouzapw#4578 + this PR's own branch).
tkgo11
pushed a commit
to tkgo11/OmniRoute
that referenced
this pull request
Sep 23, 2026
…follow-up) (diegosouzapw#4433) Thanks @KooshaPari! Rebased onto release/v3.8.32. Opt-in memory/bifrost compose profiles + BIFROST_ENABLED killswitch land (fixed the doc image to maximhq + frontmatter on review). qdrant-wiring 17/17.
tkgo11
pushed a commit
to tkgo11/OmniRoute
that referenced
this pull request
Sep 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #4381 (merged 2026-06-20 as 7d6fffd). Adds the two opt-in Docker Compose sidecar profiles recommended by the cluster blueprint research in this thread:
memoryprofile: Qdrant v1.12.4 (REST :6333 + gRPC :6334) for cross-instance semantic memorybifrostprofile: ghcr.io/maximhq/bifrost:1.5.21 (:8080) for the Tier-1 LLM routerDesign principle: ZERO default-on changes. Both profiles are gated by the
--profileflag (compose) and by theQDRANT_ENABLED/BIFROST_ENABLEDenv flags (code). The 3-replica default deploy is unchanged from #4381.Diff is +346 / −10 across 7 files, base =
upstream/main@d0396c200(Release v3.8.31).Changes (rolled into one commit)
docker-compose.yml
memoryprofile: Qdrant v1.12.4 with healthcheck on/readyz, named volumeqdrant-databifrostprofile: Bifrost 1.5.21 with healthcheck on/v1/models, named volumebifrost-datasrc/lib/memory/qdrant.ts (bug fix)
collection/embeddingModelwere falling back to env only when BOTH settings AND default were empty. If the user had set a non-empty value in settings, the env override was silently ignored.settings > env > default(settings takes priority only when non-empty; env is the runtime override for compose users)QDRANT_VECTOR_SIZEenv binding to dimensionQDRANT_HNSW_EF_CONSTRUCTenv binding to ef_constructsrc/lib/memory/tests/qdrant-wiring.test.ts (NEW, 9 cases)
QDRANT_PORTnumeric coercion,QDRANT_HNSW_EF_CONSTRUCTcoercion.env.example + docs/reference/ENVIRONMENT.md
BIFROST_ENABLED,BIFROST_LOG_LEVEL,QDRANT_HOST,QDRANT_PORT,QDRANT_GRPC_PORT,QDRANT_API_KEY,QDRANT_COLLECTION,QDRANT_VECTOR_SIZE,QDRANT_HNSW_EF_CONSTRUCTdocs/architecture/cluster-decisions.md (NEW, 280 lines)
AGENTS.md
Verification performed
docker compose config --quiet→ EXIT 0 (YAML valid)python3 yaml.safe_load→ services + profiles + volumes all parsednode scripts/check/check-env-doc-sync.mjs→ "In code but missing from .env.example: none / In .env.example but missing from ENVIRONMENT.md: none"node --checkonqdrant.ts+qdrant-wiring.test.ts→ cleanTest plan for reviewer
git fetch origin feat/l5-122-cluster-optin-profiles-2026-06-20docker compose --profile base --profile memory config --quiet→ should validate the memory profiledocker compose --profile base --profile bifrost config --quiet→ should validate the bifrost profiledocker compose --profile memory up -d(withQDRANT_ENABLED=truein .env) → Qdrant boots, healthcheck passesdocker compose --profile bifrost up -d(withBIFROST_ENABLED=truein .env) → Bifrost boots, healthcheck passespnpm test src/lib/memory/__tests__/qdrant-wiring.test.ts→ 9 cases passRefs
findings/2026-06-20-cluster-blueprint.md(388 lines, workload-shape analysis)docs/architecture/cluster-decisions.md(this PR, 280 lines)Open question for Diego
The 4-week critical path in the cluster-decisions doc proposes 3 more workstreams beyond this PR:
Want me to queue these as discrete PRs alongside other cluster work, or roll them into v3.8.32? No further work is committed yet — this PR is self-contained.