> ## Documentation Index
> Fetch the complete documentation index at: https://docs.deepmako.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Environment Variables

> Complete reference for all gateway configuration options.

## Required

| Variable         | Description                     | Example                           |
| ---------------- | ------------------------------- | --------------------------------- |
| `MODEL_HOST_URL` | Ollama API URL for the 8B model | `http://localhost:11434/api/chat` |
| `MODEL_NAME`     | Model name/path for Ollama      | `mako`                            |

## Hugging Face Inference Endpoints (optional)

Set both to enable the 32B Conductor model via Hugging Face Inference Endpoints. When set, `model: "conductor"` requests are routed to the HF endpoint.

| Variable             | Description               | Example                                                 |
| -------------------- | ------------------------- | ------------------------------------------------------- |
| `RUNPOD_ENDPOINT_ID` | HF Inference Endpoint URL | `https://xyz.us-east-1.aws.endpoints.huggingface.cloud` |
| `RUNPOD_API_KEY`     | Hugging Face API token    | `hf_xxxxxxxx`                                           |

## Server

| Variable   | Default       | Description                             |
| ---------- | ------------- | --------------------------------------- |
| `PORT`     | `3000`        | HTTP port for the gateway server        |
| `NODE_ENV` | `development` | Set to `production` for production mode |

## Authentication

| Variable         | Default    | Description                                             |
| ---------------- | ---------- | ------------------------------------------------------- |
| `FREE_MODE`      | `false`    | When `"true"`, disables auth and credit checks entirely |
| `JWT_SECRET`     | —          | Secret for JWT token signing                            |
| `API_KEY_PREFIX` | `mako_sk_` | Prefix for generated API keys                           |

## Credits

| Variable             | Default | Description                             |
| -------------------- | ------- | --------------------------------------- |
| `CREDIT_COST_INPUT`  | `1`     | Credits charged per 1,000 input tokens  |
| `CREDIT_COST_OUTPUT` | `2`     | Credits charged per 1,000 output tokens |

## Database

| Variable        | Default          | Description                      |
| --------------- | ---------------- | -------------------------------- |
| `DATABASE_PATH` | `./data/mako.db` | Path to the SQLite database file |

For production deployments, point this to a persistent volume.

## Chain configuration

| Variable        | Default                    | Description                                          |
| --------------- | -------------------------- | ---------------------------------------------------- |
| `CHAIN_RPC_URL` | `https://sepolia.base.org` | Primary chain RPC URL                                |
| `CHAIN_ID`      | `84532`                    | Chain ID (84532 = Base Sepolia, 8453 = Base mainnet) |

## External APIs

| Variable            | Default | Description                                                            |
| ------------------- | ------- | ---------------------------------------------------------------------- |
| `FIRECRAWL_API_KEY` | —       | Firecrawl API key for web search. Falls back to DuckDuckGo if not set. |

## Contract addresses

| Variable               | Description                                             |
| ---------------------- | ------------------------------------------------------- |
| `MAKO_TOKEN_ADDRESS`   | \$MAKO token contract address                           |
| `MAKO_GATEWAY_ADDRESS` | Gateway contract address (for on-chain credit deposits) |

## Example `.env`

```env theme={null}
# Server
PORT=3000
NODE_ENV=production

# Model (Ollama)
MODEL_HOST_URL=http://localhost:11434/api/chat
MODEL_NAME=mako

# Hugging Face (32B)
RUNPOD_ENDPOINT_ID=your_hf_endpoint_url
RUNPOD_API_KEY=your_hf_api_token

# Auth
FREE_MODE=true
JWT_SECRET=your-secret-here

# Credits
CREDIT_COST_INPUT=1
CREDIT_COST_OUTPUT=2

# Database
DATABASE_PATH=/data/mako.db

# Chain
CHAIN_RPC_URL=https://mainnet.base.org
CHAIN_ID=8453

# External
FIRECRAWL_API_KEY=fc-your-key-here
```
