Skip to main content
Crew AI is an open source agentic framework. Crew AI docs

Prerequisites

  1. Create an API key to authorize requests to Nebius Token Factory.
  2. Save the API key into a NEBIUS_API_KEY environment variable:
    export NEBIUS_API_KEY="<API_key>"
    
  3. Install the crewai package:
    pip install crewai   
    

Quickstart

from crewai import Agent, Task, LLM, Crew, Process
import os

llm=LLM(
        model="nebius/Qwen/Qwen3-30B-A3B",
        api_key=os.getenv("NEBIUS_API_KEY")
)

# Create a researcher agent
## see documentation : https://docs.crewai.com/en/concepts/agents#direct-code-definition
researcher = Agent(
  role='Senior Researcher',
  goal='Discover groundbreaking technologies',
  verbose=True,
  llm=llm,
  backstory='A curious mind fascinated by cutting-edge innovation and the potential to change the world, you know everything about tech.'
)

# Task for the researcher
research_task = Task(
  description='Identify the next big trend in AI',
  expected_output='5 paragraphs on the next big AI trend',
  agent=researcher  # Assigning the task to the researcher
)

# Instantiate your crew
tech_crew = Crew(
  agents=[researcher],
  tasks=[research_task],
  process=Process.sequential  # Tasks will be executed one after the other
)

# Begin the task execution
result = tech_crew.kickoff()

## see raw response
print("=== CREW OUTPUT ===")
print(result.raw)
## Look at `token_usage` output
print("\n=== TOKEN USAGE ===")
print(f"Total tokens: {result.token_usage.total_tokens}")
print(f"Prompt tokens: {result.token_usage.prompt_tokens}")
print(f"Completion tokens: {result.token_usage.completion_tokens}")
print(f"Successful requests: {result.token_usage.successful_requests}")

More Examples

View more examples in our cookbook.