An open-source AI platform built with a Rust/Axum backend and a SvelteKit frontend.
🌐 Website: codepystack.github.io/cortex
🤝 Contributing: see CONTRIBUTING.md
cortex/
├── backend/ # Rust + Axum REST API
└── frontend/ # SvelteKit + Tailwind CSS chat UI
| Method | Path | Description |
|---|---|---|
| GET | /health |
Health check |
| GET | /v1/models |
List available models |
| POST | /v1/chat/completions |
OpenAI-compatible chat completions (streaming + non-streaming) |
| POST | /v1/auth/register |
Register a new user |
| POST | /v1/auth/login |
Login and receive JWT |
| GET | /v1/auth/me |
Get current user info (requires Authorization: Bearer <token>) |
cd backend
cp .env.example .env
# Edit .env to add your provider API keys (optional)
cargo run
# Server listens on http://localhost:8080
| Variable | Default | Description |
|---|---|---|
HOST |
0.0.0.0 |
Bind address |
PORT |
8080 |
Bind port |
JWT_SECRET |
(dev value) | Secret used to sign JWTs — change in production |
OPENAI_API_KEY |
(empty) | OpenAI API key (enables GPT models) |
ANTHROPIC_API_KEY |
(empty) | Anthropic API key (enables Claude models) |
CORS_ORIGINS |
http://localhost:3000 |
Comma-separated list of allowed CORS origins |
cd backend
cargo test
| Model ID | Provider | Notes |
|---|---|---|
cortex-echo |
local | Always available; echoes your input back (great for demos) |
gpt-4o, gpt-4o-mini, … |
OpenAI | Requires OPENAI_API_KEY |
claude-3-5-sonnet-*, … |
Anthropic | Requires ANTHROPIC_API_KEY |
cd frontend
echo "VITE_API_URL=http://localhost:8080" > .env
npm install
npm run dev
# UI available at http://localhost:3000
| Variable | Default | Description |
|---|---|---|
VITE_API_URL |
http://localhost:8080 |
Backend base URL |
localStorage/v1/modelsreact-markdown + GFMdark: classes, follows OS preferenceContributions are welcome! Please read CONTRIBUTING.md for guidelines on how to get started, report bugs, suggest features, and submit pull requests.
This project is licensed under the MIT License.