{"slug": "lightport-a-maintained-fork-of-portkey-ai-gateway", "title": "Lightport – a maintained fork of Portkey AI gateway", "summary": "Lightport, a maintained fork of Portkey AI Gateway, launches as a lightweight proxy that makes LLM providers OpenAI-compatible by transforming requests and responses. The project focuses solely on compatibility, leaving retries, caching, and rate limiting to higher-level services like Glama. It supports 77 providers and includes bug fixes and integration tests since forking.", "body_md": "A lightweight AI gateway that makes LLM providers OpenAI-compatible.\n\nLightport does one thing: it accepts OpenAI-compatible requests, transforms them for the target provider, and returns the response. That's it.\n\nRetries, secret management, caching, rate limiting, and other operational concerns are explicitly non-goals. Those are better handled either at a service layer above Lightport or as custom middleware.\n\n**Supported endpoints:**\n\n`POST /v1/chat/completions`\n\n`POST /v1/completions`\n\n`POST /v1/responses`\n\n(+ GET, DELETE, input_items)\n\n**Supported providers:** OpenAI, Anthropic, Azure OpenAI, Google Gemini, Vertex AI, Bedrock, Cohere, Mistral, Groq, Deepseek, Together AI, Fireworks, Ollama, and [more](/glama-ai/lightport/blob/main/src/providers) (77 total).\n\nLightport started as a fork of [Portkey AI Gateway](https://github.com/portkey-ai/gateway). Our sole use case for the gateway has always been making AI providers OpenAI-compatible – we only needed the request/response transformation layer.\n\nSince then, Portkey has evolved into a full-featured AI gateway with guardrails, fallbacks, automatic retries, load balancing, request timeouts, smart caching, usage analytics, cost management, and more. We believe those capabilities belong at a higher abstraction level – which is what [Glama](https://glama.ai/ai/gateway) provides – rather than in the gateway itself.\n\nSince forking, we have fixed numerous bugs, added integration tests for every provider, and continue to actively maintain the gateway as it directly powers [Glama](https://glama.ai/ai/gateway).\n\nIf you need a lightweight proxy that makes LLM providers OpenAI-compatible, Lightport is for you. If you need an enterprise gateway with all the bells and whistles, consider [Portkey Gateway](https://github.com/portkey-ai/gateway).\n\n```\npnpx lightport\n```\n\nThe gateway runs on `http://localhost:8787`\n\n.\n\n```\npnpm install\npnpm dev\ncurl http://localhost:8787/v1/chat/completions \\\n  -H \"Content-Type: application/json\" \\\n  -H \"x-lightport-provider: openai\" \\\n  -H \"Authorization: Bearer sk-YOUR-KEY\" \\\n  -d '{\n    \"model\": \"gpt-4o-mini\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"Hello!\"}]\n  }'\n```\n\nSet the provider via `x-lightport-provider`\n\nheader and pass credentials via `Authorization`\n\n(or provider-specific headers like `x-api-key`\n\nfor Anthropic).\n\nSome providers require additional headers:\n\n| Provider | Headers |\n|---|---|\n| Azure OpenAI | `x-lightport-azure-resource-name` , `x-lightport-azure-deployment-id` , `x-lightport-azure-api-version` |\n| Bedrock | `x-lightport-aws-access-key-id` , `x-lightport-aws-secret-access-key` , `x-lightport-aws-region` |\n| Vertex AI | `x-lightport-vertex-project-id` , `x-lightport-vertex-region` |\n| Custom host | `x-lightport-custom-host` |\n\nRoute provider requests through an HTTP proxy by setting the `x-lightport-proxy-url`\n\nheader:\n\n```\ncurl http://localhost:8787/v1/chat/completions \\\n  -H \"Content-Type: application/json\" \\\n  -H \"x-lightport-provider: openai\" \\\n  -H \"x-lightport-proxy-url: http://user:pass@proxy.internal:8080\" \\\n  -H \"Authorization: Bearer sk-YOUR-KEY\" \\\n  -d '{\n    \"model\": \"gpt-4o-mini\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"Hello!\"}]\n  }'\npnpm dev           # Development server with hot reload\npnpm build         # Production build\npnpm start:node    # Start production server\npnpm test          # Run tests\npnpm lint          # Lint code\npnpm format        # Format and auto-fix\npnpm knip          # Find unused code/dependencies\n```\n\nCopy `.env.example`\n\nto `.env`\n\nand fill in API keys for the providers you want to test. Tests automatically load `.env`\n\nand skip providers without credentials.\n\n```\ncp .env.example .env\n# fill in your keys\npnpm test\nphp\nRequest\n  -> bodyParser middleware (parse JSON/FormData)\n  -> requestValidator (require provider header)\n  -> handler (chatCompletions / completions / modelResponses)\n    -> constructConfigFromRequestHeaders()\n    -> tryPost()\n      -> adapter transform (if needed for responses/messages API)\n      -> provider lookup + transformToProviderRequest()\n      -> fetch to provider\n      -> responseHandler() (transform response back)\n    -> Response\n```\n\nThe provider system (`src/providers/`\n\n) contains 77 provider implementations. Each defines:\n\n- API config (base URL, endpoints, headers)\n- Request parameter transforms\n- Response transforms (streaming + non-streaming)", "url": "https://wpnews.pro/news/lightport-a-maintained-fork-of-portkey-ai-gateway", "canonical_source": "https://github.com/glama-ai/lightport", "published_at": "2026-07-17 05:09:56+00:00", "updated_at": "2026-07-17 05:20:58.996118+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "large-language-models", "ai-infrastructure"], "entities": ["Lightport", "Portkey AI Gateway", "Glama", "OpenAI", "Anthropic", "Azure OpenAI", "Google Gemini", "Vertex AI"], "alternates": {"html": "https://wpnews.pro/news/lightport-a-maintained-fork-of-portkey-ai-gateway", "markdown": "https://wpnews.pro/news/lightport-a-maintained-fork-of-portkey-ai-gateway.md", "text": "https://wpnews.pro/news/lightport-a-maintained-fork-of-portkey-ai-gateway.txt", "jsonld": "https://wpnews.pro/news/lightport-a-maintained-fork-of-portkey-ai-gateway.jsonld"}}