Skip to content

feat: add Nebius Token Factory provider for open-source models#394

Open
Tony363 wants to merge 2 commits intoBeehiveInnovations:mainfrom
Tony363:feat/nebius-provider
Open

feat: add Nebius Token Factory provider for open-source models#394
Tony363 wants to merge 2 commits intoBeehiveInnovations:mainfrom
Tony363:feat/nebius-provider

Conversation

@Tony363
Copy link
Copy Markdown

@Tony363 Tony363 commented Feb 7, 2026

Description

Adds Nebius Token Factory as a new model provider, enabling access to a wide range of open-source models through their OpenAI-compatible API.

Changes Made

  • New provider: providers/nebius.py — extends OpenAICompatibleProvider with Nebius-specific config and model routing
  • New registry: providers/registries/nebius.py — capability registry backed by conf/nebius_models.json
  • New model catalog: conf/nebius_models.json — 19 models including Qwen3, DeepSeek, Llama, GLM, GPT-OSS, Kimi K2, Gemma, Nemotron
  • Provider integration: registered in server.py, providers/__init__.py, providers/registry.py, providers/shared/provider_type.py
  • Model restrictions support via NEBIUS_ALLOWED_MODELS env var
  • Listed in tools/listmodels.py output
  • .env.example updated with Nebius configuration and model documentation
  • DeepSeek V3.2 cloud model added to conf/custom_models.json
  • Grok-4 intelligence score adjusted (16 → 18) in conf/xai_models.json
  • Auto-formatting fixes from black

Supported Models

Model Context Highlights
Qwen3 235B (Instruct + Thinking) 262K Flagship MoE reasoning
Qwen3 Coder 480B 262K Largest coding MoE
GPT-OSS 120B / 20B 128K OpenAI's open-source models
DeepSeek R1 / V3 / V3.2 128K Reasoning + general purpose
Llama 3.3 70B / 3.1 8B 128K Meta instruction-tuned
Kimi K2 128K Moonshot AI flagship
GLM 4.5 / 4.5 Air / 4.7 128K Vision + function calling
Gemma 3 27B 128K Google efficient open model
Nemotron Ultra 253B 128K NVIDIA high-performance

Testing

  • All linting passes (ruff, black, isort)
  • All unit tests pass (866 passed, 4 skipped)
  • ./code_quality_checks.sh passes 100%
  • Simulator tests (requires NEBIUS_API_KEY)

Checklist

  • PR title follows conventional commits format
  • Activated venv and ran code quality checks: source venv/bin/activate && ./code_quality_checks.sh
  • Self-review completed
  • Documentation updated (.env.example, listmodels output)
  • All unit tests passing
  • Ready for review

🤖 Generated with Claude Code

Adds Nebius Token Factory as a new provider, giving access to open-source
models (Qwen3, DeepSeek, Llama, GLM, GPT-OSS, Kimi, Gemma, Nemotron)
through their OpenAI-compatible API.

Also includes:
- DeepSeek V3.2 cloud model in custom_models.json
- Grok-4 intelligence score adjustment (16 → 18)
- Auto-formatting fixes from black

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @Tony363, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly expands the system's model capabilities by integrating Nebius Token Factory as a new provider. This integration allows users to leverage a wide array of open-source models, such as Qwen3, DeepSeek, and Llama, through a familiar OpenAI-compatible interface. The changes include the addition of a dedicated Nebius provider, a comprehensive model catalog, and necessary configuration updates to ensure seamless operation and user control over model access and selection.

Highlights

  • New Nebius Token Factory Provider: Introduced a new model provider for Nebius Token Factory, enabling access to a diverse range of open-source models through an OpenAI-compatible API.
  • Extensive Model Catalog: Added support for 19 new models from Nebius, including popular open-source models like Qwen3, DeepSeek, Llama, GLM, GPT-OSS, Kimi K2, Gemma, and Nemotron, each with detailed capabilities defined in conf/nebius_models.json.
  • Configurability and Restrictions: Implemented support for NEBIUS_API_KEY for authentication, NEBIUS_MODELS_CONFIG_PATH for custom model catalogs, and NEBIUS_ALLOWED_MODELS for restricting available models, enhancing user control.
  • Provider Integration and Priority: Integrated the Nebius provider into the system's provider registry, including it in the PROVIDER_PRIORITY_ORDER to ensure optimal model selection, and updated API key checks in server.py.
  • Minor Model Updates and Formatting: Added DeepSeek V3.2 cloud model to conf/custom_models.json and adjusted the intelligence score for Grok-4 in conf/xai_models.json. Also included auto-formatting fixes across several test files.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • .env.example
    • Added NEBIUS_API_KEY for Nebius Token Factory authentication.
    • Included optional NEBIUS_MODELS_CONFIG_PATH and NEBIUS_ALLOWED_MODELS environment variables.
    • Updated model documentation to list supported Nebius models.
  • conf/custom_models.json
    • Added deepseek-v3.2:cloud model with its capabilities and aliases.
  • conf/nebius_models.json
    • Added new file defining 19 Nebius models, including Qwen3, DeepSeek, Llama, GLM, GPT-OSS, Kimi K2, Gemma, and Nemotron, with their respective capabilities, aliases, and intelligence scores.
  • conf/xai_models.json
    • Updated the intelligence_score for grok-4 from 16 to 18.
  • providers/init.py
    • Imported NebiusModelProvider.
    • Added NebiusModelProvider to the __all__ export list.
  • providers/nebius.py
    • Added new file implementing NebiusModelProvider, extending OpenAICompatibleProvider.
    • Configured Nebius Token Factory base URL.
    • Implemented get_preferred_model logic for category-based model selection (reasoning, fast, balanced).
  • providers/registries/init.py
    • Imported NebiusModelRegistry.
    • Added NebiusModelRegistry to the __all__ export list.
  • providers/registries/nebius.py
    • Added new file implementing NebiusModelRegistry to load model capabilities from conf/nebius_models.json.
  • providers/registry.py
    • Adjusted PROVIDER_PRIORITY_ORDER to include ProviderType.NEBIUS before XAI and DIAL, and moved AZURE to the end.
    • Added NEBIUS_API_KEY to the _get_api_key_for_provider mapping.
  • providers/shared/provider_type.py
    • Added ProviderType.NEBIUS to the ProviderType enum.
  • server.py
    • Added NEBIUS_API_KEY to the list of environment variables checked during provider configuration.
    • Imported NebiusModelProvider.
    • Included logic to check for NEBIUS_API_KEY and register NebiusModelProvider if found.
    • Updated the error message for missing API keys to include Nebius.
  • simulator_tests/test_chat_simple_validation.py
    • Applied auto-formatting fixes (removed extra blank line).
  • simulator_tests/test_conversation_chain_validation.py
    • Applied auto-formatting fixes (removed extra blank line).
  • simulator_tests/test_cross_tool_comprehensive.py
    • Applied auto-formatting fixes (removed extra blank line).
  • simulator_tests/test_ollama_custom_url.py
    • Applied auto-formatting fixes (removed extra blank line).
  • simulator_tests/test_openrouter_fallback.py
    • Applied auto-formatting fixes (removed extra blank line).
  • simulator_tests/test_openrouter_models.py
    • Applied auto-formatting fixes (removed extra blank line).
  • simulator_tests/test_xai_models.py
    • Applied auto-formatting fixes (removed extra blank line).
  • tests/test_directory_expansion_tracking.py
    • Applied auto-formatting fixes for multiline string literals.
  • tests/test_docker_implementation.py
    • Applied auto-formatting fixes for multiline string literals.
  • tests/test_prompt_regression.py
    • Applied auto-formatting fixes for multiline string literals in test files.
  • tools/listmodels.py
    • Updated the tool description to include Nebius as a provider.
    • Added 'Nebius AI' to the provider_info mapping for display.
  • utils/model_restrictions.py
    • Added NEBIUS_ALLOWED_MODELS environment variable for model restrictions.
    • Included ProviderType.NEBIUS in the ENV_VARS mapping for model restriction service.
Activity
  • All linting checks (ruff, black, isort) have passed.
  • All unit tests have passed (866 passed, 4 skipped).
  • The ./code_quality_checks.sh script passed with 100% success.
  • The author has completed a self-review of the changes.
  • Documentation, including .env.example and listmodels output, has been updated.
  • The pull request is marked as ready for review.
  • Simulator tests are pending and require a NEBIUS_API_KEY to run.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new provider, Nebius Token Factory, which enables access to a wide range of open-source models. The changes are well-structured and consistently integrated across the application, including updates to configuration, provider registration, and model restriction handling. The new provider implementation is clean and follows existing patterns. I have one suggestion to improve code clarity and reduce duplication in the model selection logic. Overall, this is a great addition.

Comment thread providers/nebius.py Outdated
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 082d3dc718

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread conf/custom_models.json
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.

1 participant