Nebius Token Factory

Use Nebius Token Factory models with Kern agents.

Nebius Token Factory is a platform from Nebius that simplifies the process of building applications using AI models. It provides a suite of tools and services for developers to easily test, integrate and fine-tune various AI models, including those for text and image generation. You can checkout the list of available models here.

We recommend experimenting to find the best-suited-model for your use-case.

Authentication

Set your NEBIUS_API_KEY environment variable. Get your key from Nebius Token Factory here.

1export NEBIUS_API_KEY=***
1setx NEBIUS_API_KEY ***

Example

Use Nebius with your Agent:

1from kern.agent import Agent
2from kern.models.nebius import Nebius
3
4agent = Agent(
5 model=Nebius(
6 id="meta-llama/Llama-3.3-70B-Instruct",
7 api_key=os.getenv("NEBIUS_API_KEY")
8 ),
9 markdown=True
10)
11
12# Print the response in the terminal
13agent.print_response("Share a 2 sentence horror story.")
Note View more examples here.

Params

ParameterTypeDefaultDescription
idstr"meta-llama/Meta-Llama-3.1-70B-Instruct"The id of the Nebius model to use
namestr"Nebius"The name of the model
providerstr"Nebius"The provider of the model
api_keyOptional[str]NoneThe API key for Nebius (defaults to NEBIUS_API_KEY env var)
base_urlstr"https://api.tokenfactory.nebius.com/v1"The base URL for the Nebius API