HTTP server providing OpenAI API compatibility for LLM Gateway. - OpenAI client SDK drop-in replacement (baseURL only change) - POST /v1/chat/completions endpoint with streaming support - GET /v1/models for client library discovery - Automatic model mapping: gpt-4 → qwen2.5:32b, etc. - Server-Sent Events (SSE) streaming implementation - Full TypeScript types and comprehensive test suite - Graceful shutdown handling (SIGTERM/SIGINT) - Health check endpoint with gateway status - Performance: Same as gateway (100-500ms with fallback to Ollama)
37 lines
747 B
JSON
37 lines
747 B
JSON
{
|
|
"name": "@llm-gateway/chatgpt-api-adapter",
|
|
"version": "1.0.0",
|
|
"description": "OpenAI API compatibility adapter for LLM Gateway",
|
|
"type": "module",
|
|
"main": "dist/index.js",
|
|
"bin": {
|
|
"chatgpt-api": "dist/cli.js"
|
|
},
|
|
"scripts": {
|
|
"build": "tsc",
|
|
"dev": "tsc --watch",
|
|
"start": "node dist/cli.js",
|
|
"test": "vitest"
|
|
},
|
|
"dependencies": {
|
|
"@llm-gateway/client": "workspace:*",
|
|
"fastify": "^5.3.0",
|
|
"@fastify/cors": "^9.0.0"
|
|
},
|
|
"devDependencies": {
|
|
"@types/node": "^20.0.0",
|
|
"typescript": "^5.0.0",
|
|
"vitest": "^1.0.0"
|
|
},
|
|
"keywords": [
|
|
"openai",
|
|
"api",
|
|
"compatibility",
|
|
"llm",
|
|
"gateway",
|
|
"chatgpt"
|
|
],
|
|
"license": "MIT",
|
|
"author": "Rene Fichtmueller"
|
|
}
|