Skip to content

Nebius Token Factory

Nebius Token Factory provides fast inference for open-source language models.

The OpenAI provider is an optional dependency. To install, run:

Terminal window
pip install 'strands-agents[openai]'

Create 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 Agent
from 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)

Two client settings connect the provider to Nebius Token Factory:

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.