Prerequisites
- Node.js 18+
- An Ollama instance (for the 8B model) or RunPod endpoint (for 32B)
Setup
Configure environment
.env with your configuration. See Environment Variables for the full reference.API routes
The gateway exposes these endpoints:| Method | Path | Description |
|---|---|---|
POST | /v1/chat/completions | Chat completion (OpenAI-compatible) |
GET | /v1/models | List models |
GET | /v1/tools | List available tools |
POST | /v1/tools/execute | Execute a tool directly |
GET | /credits/balance | Check credit balance |
POST | /credits/grant | Grant credits (dev only) |
POST | /auth/api-keys | Create an API key |
GET | /health | Health check |
Database
The gateway uses SQLite by default, stored at./data/mako.db. The database manages:
- User accounts (keyed by wallet address)
- API keys (hashed)
- Credit balances and usage logs
DATABASE_PATH to a persistent volume.
Deployment
Railway
The repository includesrailway.json and nixpacks.toml for one-click Railway deployment:
Docker
Build and run with any container platform:Other platforms
The gateway is a standard Express.js app. It works on Render, Heroku, Fly.io, or any Node.js hosting. Just set the environment variables and runnpm start.