Update README with deployment instructions and API docs
Browse files
README.md
CHANGED
|
@@ -183,19 +183,93 @@ cascade/
|
|
| 183 |
|
| 184 |
```bash
|
| 185 |
# Run tests
|
| 186 |
-
|
| 187 |
|
| 188 |
# Run linting
|
| 189 |
-
|
| 190 |
-
|
|
|
|
|
|
|
| 191 |
|
| 192 |
# Train the classifier
|
| 193 |
-
|
| 194 |
|
| 195 |
# Export to ONNX
|
| 196 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 197 |
```
|
| 198 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 199 |
## Contributing
|
| 200 |
|
| 201 |
Contributions are welcome! Please read our contributing guidelines first.
|
|
|
|
| 183 |
|
| 184 |
```bash
|
| 185 |
# Run tests
|
| 186 |
+
make test
|
| 187 |
|
| 188 |
# Run linting
|
| 189 |
+
make lint
|
| 190 |
+
|
| 191 |
+
# Format code
|
| 192 |
+
make format
|
| 193 |
|
| 194 |
# Train the classifier
|
| 195 |
+
make train
|
| 196 |
|
| 197 |
# Export to ONNX
|
| 198 |
+
make export-onnx
|
| 199 |
+
```
|
| 200 |
+
|
| 201 |
+
## Deployment
|
| 202 |
+
|
| 203 |
+
### Railway (Recommended)
|
| 204 |
+
|
| 205 |
+
Railway offers the easiest deployment with automatic builds:
|
| 206 |
+
|
| 207 |
+
```bash
|
| 208 |
+
# Install Railway CLI
|
| 209 |
+
npm install -g @railway/cli
|
| 210 |
+
|
| 211 |
+
# Login and deploy
|
| 212 |
+
railway login
|
| 213 |
+
railway init
|
| 214 |
+
railway up
|
| 215 |
+
|
| 216 |
+
# Set environment variables in Railway dashboard:
|
| 217 |
+
# - OPENAI_API_KEY
|
| 218 |
+
# - REDIS_URL (add Redis plugin)
|
| 219 |
+
```
|
| 220 |
+
|
| 221 |
+
[](https://railway.app/template/cascade)
|
| 222 |
+
|
| 223 |
+
### Fly.io
|
| 224 |
+
|
| 225 |
+
```bash
|
| 226 |
+
# Install Fly CLI
|
| 227 |
+
curl -L https://fly.io/install.sh | sh
|
| 228 |
+
|
| 229 |
+
# Login and deploy
|
| 230 |
+
fly auth login
|
| 231 |
+
fly launch
|
| 232 |
+
fly secrets set OPENAI_API_KEY=sk-your-key
|
| 233 |
+
fly deploy
|
| 234 |
```
|
| 235 |
|
| 236 |
+
### Render
|
| 237 |
+
|
| 238 |
+
1. Fork this repository
|
| 239 |
+
2. Connect to Render
|
| 240 |
+
3. Use the `render.yaml` blueprint
|
| 241 |
+
4. Set `OPENAI_API_KEY` in environment variables
|
| 242 |
+
|
| 243 |
+
### Docker (Self-hosted)
|
| 244 |
+
|
| 245 |
+
```bash
|
| 246 |
+
# Build and run with docker-compose
|
| 247 |
+
docker-compose up -d
|
| 248 |
+
|
| 249 |
+
# Or build manually
|
| 250 |
+
docker build -t cascade .
|
| 251 |
+
docker run -p 8000:8000 -e OPENAI_API_KEY=sk-xxx cascade
|
| 252 |
+
```
|
| 253 |
+
|
| 254 |
+
### Environment Variables for Production
|
| 255 |
+
|
| 256 |
+
| Variable | Required | Description |
|
| 257 |
+
|----------|----------|-------------|
|
| 258 |
+
| `OPENAI_API_KEY` | Yes | Your OpenAI API key |
|
| 259 |
+
| `REDIS_URL` | No | Redis connection URL (for caching) |
|
| 260 |
+
| `QDRANT_URL` | No | Qdrant URL (for semantic cache) |
|
| 261 |
+
| `PORT` | No | Server port (default: 8000) |
|
| 262 |
+
|
| 263 |
+
## API Endpoints
|
| 264 |
+
|
| 265 |
+
| Endpoint | Method | Description |
|
| 266 |
+
|----------|--------|-------------|
|
| 267 |
+
| `/` | GET | Service info |
|
| 268 |
+
| `/health` | GET | Health check |
|
| 269 |
+
| `/v1/chat/completions` | POST | OpenAI-compatible chat |
|
| 270 |
+
| `/v1/models` | GET | List available models |
|
| 271 |
+
| `/v1/stats` | GET | Usage statistics |
|
| 272 |
+
|
| 273 |
## Contributing
|
| 274 |
|
| 275 |
Contributions are welcome! Please read our contributing guidelines first.
|