System Requirements
Hardware
- CPU: 2+ cores recommended
- RAM: 4GB minimum, 8GB recommended
- Storage: 10GB+ for database and logs
Software
- Operating System: Linux, macOS, or WSL2 on Windows
- Bun: >= 1.1 (required)
- Node.js: >= 18 (for compatibility)
- PostgreSQL: >= 15
- Git: For cloning the repository
Step 1: Install Prerequisites
Install Bun
Bun is required as both the package manager and JavaScript runtime.After installation, add Bun to your PATH:Add this line to your
~/.bashrc, ~/.zshrc, or shell config file to make it permanent.If you encounter permission errors, ensure your user has write access to
~/.bun/bin.Install PostgreSQL
PostgreSQL is used for persistent storage of trades, positions, and analytics.
Create Database
Create a dedicated database for Autonome:Replace
your_secure_password with a strong password. You’ll use this in your DATABASE_URL configuration.Step 2: Clone and Install Autonome
Install Dependencies
Use Bun to install all project dependencies:This will:
- Install all npm packages defined in
package.json - Set up TypeScript, Vite, and build tooling
- Install AI SDK providers and trading integrations
- Configure Drizzle ORM and database drivers
Step 3: Environment Configuration
Autonome uses T3 Env for type-safe environment configuration. All variables are validated at runtime.Configure AI Providers
Autonome supports multiple AI providers. Configure at least one:
NVIDIA NIM (Recommended)
.env
OpenRouter
.env
AIHubMix
.env
Mistral AI
.env
The platform automatically cycles through available API keys to distribute requests and avoid rate limits. Configure multiple keys per provider for better throughput.
Step 4: Database Setup
Generate Migrations
After schema changes (or initial setup), generate migration files:This reads
src/db/schema.ts and creates SQL migration files in ./drizzle/.Apply Migrations
Apply migrations to your database:This executes all pending migrations and sets up your database schema:
"Models"- AI model configurations"Orders"- Trade orders and positions"PortfolioSnapshots"- Historical portfolio values- Other analytics and tracking tables
Seed Initial Data
Populate the database with default AI model variants:This creates four default trading strategies:
| Variant | Strategy | Risk Profile |
|---|---|---|
| Apex | Aggressive momentum | High risk, high reward |
| Trendsurfer | Trend-following | Medium risk |
| Contrarian | Counter-trend | Medium-high risk |
| Sovereign | Balanced multi-factor | Moderate risk |
You can re-run the seed script anytime to reset your database to default state. This will clear all existing data.
Step 5: Start the Application
Development Mode
For local development, start both the API server and frontend:The application will be available at:
- Frontend: http://localhost:5173
- API Server: http://localhost:8081
Deployment Architecture
Autonome is designed as a split deployment:Frontend (Vercel)
- Location:
src/directory - Framework: TanStack Start (React 19)
- Build Command:
bun run build - Output: Static SPA with SSR capabilities
- Environment: Configure
VITE_*prefixed variables
Backend (VPS/Container)
- Location:
api/src/index.ts - Framework: Hono API server
- Build Command:
bun run build:api - Start Command:
bun run start:api - Port: 8081 (configurable via
PORTenv var)
Communication
- Frontend calls backend via oRPC over HTTP
- Development: Vite proxies
/api/*to API server - Production: Frontend uses
VITE_API_URLto reach API
Environment Variables Reference
Complete reference of all environment variables:Required Variables
| Variable | Description | Example |
|---|---|---|
DATABASE_URL | PostgreSQL connection string | postgres://user:pass@host:5432/db |
TRADING_MODE | Trading mode (simulated or live) | simulated |
Server Configuration
| Variable | Description | Default |
|---|---|---|
PORT | API server port | 8081 |
SERVER_URL | Public server URL | http://localhost:3000 |
CORS_ORIGINS | Allowed frontend origins | “ |
API_URL | Internal API URL | http://localhost:8081 |
Simulator Configuration
| Variable | Description | Default |
|---|---|---|
SIM_INITIAL_CAPITAL | Starting capital | 10000 |
SIM_QUOTE_CURRENCY | Quote currency | USDT |
SIM_REFRESH_INTERVAL_MS | Price refresh interval | 10000 |
AI Provider Keys
| Variable | Description |
|---|---|
NIM_API_KEY | NVIDIA NIM primary key |
NIM_API_KEY1-3 | Additional NIM keys |
OPENROUTER_API_KEY | OpenRouter primary key |
OPENROUTER_API_KEY1 | Additional OpenRouter key |
AIHUBMIX_API_KEY | AIHubMix primary key |
AIHUBMIX_API_KEY1-5 | Additional AIHubMix keys |
MISTRAL_API_KEY | Mistral AI key |
Lighter API (Live Trading)
| Variable | Description | Default |
|---|---|---|
LIGHTER_API_KEY_INDEX | API key slot | 2 |
LIGHTER_BASE_URL | Lighter endpoint | https://mainnet.zklighter.elliot.ai |
Optional Integrations
| Variable | Description |
|---|---|
TAAPI_API_KEY | TAAPI.io technical analysis |
VITE_APP_TITLE | Custom UI title |
Client-Side Variables
Variables prefixed withVITE_ are exposed to the browser:
| Variable | Description |
|---|---|
VITE_API_URL | API URL for frontend |
VITE_APP_TITLE | Application title |
Verification
After installation, verify everything is working:Common Issues
DATABASE_URL connection refused
DATABASE_URL connection refused
Symptoms:
ECONNREFUSED or Connection refused errorsSolutions:-
Verify PostgreSQL is running:
-
Check PostgreSQL is listening on correct port:
-
Verify connection string format:
-
Test connection manually:
Bun command not found
Bun command not found
Symptoms:
bun: command not foundSolutions:-
Reinstall Bun:
-
Add to PATH:
-
Reload shell:
Port already in use
Port already in use
Symptoms:
EADDRINUSE: address already in useSolutions:-
Change port in
.env: -
Kill process using port:
-
Use different port range:
Migration errors
Migration errors
Symptoms: Drizzle migration failuresSolutions:
-
Ensure database exists:
-
Check database permissions:
-
Reset migrations (development only):
Environment variable errors
Environment variable errors
Symptoms:
Invalid environment variables or validation errorsSolutions:-
Check
.envfile exists: -
Validate required variables are set:
-
Ensure no trailing spaces or quotes:
-
Restart server after changing
.env
Next Steps
Quickstart Guide
Get your first trading bot running in minutes
Configuration
Customize AI models, risk parameters, and strategies
Architecture
Understand the system design and data flow
API Reference
Explore oRPC procedures and integrations
Additional Resources
- Database Schema: See
src/db/schema.tsfor complete data model - Environment Validation: Check
src/env.tsfor all validated variables - Commands Reference: Run
bun runto list all available scripts - Drizzle Kit: Use
bunx drizzle-kit --helpfor database utilities

