{"owner":"Portkey-AI","repo":"gateway","hasSkills":true,"hasMcp":false,"mcpConfig":null,"found":["CLAUDE.md"],"skills":{"CLAUDE.md":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Project Overview\n\nThis is the **Portkey AI Gateway** - a fast, reliable AI gateway that routes requests to 250+ LLMs with sub-1ms latency. It's built with Hono framework for TypeScript/JavaScript and can be deployed to multiple environments including Cloudflare Workers, Node.js servers, and Docker containers.\n\n## Development Commands\n\n### Core Development\n- `npm run dev` - Start development server using Wrangler (Cloudflare Workers)\n- `npm run dev:node` - Start development server using Node.js\n- `npm run build` - Build the project for production\n- `npm run build-plugins` - Build the plugin system\n\n### Testing\n- `npm run test:gateway` - Run tests for the main gateway code (src/)\n- `npm run test:plugins` - Run tests for plugins\n- `jest src/` - Run specific gateway tests\n- `jest plugins/` - Run specific plugin tests\n\n### Code Quality\n- `npm run format` - Format code with Prettier\n- `npm run format:check` - Check code formatting\n- `npm run pretty` - Alternative format command\n\n### Deployment\n- `npm run deploy` - Deploy to Cloudflare Workers\n- `npm run start:node` - Start production Node.js server\n\n## Architecture\n\n### Core Components\n\n**Main Application (`src/index.ts`)**\n- Hono-based HTTP server with middleware pipeline\n- Handles multiple AI provider integrations\n- Routes: `/v1/chat/completions`, `/v1/completions`, `/v1/embeddings`, etc.\n\n**Provider System (`src/providers/`)**\n- Modular provider implementations (OpenAI, Anthropic, Azure, etc.)\n- Each provider has standardized interface: `api.ts`, `chatComplete.ts`, `embed.ts`\n- Provider configs define supported features and transformations\n\n**Middleware Pipeline**\n- `requestValidator` - Validates incoming requests\n- `hooks` - Pre/post request hooks\n- `memoryCache` - Response caching\n- `logger` - Request/response logging\n- `adminAuth` - Node-only local UI session auth for `/public/*` login endpoints and `/log/stream`\n- `portkey` - Core Portkey-specific middleware for routing, guardrails, etc.\n\n**Plugin System (`plugins/`)**\n- Guardrail plugins for content filtering, PII detection, etc.\n- Each plugin has `manifest.json` defining capabilities\n- Plugins are built separately with `npm run build-plugins`\n\n### Key Concepts\n\n**Configs** - JSON configurations that define:\n- Provider routing and fallbacks\n- Load balancing strategies\n- Guardrails and content filtering\n- Caching and retry policies\n\n**Handlers** - Route-specific request processors in `src/handlers/`\n- Each AI API endpoint has dedicated handler\n- Stream handling for real-time responses\n- WebSocket support for realtime APIs\n\n## File Structure\n\n- `src/providers/` - AI provider integrations\n- `src/handlers/` - API endpoint handlers\n- `src/middlewares/` - Request/response middleware\n- `plugins/` - Guardrail and validation plugins\n- `cookbook/` - Example integrations and use cases\n- `conf.json` - Runtime configuration\n\n## Testing Strategy\n\nTests are organized by component:\n- `src/tests/` - Core gateway functionality tests\n- `src/handlers/__tests__/` - Handler-specific tests\n- `plugins/*/**.test.ts` - Plugin tests\n- Test timeout: 30 seconds (configured in jest.config.js)\n\n## Configuration\n\nThe gateway uses `conf.json` for runtime configuration. Sample config available in `conf_sample.json`.\n\nFor local UI hardening, set `admin_token` in `conf.json`. The `/public` UI uses this token to establish an in-memory admin session, and `/log/stream` requires that session.\n\nKey environment variables and configuration handled through Hono's adapter system for multi-environment deployment."},"files":{"CLAUDE.md":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Project Overview\n\nThis is the **Portkey AI Gateway** - a fast, reliable AI gateway that routes requests to 250+ LLMs with sub-1ms latency. It's built with Hono framework for TypeScript/JavaScript and can be deployed to multiple environments including Cloudflare Workers, Node.js servers, and Docker containers.\n\n## Development Commands\n\n### Core Development\n- `npm run dev` - Start development server using Wrangler (Cloudflare Workers)\n- `npm run dev:node` - Start development server using Node.js\n- `npm run build` - Build the project for production\n- `npm run build-plugins` - Build the plugin system\n\n### Testing\n- `npm run test:gateway` - Run tests for the main gateway code (src/)\n- `npm run test:plugins` - Run tests for plugins\n- `jest src/` - Run specific gateway tests\n- `jest plugins/` - Run specific plugin tests\n\n### Code Quality\n- `npm run format` - Format code with Prettier\n- `npm run format:check` - Check code formatting\n- `npm run pretty` - Alternative format command\n\n### Deployment\n- `npm run deploy` - Deploy to Cloudflare Workers\n- `npm run start:node` - Start production Node.js server\n\n## Architecture\n\n### Core Components\n\n**Main Application (`src/index.ts`)**\n- Hono-based HTTP server with middleware pipeline\n- Handles multiple AI provider integrations\n- Routes: `/v1/chat/completions`, `/v1/completions`, `/v1/embeddings`, etc.\n\n**Provider System (`src/providers/`)**\n- Modular provider implementations (OpenAI, Anthropic, Azure, etc.)\n- Each provider has standardized interface: `api.ts`, `chatComplete.ts`, `embed.ts`\n- Provider configs define supported features and transformations\n\n**Middleware Pipeline**\n- `requestValidator` - Validates incoming requests\n- `hooks` - Pre/post request hooks\n- `memoryCache` - Response caching\n- `logger` - Request/response logging\n- `adminAuth` - Node-only local UI session auth for `/public/*` login endpoints and `/log/stream`\n- `portkey` - Core Portkey-specific middleware for routing, guardrails, etc.\n\n**Plugin System (`plugins/`)**\n- Guardrail plugins for content filtering, PII detection, etc.\n- Each plugin has `manifest.json` defining capabilities\n- Plugins are built separately with `npm run build-plugins`\n\n### Key Concepts\n\n**Configs** - JSON configurations that define:\n- Provider routing and fallbacks\n- Load balancing strategies\n- Guardrails and content filtering\n- Caching and retry policies\n\n**Handlers** - Route-specific request processors in `src/handlers/`\n- Each AI API endpoint has dedicated handler\n- Stream handling for real-time responses\n- WebSocket support for realtime APIs\n\n## File Structure\n\n- `src/providers/` - AI provider integrations\n- `src/handlers/` - API endpoint handlers\n- `src/middlewares/` - Request/response middleware\n- `plugins/` - Guardrail and validation plugins\n- `cookbook/` - Example integrations and use cases\n- `conf.json` - Runtime configuration\n\n## Testing Strategy\n\nTests are organized by component:\n- `src/tests/` - Core gateway functionality tests\n- `src/handlers/__tests__/` - Handler-specific tests\n- `plugins/*/**.test.ts` - Plugin tests\n- Test timeout: 30 seconds (configured in jest.config.js)\n\n## Configuration\n\nThe gateway uses `conf.json` for runtime configuration. Sample config available in `conf_sample.json`.\n\nFor local UI hardening, set `admin_token` in `conf.json`. The `/public` UI uses this token to establish an in-memory admin session, and `/log/stream` requires that session.\n\nKey environment variables and configuration handled through Hono's adapter system for multi-environment deployment."},"items":[{"name":"CLAUDE.md","path":"CLAUDE.md","title":"CLAUDE.md","content":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Project Overview\n\nThis is the **Portkey AI Gateway** - a fast, reliable AI gateway that routes requests to 250+ LLMs with sub-1ms latency. It's built with Hono framework for TypeScript/JavaScript and can be deployed to multiple environments including Cloudflare Workers, Node.js servers, and Docker containers.\n\n## Development Commands\n\n### Core Development\n- `npm run dev` - Start development server using Wrangler (Cloudflare Workers)\n- `npm run dev:node` - Start development server using Node.js\n- `npm run build` - Build the project for production\n- `npm run build-plugins` - Build the plugin system\n\n### Testing\n- `npm run test:gateway` - Run tests for the main gateway code (src/)\n- `npm run test:plugins` - Run tests for plugins\n- `jest src/` - Run specific gateway tests\n- `jest plugins/` - Run specific plugin tests\n\n### Code Quality\n- `npm run format` - Format code with Prettier\n- `npm run format:check` - Check code formatting\n- `npm run pretty` - Alternative format command\n\n### Deployment\n- `npm run deploy` - Deploy to Cloudflare Workers\n- `npm run start:node` - Start production Node.js server\n\n## Architecture\n\n### Core Components\n\n**Main Application (`src/index.ts`)**\n- Hono-based HTTP server with middleware pipeline\n- Handles multiple AI provider integrations\n- Routes: `/v1/chat/completions`, `/v1/completions`, `/v1/embeddings`, etc.\n\n**Provider System (`src/providers/`)**\n- Modular provider implementations (OpenAI, Anthropic, Azure, etc.)\n- Each provider has standardized interface: `api.ts`, `chatComplete.ts`, `embed.ts`\n- Provider configs define supported features and transformations\n\n**Middleware Pipeline**\n- `requestValidator` - Validates incoming requests\n- `hooks` - Pre/post request hooks\n- `memoryCache` - Response caching\n- `logger` - Request/response logging\n- `adminAuth` - Node-only local UI session auth for `/public/*` login endpoints and `/log/stream`\n- `portkey` - Core Portkey-specific middleware for routing, guardrails, etc.\n\n**Plugin System (`plugins/`)**\n- Guardrail plugins for content filtering, PII detection, etc.\n- Each plugin has `manifest.json` defining capabilities\n- Plugins are built separately with `npm run build-plugins`\n\n### Key Concepts\n\n**Configs** - JSON configurations that define:\n- Provider routing and fallbacks\n- Load balancing strategies\n- Guardrails and content filtering\n- Caching and retry policies\n\n**Handlers** - Route-specific request processors in `src/handlers/`\n- Each AI API endpoint has dedicated handler\n- Stream handling for real-time responses\n- WebSocket support for realtime APIs\n\n## File Structure\n\n- `src/providers/` - AI provider integrations\n- `src/handlers/` - API endpoint handlers\n- `src/middlewares/` - Request/response middleware\n- `plugins/` - Guardrail and validation plugins\n- `cookbook/` - Example integrations and use cases\n- `conf.json` - Runtime configuration\n\n## Testing Strategy\n\nTests are organized by component:\n- `src/tests/` - Core gateway functionality tests\n- `src/handlers/__tests__/` - Handler-specific tests\n- `plugins/*/**.test.ts` - Plugin tests\n- Test timeout: 30 seconds (configured in jest.config.js)\n\n## Configuration\n\nThe gateway uses `conf.json` for runtime configuration. Sample config available in `conf_sample.json`.\n\nFor local UI hardening, set `admin_token` in `conf.json`. The `/public` UI uses this token to establish an in-memory admin session, and `/log/stream` requires that session.\n\nKey environment variables and configuration handled through Hono's adapter system for multi-environment deployment.","category":"root","tokens":914}]}