Skip to main content
Use Cohere models with Hypertic agent.

Installation

Install the Cohere package:
pip install hypertic[cohere]

Setup

Set your Cohere API key as an environment variable:
export COHERE_API_KEY=...

Initialize Model

Create a Cohere model instance:
from hypertic.models import Cohere

model = Cohere(
    model="command-a-03-2025",
    api_key="your-api-key",
)

Use with Agent

Pass the model to your agent:
from hypertic.agents import Agent
from hypertic.models import Cohere
import os

model = Cohere(
    model="command-a-03-2025",
    api_key=os.getenv("COHERE_API_KEY"),
)
agent = Agent(
    model=model,
    tools=[get_weather],
)

response = agent.run("What's the weather in SF?")
print(response.content)

Configuration Options

Supported parameters for Cohere models:
from hypertic.models import Cohere
import os

model = Cohere(
    model="command-a-03-2025",
    api_key=os.getenv("COHERE_API_KEY"),
    temperature=0.7,
    max_tokens=1000,
)
For the full list of available models and parameters, see the Cohere API documentation.