From 61fe77cffecab6e1e6b8c54e2702847f242d3349 Mon Sep 17 00:00:00 2001 From: clementguarino06510-glitch Date: Sun, 30 Aug 2026 03:44:29 +0000 Subject: [PATCH] feat: add orcarouter as a built-in model provider Add orcarouter to PREDEFINED_PROVIDERS and PREDEFINED_PROVIDERS_MODEL_MAP, mirroring the existing openrouter wiring, with pre-configured aliases for text, reasoning, vision, and embedding. Update the default-model-settings docs and README quick-start so the new provider is discoverable. Fixes #897 --- README.md | 3 ++ .../concepts/models/custom-model-settings.mdx | 2 +- .../models/default-model-settings.mdx | 23 ++++++++++++++- .../pages/concepts/models/model-providers.mdx | 2 +- fern/versions/latest/pages/index.mdx | 3 ++ .../data_designer/config/utils/constants.py | 22 ++++++++++++++ .../config/test_default_model_settings.py | 29 +++++++++++++++++-- 7 files changed, 79 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6d2a9d4cb..764dc8bbf 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ Start with one of our default model providers: - [NVIDIA Build API](https://build.nvidia.com) - [OpenAI](https://platform.openai.com/api-keys) - [OpenRouter](https://openrouter.ai) +- [OrcaRouter](https://www.orcarouter.ai) Grab your API key(s) using the above links and set one or more of the following environment variables: ```bash @@ -61,6 +62,8 @@ export NVIDIA_API_KEY="your-api-key-here" export OPENAI_API_KEY="your-openai-api-key-here" export OPENROUTER_API_KEY="your-openrouter-api-key-here" + +export ORCAROUTER_API_KEY="your-orcarouter-api-key-here" ``` ### 3. Start generating data! diff --git a/fern/versions/latest/pages/concepts/models/custom-model-settings.mdx b/fern/versions/latest/pages/concepts/models/custom-model-settings.mdx index d4e741059..6545de090 100644 --- a/fern/versions/latest/pages/concepts/models/custom-model-settings.mdx +++ b/fern/versions/latest/pages/concepts/models/custom-model-settings.mdx @@ -91,7 +91,7 @@ preview_result.display_sample_record() ``` - When you only specify `model_configs`, the default model providers (NVIDIA, OpenAI, and OpenRouter) are still available. You only need to create custom providers if you want to connect to different endpoints or modify provider settings. + When you only specify `model_configs`, the default model providers (NVIDIA, OpenAI, OpenRouter, and OrcaRouter) are still available. You only need to create custom providers if you want to connect to different endpoints or modify provider settings. diff --git a/fern/versions/latest/pages/concepts/models/default-model-settings.mdx b/fern/versions/latest/pages/concepts/models/default-model-settings.mdx index 8b73c5575..f6de80aaf 100644 --- a/fern/versions/latest/pages/concepts/models/default-model-settings.mdx +++ b/fern/versions/latest/pages/concepts/models/default-model-settings.mdx @@ -36,6 +36,15 @@ The OpenAI provider gives you access to GPT models and other OpenAI offerings. The OpenRouter provider gives you access to a unified interface for many different language models from various providers. +### OrcaRouter Provider (`orcarouter`) + +- **Endpoint**: `https://api.orcarouter.ai/v1` +- **API Key**: Set via `ORCAROUTER_API_KEY` environment variable +- **Models**: Access to a wide variety of models through OrcaRouter's unified gateway +- **Getting Started**: Get your API key from [orcarouter.ai](https://www.orcarouter.ai) + +The OrcaRouter provider gives you access to a unified OpenAI-compatible gateway for many different language models from various providers, with adaptive routing and automatic failover across upstreams. + ## Model Configurations Data Designer provides pre-configured model aliases for common use cases. When you create a `DataDesignerConfigBuilder` without specifying `model_configs`, these default configurations are automatically available. @@ -74,6 +83,17 @@ The following model configurations are automatically available when `OPENROUTER_ | `openrouter-vision` | `nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free` | Omni multimodal understanding for image, audio, and video inputs, subject to OpenRouter model support | `temperature=0.60, top_p=0.95` | | `openrouter-embedding` | `openai/text-embedding-3-large` | Text embeddings | `encoding_format="float"` | +### OrcaRouter Models + +The following model configurations are automatically available when `ORCAROUTER_API_KEY` is set: + +| Alias | Model | Use Case | Inference Parameters | +|-------|-------|----------|---------------------| +| `orcarouter-text` | `openai/gpt-4.1` | General text generation | `temperature=0.85, top_p=0.95` | +| `orcarouter-reasoning` | `deepseek/deepseek-v4-pro-0813` | Reasoning and analysis tasks | `temperature=0.35, top_p=0.95` | +| `orcarouter-vision` | `openai/gpt-4o` | Vision and image understanding | `temperature=0.85, top_p=0.95` | +| `orcarouter-embedding` | `openai/text-embedding-3-large` | Text embeddings | `encoding_format="float"` | + The `multi_modal_context` field can include image, audio, and video contexts, but each model/provider combination has its own accepted input formats, media-size limits, and modality mix. Use an image-capable model for image-only workflows, and use an omni or otherwise multimodal model before sending audio or video context. Local audio/video paths require explicit URL mode (`data_type=url`) and require the model endpoint to have filesystem access to the same paths, typically a colocated vLLM server configured for local media access. @@ -113,7 +133,7 @@ Both methods operate on the same files, ensuring consistency across your entire ## Important Notes - While default model configurations are always available, you need to set the appropriate API key environment variable (`NVIDIA_API_KEY`, `OPENAI_API_KEY`, or `OPENROUTER_API_KEY`) to actually use the corresponding models for data generation. Without a valid API key, any attempt to generate data using that provider's models will fail. + While default model configurations are always available, you need to set the appropriate API key environment variable (`NVIDIA_API_KEY`, `OPENAI_API_KEY`, `OPENROUTER_API_KEY`, or `ORCAROUTER_API_KEY`) to actually use the corresponding models for data generation. Without a valid API key, any attempt to generate data using that provider's models will fail. @@ -128,6 +148,7 @@ Both methods operate on the same files, ensuring consistency across your entire export NVIDIA_API_KEY="your-api-key-here" export OPENAI_API_KEY="your-openai-api-key-here" export OPENROUTER_API_KEY="your-openrouter-api-key-here" +export ORCAROUTER_API_KEY="your-orcarouter-api-key-here" ``` diff --git a/fern/versions/latest/pages/concepts/models/model-providers.mdx b/fern/versions/latest/pages/concepts/models/model-providers.mdx index a51b80d84..e1a10a8dc 100644 --- a/fern/versions/latest/pages/concepts/models/model-providers.mdx +++ b/fern/versions/latest/pages/concepts/models/model-providers.mdx @@ -28,7 +28,7 @@ Data Designer supports two provider types: | Type | Description | |------|-------------| -| `"openai"` | OpenAI-compatible chat completion API. This is the default and works with most providers, including NVIDIA NIM, vLLM, TGI, OpenRouter, Together AI, and OpenAI itself. | +| `"openai"` | OpenAI-compatible chat completion API. This is the default and works with most providers, including NVIDIA NIM, vLLM, TGI, OpenRouter, OrcaRouter, Together AI, and OpenAI itself. | | `"anthropic"` | Anthropic's native Messages API for Claude models. Use this when connecting directly to Anthropic's API. | Most self-hosted and third-party endpoints expose an OpenAI-compatible API, so `provider_type="openai"` is the right choice in the majority of cases. Only use `"anthropic"` when connecting directly to Anthropic's API at `https://api.anthropic.com`. diff --git a/fern/versions/latest/pages/index.mdx b/fern/versions/latest/pages/index.mdx index cd9d7f983..88f1f6483 100644 --- a/fern/versions/latest/pages/index.mdx +++ b/fern/versions/latest/pages/index.mdx @@ -41,6 +41,9 @@ export OPENAI_API_KEY="your-openai-api-key-here" # OpenRouter (openrouter.ai) export OPENROUTER_API_KEY="your-openrouter-api-key-here" + +# OrcaRouter (orcarouter.ai) +export ORCAROUTER_API_KEY="your-orcarouter-api-key-here" ``` Verify your configuration is ready: diff --git a/packages/data-designer-config/src/data_designer/config/utils/constants.py b/packages/data-designer-config/src/data_designer/config/utils/constants.py index d7b3391e2..313744527 100644 --- a/packages/data-designer-config/src/data_designer/config/utils/constants.py +++ b/packages/data-designer-config/src/data_designer/config/utils/constants.py @@ -299,6 +299,10 @@ class NordColor(Enum): OPENROUTER_API_KEY_ENV_VAR_NAME = "OPENROUTER_API_KEY" +ORCAROUTER_PROVIDER_NAME = "orcarouter" + +ORCAROUTER_API_KEY_ENV_VAR_NAME = "ORCAROUTER_API_KEY" + ATTRIBUTION_TITLE = "NeMo Data Designer" ATTRIBUTION_REFERER = "https://github.com/NVIDIA-NeMo/DataDesigner" @@ -329,6 +333,12 @@ class NordColor(Enum): "provider_type": "openai", "api_key": OPENROUTER_API_KEY_ENV_VAR_NAME, }, + { + "name": ORCAROUTER_PROVIDER_NAME, + "endpoint": "https://api.orcarouter.ai/v1", + "provider_type": "openai", + "api_key": ORCAROUTER_API_KEY_ENV_VAR_NAME, + }, ] @@ -385,6 +395,18 @@ class NordColor(Enum): "inference_parameters": DEFAULT_EMBEDDING_INFERENCE_PARAMS, }, }, + ORCAROUTER_PROVIDER_NAME: { + "text": {"model": "openai/gpt-4.1", "inference_parameters": DEFAULT_TEXT_INFERENCE_PARAMS}, + "reasoning": { + "model": "deepseek/deepseek-v4-pro-0813", + "inference_parameters": DEFAULT_REASONING_INFERENCE_PARAMS, + }, + "vision": {"model": "openai/gpt-4o", "inference_parameters": DEFAULT_VISION_INFERENCE_PARAMS}, + "embedding": { + "model": "openai/text-embedding-3-large", + "inference_parameters": DEFAULT_EMBEDDING_INFERENCE_PARAMS, + }, + }, } # Persona locale metadata - used by the CLI and the person sampler. diff --git a/packages/data-designer-config/tests/config/test_default_model_settings.py b/packages/data-designer-config/tests/config/test_default_model_settings.py index dc5f03107..f7c68685b 100644 --- a/packages/data-designer-config/tests/config/test_default_model_settings.py +++ b/packages/data-designer-config/tests/config/test_default_model_settings.py @@ -54,7 +54,7 @@ def test_get_default_inference_parameters(): def test_get_builtin_model_configs(): builtin_model_configs = get_builtin_model_configs() - assert len(builtin_model_configs) == 12 + assert len(builtin_model_configs) == 16 assert builtin_model_configs[0].alias == "nvidia-text" assert builtin_model_configs[0].model == "nvidia/nemotron-3-nano-30b-a3b" assert builtin_model_configs[0].provider == "nvidia" @@ -95,11 +95,31 @@ def test_get_builtin_model_configs(): assert builtin_model_configs[11].alias == "openrouter-embedding" assert builtin_model_configs[11].model == "openai/text-embedding-3-large" assert builtin_model_configs[11].provider == "openrouter" + assert builtin_model_configs[12].alias == "orcarouter-text" + assert builtin_model_configs[12].model == "openai/gpt-4.1" + assert builtin_model_configs[12].provider == "orcarouter" + assert builtin_model_configs[12].inference_parameters == ChatCompletionInferenceParams( + temperature=0.85, + top_p=0.95, + ) + assert builtin_model_configs[13].alias == "orcarouter-reasoning" + assert builtin_model_configs[13].model == "deepseek/deepseek-v4-pro-0813" + assert builtin_model_configs[13].provider == "orcarouter" + assert builtin_model_configs[13].inference_parameters == ChatCompletionInferenceParams( + temperature=0.35, + top_p=0.95, + ) + assert builtin_model_configs[14].alias == "orcarouter-vision" + assert builtin_model_configs[14].model == "openai/gpt-4o" + assert builtin_model_configs[14].provider == "orcarouter" + assert builtin_model_configs[15].alias == "orcarouter-embedding" + assert builtin_model_configs[15].model == "openai/text-embedding-3-large" + assert builtin_model_configs[15].provider == "orcarouter" def test_get_builtin_model_providers(): builtin_model_providers = get_builtin_model_providers() - assert len(builtin_model_providers) == 3 + assert len(builtin_model_providers) == 4 assert builtin_model_providers[0].name == "nvidia" assert builtin_model_providers[0].endpoint == "https://integrate.api.nvidia.com/v1" assert builtin_model_providers[0].provider_type == "openai" @@ -115,6 +135,11 @@ def test_get_builtin_model_providers(): assert builtin_model_providers[2].provider_type == "openai" assert builtin_model_providers[2].api_key == "OPENROUTER_API_KEY" assert builtin_model_providers[2].extra_headers is None + assert builtin_model_providers[3].name == "orcarouter" + assert builtin_model_providers[3].endpoint == "https://api.orcarouter.ai/v1" + assert builtin_model_providers[3].provider_type == "openai" + assert builtin_model_providers[3].api_key == "ORCAROUTER_API_KEY" + assert builtin_model_providers[3].extra_headers is None def test_get_default_model_configs_path_exists(tmp_path: Path):