feat(auth): support OpenAI-compatible BYOK#59
Merged
Conversation
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
Adds first-class OpenAI-compatible BYOK support for the OSS CLI without requiring Noumena platform login:
OPENAI_API_KEYas a direct static BYOK credentialOPENAI_BASE_URLfor OpenAI-compatible providers such as OpenRouterOPENAI_MODELas the default model for OpenAI-compatible BYOKOPENAI_API_KEYfrom becoming a Noumenax-api-keyx-noumena-model, no managed model ID rewritehttps://openrouter.ai/api/v1This intentionally handles the env-native BYOK slice from #22. It does not add a project-local provider registry; that still needs explicit trust/consent before project settings can read ambient env keys.
Also includes the already-present branch test corrections for GLM 5.2 base vs
[1m]context expectations and auth-flow preflight endpoint expectations.Validation
Focused BYOK/provider suite:
Result:
132 pass, 0 fail.Auth suite:
Result:
453 pass, 0 fail.Contracts suite:
Result:
238 pass, 0 fail.Inference contracts:
Result:
59 pass, 0 fail.Canonical build:
Result: passed. Built
/mlstore/src/noumena-network/code/.tmp/packages/ncode-0.1.0-linux-x64/ncode.Live OpenRouter smoke with
OPENAI_API_KEYfrom~/.or_key:Result: passed; model was listed.
Non-streaming live chat:
Result: passed; response text
ok.Streaming live chat:
Result: passed; response text
ok, stop reasonend_turn.Built binary live smoke:
Result: passed; printed
ok.Refs #22 for the env-native OpenAI-compatible BYOK slice. Provider registry remains out of scope.