-
Notifications
You must be signed in to change notification settings - Fork 5
Remove Alliance defaults from core config #123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jonathanMLDev
merged 6 commits into
cppalliance:main
from
jonathanMLDev:fix/require-pinecone-index-name
Jun 2, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
33c6875
fix: require PINECONE_INDEX_NAME in core config
b4a0d4a
addressed AI reviews
323bf66
addressed William's reviews
54082b4
Merge branch 'main' into fix/require-pinecone-index-name
jonathanMLDev 7a0635c
fixed LF error
fc78c6c
Merge branch 'fix/require-pinecone-index-name' of https://github.com/…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # C++ Alliance Pinecone deployment (examples/alliance) | ||
| # Copy to .env and fill in your API key. | ||
| # The published CLI (resolveAllianceConfig) applies these defaults when variables are omitted. | ||
|
|
||
| PINECONE_API_KEY=your-pinecone-api-key-here | ||
|
|
||
| # Alliance dense index (CLI default when unset: rag-hybrid) | ||
| PINECONE_INDEX_NAME=rag-hybrid | ||
|
|
||
| # Optional: sparse index (default: {PINECONE_INDEX_NAME}-sparse) | ||
| # PINECONE_SPARSE_INDEX_NAME=rag-hybrid-sparse | ||
|
|
||
| # Alliance rerank model (CLI default when unset: bge-reranker-v2-m3) | ||
| # PINECONE_RERANK_MODEL=bge-reranker-v2-m3 |
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,38 @@ | ||
| /** | ||
| * Alliance entry re-exports core config. Rerank default lives in {@link resolveConfig} | ||
| * (`PINECONE_RERANK_MODEL` when set, else `bge-reranker-v2-m3`). | ||
| * Alliance config resolver: applies C++ Alliance deployment defaults, then delegates to core {@link resolveConfig}. | ||
| */ | ||
|
|
||
| import { | ||
| DEFAULT_RERANK_MODEL, | ||
| resolveConfig, | ||
| trimOptional, | ||
| type ConfigOverrides, | ||
| type ServerConfig, | ||
| } from '../core/config.js'; | ||
|
|
||
| /** @deprecated Use {@link DEFAULT_RERANK_MODEL} from core config. */ | ||
| export const DEFAULT_ALLIANCE_RERANK_MODEL = DEFAULT_RERANK_MODEL; | ||
| /** C++ Alliance default dense index when env/CLI omit `PINECONE_INDEX_NAME`. */ | ||
| export const ALLIANCE_DEFAULT_INDEX_NAME = 'rag-hybrid'; | ||
|
|
||
| /** @deprecated No-op; {@link resolveConfig} already applies the rerank default. */ | ||
| export function applyAllianceRerankDefault(config: ServerConfig): ServerConfig { | ||
| return config; | ||
| } | ||
| /** C++ Alliance default rerank model when env/CLI omit `PINECONE_RERANK_MODEL`. */ | ||
| export const ALLIANCE_DEFAULT_RERANK_MODEL = 'bge-reranker-v2-m3'; | ||
|
|
||
| /** @deprecated Use {@link ALLIANCE_DEFAULT_RERANK_MODEL}. */ | ||
| export const DEFAULT_ALLIANCE_RERANK_MODEL = ALLIANCE_DEFAULT_RERANK_MODEL; | ||
|
|
||
| /** Alias for {@link resolveConfig} (Alliance CLI and `setupAllianceServer`). */ | ||
| /** | ||
| * Build {@link ServerConfig} for Alliance CLI and `setupAllianceServer`. | ||
| * Fills index and rerank from Alliance defaults when unset, then calls core `resolveConfig`. | ||
| */ | ||
| export function resolveAllianceConfig( | ||
| overrides: ConfigOverrides = {}, | ||
| env: NodeJS.ProcessEnv = process.env | ||
| ): ServerConfig { | ||
| return resolveConfig(overrides, env); | ||
| const indexName = | ||
| trimOptional(overrides.indexName) ?? | ||
| trimOptional(env['PINECONE_INDEX_NAME']) ?? | ||
| ALLIANCE_DEFAULT_INDEX_NAME; | ||
| const rerankModel = | ||
| trimOptional(overrides.rerankModel) ?? | ||
| trimOptional(env['PINECONE_RERANK_MODEL']) ?? | ||
| ALLIANCE_DEFAULT_RERANK_MODEL; | ||
|
jonathanMLDev marked this conversation as resolved.
|
||
| return resolveConfig({ ...overrides, indexName, rerankModel }, env); | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.