suna/backend
Marko Kraemer 96cb066b42
Merge pull request #336 from escapade-mckv/feat/ux
Product/UX: Sidebar improvements, model selector, getting list of models from backend
2025-05-16 15:49:51 +02:00
..
.github/workflows fe reference wip 2025-03-29 23:48:57 -07:00
agent Merge pull request #336 from escapade-mckv/feat/ux 2025-05-16 15:49:51 +02:00
agentpress fix(stream): redis latency issue mitigated 2025-05-15 23:28:28 +00:00
sandbox fix: normalize path 2025-05-12 22:09:14 +02:00
services chore(ux): model selector, updated sidebar 2025-05-16 01:52:07 +05:30
supabase fix: policy and share page api error 2025-05-04 15:49:26 +02:00
utils chore(ux): model selector, updated sidebar 2025-05-16 01:52:07 +05:30
.env.example feat(dramatiq): add workers to docker compose and update docs 2025-05-15 06:29:27 +00:00
.gitignore delete user sandboxes script 2025-05-02 15:50:33 +02:00
Dockerfile unlimited requests per worker, deactivate restore_running_agent_runs 2025-05-14 00:15:46 +02:00
MANIFEST.in fe reference wip 2025-03-29 23:48:57 -07:00
README.md feat(dramatiq): add workers to docker compose and update docs 2025-05-15 06:29:27 +00:00
api.py unlimited requests per worker, deactivate restore_running_agent_runs 2025-05-14 00:15:46 +02:00
docker-compose.yml feat(dramatiq): add workers to docker compose and update docs 2025-05-15 06:29:27 +00:00
fly.production.toml logger, docker, wip 2025-04-24 23:04:59 +01:00
fly.staging.toml logger, docker, wip 2025-04-24 23:04:59 +01:00
poetry.lock fix dependency 2025-04-27 04:10:38 +01:00
pyproject.toml Merge pull request #242 from VinciGit00/patch-3 2025-05-08 16:43:02 +02:00
requirements.txt feat(dramatiq): add workers to docker compose and update docs 2025-05-15 06:29:27 +00:00
run_agent_background.py Merge branch 'main' into fix/redis-latency-fix 2025-05-15 23:51:18 +00:00

README.md

Suna Backend

Running the backend

Within the backend directory, run the following command to stop and start the backend:

docker compose down && docker compose up --build

Running Individual Services

You can run individual services from the docker-compose file. This is particularly useful during development:

Running only Redis and RabbitMQ

docker compose up redis rabbitmq

Running only the API and Worker

docker compose up api worker

Development Setup

For local development, you might only need to run Redis and RabbitMQ, while working on the API locally. This is useful when:

  • You're making changes to the API code and want to test them directly
  • You want to avoid rebuilding the API container on every change
  • You're running the API service directly on your machine

To run just Redis and RabbitMQ for development:```bash docker compose up redis rabbitmq


Then you can run your API service locally with your preferred method (e.g., poetry run python3.11 api.py).

### Environment Configuration
When running services individually, make sure to:
1. Check your `.env` file and adjust any necessary environment variables
2. Ensure Redis connection settings match your local setup (default: `localhost:6379`)
3. Ensure RabbitMQ connection settings match your local setup (default: `localhost:5672`)
4. Update any service-specific environment variables if needed

### Important: Redis Host Configuration
When running the API locally with Redis in Docker, you need to set the correct Redis host in your `.env` file:
- For Docker-to-Docker communication (when running both services in Docker): use `REDIS_HOST=redis`
- For local-to-Docker communication (when running API locally): use `REDIS_HOST=localhost`

### Important: RabbitMQ Host Configuration
When running the API locally with Redis in Docker, you need to set the correct RabbitMQ host in your `.env` file:
- For Docker-to-Docker communication (when running both services in Docker): use `RABBITMQ_HOST=rabbitmq`
- For local-to-Docker communication (when running API locally): use `RABBITMQ_HOST=localhost`

Example `.env` configuration for local development:
```env
REDIS_HOST=localhost (instead of 'redis')
REDIS_PORT=6379
REDIS_PASSWORD=

RABBITMQ_HOST=localhost (instead of 'rabbitmq')
RABBITMQ_PORT=5672