Skip to main content

Overview

This guide will help you set up and run a basic Hyperbolic AgentKit chatbot that can rent GPU compute, interact with blockchain, and post to Twitter.
Before starting, ensure you have Python 3.12 installed. The framework has not been tested on Windows.

Quick Setup

1

Clone the Repository

git clone https://github.com/HyperbolicLabs/Hyperbolic-AgentKit.git
cd Hyperbolic-AgentKit
2

Install Dependencies

Using Poetry (recommended):
# Install Poetry if you haven't
curl -sSL https://install.python-poetry.org | python3 -

# Set up environment with Python 3.12
poetry env use python3.12
poetry install

# Install Playwright browsers for automation
poetry run playwright install
3

Configure Environment

Copy the example environment file and add your API keys:
cp .env.example .env
nano .env  # or use your preferred editor
Required keys for basic functionality:
.env
# Core API Keys
ANTHROPIC_API_KEY=your_anthropic_api_key
CDP_API_KEY_NAME=your_cdp_api_key_name
CDP_API_KEY_PRIVATE=your_cdp_private_key
HYPERBOLIC_API_KEY=your_hyperbolic_api_key

# Enable core toolkits
USE_COINBASE_TOOLS=true
USE_HYPERBOLIC_TOOLS=true
4

Run the Agent

Start the interactive chat interface:
poetry run python chatbot.py
When prompted:
  • Choose option 1 for interactive chat mode
  • Type n for Twitter knowledge base (optional for now)
  • Type n for Podcast knowledge base (optional for now)
You should see:
Starting Agent...
Initializing LLM...
Loading character configuration...
Starting chat mode... Type 'exit' to end.
User:

Your First Interaction

Try these example prompts to test your agent:
User: What GPUs are available to rent right now?

Understanding the Agent Flow

When you ask the agent to rent a GPU, here’s what happens:
1

GPU Discovery

The agent calls get_available_gpus() to fetch available instances:
# From hyperbolic_agentkit_core/actions/get_available_gpus.py
def get_available_gpus() -> str:
    api_key = get_api_key()
    url = "https://api.hyperbolic.xyz/v1/marketplace"
    headers = {
        "Content-Type": "application/json",
        "Authorization": f"Bearer {api_key}"
    }
    response = requests.post(url, headers=headers, json={"filters": {}})
    # Returns formatted list of GPUs with pricing
2

Instance Selection

The agent analyzes available options and selects based on your requirements (GPU model, availability, price).
3

Rental Execution

The agent calls rent_compute() with the selected parameters:
# From hyperbolic_agentkit_core/actions/rent_compute.py
def rent_compute(cluster_name: str, node_name: str, gpu_count: str) -> str:
    endpoint = "https://api.hyperbolic.xyz/v1/marketplace/instances/create"
    payload = {
        "cluster_name": cluster_name,
        "node_name": node_name,
        "gpu_count": gpu_count
    }
    response = requests.post(endpoint, headers=headers, json=payload)
    return response.json()
4

Confirmation

The agent confirms the rental and provides instance details including SSH access information.

Next Steps

Add Twitter Integration

Enable social media capabilities for your agent

Configure Payment

Set up crypto payments for GPU compute

Customize Character

Define your agent’s personality and behavior

Explore Agent Types

Run with Gradio UI or voice interface

Alternative Interfaces

Gradio Web UI

For a graphical interface:
poetry run python gradio_ui.py
Access at http://localhost:7860

Voice Agent

For a WebSocket-powered voice interface:
PYTHONPATH=$PWD/server/src poetry run python server/src/server/app.py
Access at http://localhost:3000
The voice agent requires OPENAI_API_KEY and only works with GPT-4o Realtime models.

Troubleshooting

Ensure you’re using Python 3.12:
python --version  # Should show Python 3.12.x

# On macOS:
brew install [email protected]

# On Ubuntu:
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.12
Verify your keys are correctly set:
# Check if .env file exists and has the right keys
cat .env | grep API_KEY

# Ensure no trailing spaces or quotes
ANTHROPIC_API_KEY=sk-ant-xxx  # Correct
ANTHROPIC_API_KEY="sk-ant-xxx"  # Wrong
Reinstall Playwright browsers:
poetry run playwright install --force
Check the recursion limit in your config. The agent may need more steps:
# In chatbot.py, increase recursion_limit
runnable_config = RunnableConfig(
    recursion_limit=200,  # Increase if needed
    # ...
)

What You’ve Learned

You now have a working agent that can:
  • Query and rent GPU compute resources
  • Manage blockchain wallets and transactions
  • Execute multi-step reasoning tasks
  • Interact via natural language

Full Installation Guide

Learn about all available features and advanced configuration options

Build docs developers (and LLMs) love