Skip to content

Use OpenAI default model for OpenAI fallback#46

Open
sjh9714 wants to merge 1 commit into
NVIDIA:mainfrom
sjh9714:fix-openai-fallback-model
Open

Use OpenAI default model for OpenAI fallback#46
sjh9714 wants to merge 1 commit into
NVIDIA:mainfrom
sjh9714:fix-openai-fallback-model

Conversation

@sjh9714

@sjh9714 sjh9714 commented Jun 14, 2026

Copy link
Copy Markdown

Summary

Fixes #38.

When only OPENAI_API_KEY is configured, get_chat_model() currently falls back to the active metadata provider default model instead of the OpenAI provider default. This resolves the fallback client configuration through the same provider that supplied the credentials, so OpenAI-only setups use the OpenAI default model while explicit models and provider credentials still take precedence.

Changes

  • Resolve the fallback API key, base URL, and default model together from provider credentials or OpenAI fallback credentials.
  • Add regression coverage for OpenAI-only fallback, explicit model override, and provider credential precedence.

Testing

  • env -u NVIDIA_INFERENCE_KEY -u NVIDIA_INFERENCE_METADATA_KEY -u OPENAI_BASE_URL -u SKILLSPECTOR_MODEL -u SKILLSPECTOR_PROVIDER OPENAI_API_KEY=sk-test-openai-only uv run python - <<'PY' ... PY
  • uv run --extra dev pytest tests/unit/test_llm_utils.py -q
  • uv run --extra dev pytest -m "not integration" tests/ -q
  • uv run --extra dev ruff check src/ tests/
  • uv run --extra dev ruff format --check src/ tests/

Note: I used Codex while preparing this change, reviewed the final diff, and ran the listed checks locally.

Signed-off-by: sjh9714 <163989462+sjh9714@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenAI fallback uses active provider default model

2 participants