Skip to content

fix(openai): repair Nebius Token Factory helper - #6845

Draft
demianarc wants to merge 1 commit into
livekit:mainfrom
demianarc:codex/repair-nebius-token-factory-helper
Draft

fix(openai): repair Nebius Token Factory helper#6845
demianarc wants to merge 1 commit into
livekit:mainfrom
demianarc:codex/repair-nebius-token-factory-helper

Conversation

@demianarc

@demianarc demianarc commented Aug 13, 2026

Copy link
Copy Markdown

What changed

  • point the existing LLM.with_nebius helper at the canonical Nebius Token Factory API;
  • require callers to select a model instead of silently using a retired Llama 3.1 default;
  • refresh NebiusChatModels from the current public Token Factory catalog snapshot;
  • update the helper documentation to use Token Factory naming;
  • add hermetic regression tests for environment-key/default-endpoint wiring and the serialized chat-completions request.

Why

The helper added in #3332 still targets https://api.studio.nebius.com/v1/, while the current service is Nebius Token Factory at https://api.tokenfactory.nebius.com/v1/. Its implicit model default is no longer in the public model catalog, and most of its type-hint model list has also been retired.

Requiring model= avoids replacing one time-sensitive default with another. The str | NebiusChatModels annotation still permits newly released models before the typed list catches up.

This repairs the existing OpenAI-compatible helper only. It does not add a second provider or claim stateful Responses support.

Validation

  • pytest tests/test_plugin_openai_nebius.py --unit -q — 2 passed
  • ruff format on all changed files — passed
  • ruff check on all changed files — passed
  • git diff --check — passed

A scoped strict mypy run reaches the package but reports 11 existing generic-annotation errors across the OpenAI plugin (tts.py, stt.py, llm.py, Responses, and Realtime). None are in this patch's changed lines or new test.

No live Token Factory request was run because this validation intentionally uses no external credentials or network.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

2 participants