Nebius Token Factory
Nebius Token Factory provides fast inference for open-source language models.
Installation
Section titled “Installation”The OpenAI provider is an optional dependency. To install, run:
pip install 'strands-agents[openai]'npm install @strands-agents/sdk openaiCreate an API key in the
Nebius Token Factory Console, export it as
NEBIUS_API_KEY, and point the provider at the Token Factory endpoint:
import os
from strands import Agentfrom strands.models.openai import OpenAIModel
model = OpenAIModel( client_args={ "api_key": os.environ["NEBIUS_API_KEY"], "base_url": "https://api.tokenfactory.nebius.com/v1/", }, model_id="deepseek-ai/DeepSeek-R1-0528",)
agent = Agent(model=model)response = agent("Explain tool calling in one sentence.")print(response)import { Agent } from '@strands-agents/sdk'import { OpenAIModel } from '@strands-agents/sdk/models/openai'
const model = new OpenAIModel({ api: 'chat', apiKey: process.env.NEBIUS_API_KEY, clientConfig: { baseURL: 'https://api.tokenfactory.nebius.com/v1/', }, modelId: 'deepseek-ai/DeepSeek-R1-0528',})
const agent = new Agent({ model })const response = await agent.invoke('Explain tool calling in one sentence.')console.log(response)Configuration
Section titled “Configuration”Two client settings connect the provider to Nebius Token Factory:
- API key: from the Token Factory Console
- Base URL:
https://api.tokenfactory.nebius.com/v1/
Model IDs come from the
Token Factory model catalog,
for example deepseek-ai/DeepSeek-R1-0528 or
meta-llama/Meta-Llama-3.1-70B-Instruct. For model parameters and other provider
options, see the
OpenAI provider guide.