Initial proxy artifact

This commit is contained in:
hwhung
2026-05-07 19:13:04 +08:00
commit 8c68a30044
20 changed files with 1309 additions and 0 deletions
+59
View File
@@ -0,0 +1,59 @@
# Workspace
## Overview
Standalone TypeScript API server packaged as a Replit `kind = "web"` artifact.
## Stack
- **Node.js version**: 24
- **Package manager**: pnpm
- **TypeScript version**: 5.9
- **API framework**: Express 5
- **Build**: esbuild
## Provider Endpoints
Use Replit AI Integrations endpoints. The app reads these environment variables automatically:
- `AI_INTEGRATIONS_OPENAI_BASE_URL`
- `AI_INTEGRATIONS_OPENAI_API_KEY`
- `AI_INTEGRATIONS_ANTHROPIC_BASE_URL`
- `AI_INTEGRATIONS_ANTHROPIC_API_KEY`
CLI flags are still available for manual overrides:
- `--openai-base-url`
- `--openai-api-key`
- `--anthropic-base-url`
- `--anthropic-api-key`
Never use public official provider endpoints.
## Key Commands
- `pnpm install --ignore-workspace` — install dependencies without joining a parent workspace
- `pnpm prod` — build and run API server locally on port `3000`
- `pnpm run typecheck` — typecheck the server
- `pnpm run build` — typecheck and build `dist/index.mjs`
- `pnpm run build:fast` — build `dist/index.mjs` without typechecking
- `pnpm start` — run the built server
## Replit Configuration
- `.replit` `run` uses `pnpm prod`
- `.replit` `onBoot` uses `pnpm install --ignore-workspace`
- `.replit-artifact/artifact.toml` marks this repo as a publishable `kind = "web"` artifact
## Server Overrides
- `--host` or `HOST`
- `--port` or `PORT`
- `--proxy-api-key` or `PROXY_API_KEY`
## Routes
- `/` and `/dashboard` — static model dashboard
- `/api/healthz` — health check
- `/v1/models` — OpenAI-compatible model list
- `/v1/chat/completions` — OpenAI-compatible chat proxy