suna安装指北

Requirements

You'll need the following components:

A Supabase project for database and authentication
Redis database for caching and session management
Daytona sandbox for secure agent execution
Python 3.11 for the API backend
API keys for LLM providers (OpenAI or Anthropic)
(Optional but recommended) Tavily API key for enhanced search capabilities

Prerequisites

  1. Supabase:

  2. Redis: Set up a Redis instance using one of these options:

    • Upstash Redis (recommended for cloud deployments)
    • Local installation:
      • Macbrew install redis
      • Linux: Follow distribution-specific instructions
      • Windows: Use WSL2 or Docker
    • Save your Redis connection details for later use
  3. Daytona:

    • Create an account on Daytona
    • Generate an API key from your account settings
    • Go to Images
    • Click "Add Image"
    • Enter adamcohenhillel/kortix-suna:0.0.20 as the image name
    • Set exec /usr/bin/supervisord -n -c /etc/supervisor/conf.d/supervisord.conf as the Entrypoint
  4. LLM API Keys:

    • Obtain an API key from OpenAI or Anthropic
    • While other providers should work via LiteLLM, OpenAI and Anthropic are recommended
  5. Search API Key (可选,但推荐):

  6. RapidAPI API Key (可选,但推荐):

    • To enable API services like LinkedIn, and others, you'll need a RapidAPI key
    • Each service requires individual activation in your RapidAPI account:
      1. Locate the service's base_url in its corresponding file (e.g., "https://linkedin-data-scraper.p.rapidapi.com" in backend/agent/tools/data_providers/LinkedinProvider.py)
      2. Visit that specific API on the RapidAPI marketplace
      3. Subscribe to the service (many offer free tiers with limited requests)
      4. Once subscribed, the service will be available to your agent through the API Services tool

Installation Steps

  1. Clone the repository:
git clone https://github.com/kortix-ai/suna.git
cd suna
  1. Configure backend environment:
cd backend
cp .env.example .env  # Create from example if available, or use the following template

Edit the .env file and fill in your credentials:

NEXT_PUBLIC_URL="http://localhost:3000"

# Supabase credentials from step 1
SUPABASE_URL=your_supabase_url
SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key

# Redis credentials from step 2
REDIS_HOST=your_redis_host
REDIS_PORT=6379
REDIS_PASSWORD=your_redis_password
REDIS_SSL=True  # Set to False for local Redis without SSL

# Daytona credentials from step 3
DAYTONA_API_KEY=your_daytona_api_key
DAYTONA_SERVER_URL="https://app.daytona.io/api"
DAYTONA_TARGET="us"

# Anthropic or OpenAI: 
# Anthropic
ANTHROPIC_API_KEY=
MODEL_TO_USE="anthropic/claude-3-7-sonnet-latest"

# OR OpenAI API:
OPENAI_API_KEY=your_openai_api_key
MODEL_TO_USE="gpt-4o"

# Optional but recommended
TAVILY_API_KEY=your_tavily_api_key  # Optional
RAPID_API_KEY=
  1. Set up Supabase database:
# Login to Supabase CLI
supabase login

# Link to your project (find your project reference in the Supabase dashboard)
supabase link --project-ref your_project_reference_id

# Push database migrations
supabase db push
  1. Configure frontend environment:
cd ../frontend
cp .env.example .env.local  # Create from example if available, or use the following template

Edit the .env.local file:

NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
NEXT_PUBLIC_BACKEND_URL="http://localhost:8000/api"
NEXT_PUBLIC_URL="http://localhost:3000"
  1. Install dependencies:
# Install frontend dependencies
cd frontend
npm install

# Install backend dependencies
cd ../backend
pip install -r requirements.txt
  1. Start the application:

    In one terminal, start the frontend:

cd frontend
npm run dev

In another terminal, start the backend:

cd backend
python api.py
  1. Access Suna:
    • Open your browser and navigate to http://localhost:3000
    • Sign up for an account using the Supabase authentication
    • Start using your self-hosted Suna instance!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

非ban必选

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值