Skip to main content

Get Your Adaptive API Key

Sign up here to create an account and generate your API key.

Quick Setup

Installation

pip install crewai crewai-tools

Basic Integration

from crewai import Agent, Task, Crew, LLM

# Configure Adaptive LLM
llm = LLM(
    model="",  # Empty string enables intelligent routing
    api_key="your-adaptive-api-key",
    base_url="https://api.llmadaptive.uk/v1"
)

# Create agents
researcher = Agent(
    role='Researcher',
    goal='Research and gather information',
    backstory='A thorough researcher with attention to detail',
    llm=llm
)

writer = Agent(
    role='Writer',
    goal='Create engaging content based on research',
    backstory='A creative writer who transforms data into stories',
    llm=llm
)

# Define tasks
research_task = Task(
    description='Research the latest trends in AI technology',
    agent=researcher,
    expected_output='A comprehensive report on AI trends'
)

writing_task = Task(
    description='Write an article based on the research findings',
    agent=writer,
    expected_output='A well-written article about AI trends'
)

# Create and run the crew
crew = Crew(
    agents=[researcher, writer],
    tasks=[research_task, writing_task],
    verbose=True
)

result = crew.kickoff()
print(result)

Key Benefits

  • Intelligent routing - Automatic model selection for each agent interaction
  • Cost optimization - 30-70% cost reduction across agent executions
  • Tool support - Adaptive selects function-calling capable models automatically
  • Multi-agent collaboration - Optimized routing for each agent’s specific needs

Next Steps