{"id":26186549,"url":"https://github.com/ckt1031/llm-relay","last_synced_at":"2025-03-11T23:22:33.645Z","repository":{"id":281597353,"uuid":"941556071","full_name":"ckt1031/llm-relay","owner":"ckt1031","description":"Unifies your LLM API into single one, easy and fast.","archived":false,"fork":false,"pushed_at":"2025-03-10T05:57:21.000Z","size":531,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-10T06:24:28.830Z","etag":null,"topics":["ai","api","llm","llm-inference","openai","openai-api","serverless","vercel"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ckt1031.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-02T15:18:37.000Z","updated_at":"2025-03-10T05:57:24.000Z","dependencies_parsed_at":"2025-03-10T06:24:36.951Z","dependency_job_id":"5f6d5b60-eca2-4b3c-9bb7-9ea6e7f0b5d1","html_url":"https://github.com/ckt1031/llm-relay","commit_stats":null,"previous_names":["ckt1031/llm-relay"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ckt1031%2Fllm-relay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ckt1031%2Fllm-relay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ckt1031%2Fllm-relay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ckt1031%2Fllm-relay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ckt1031","download_url":"https://codeload.github.com/ckt1031/llm-relay/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243126723,"owners_count":20240478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","api","llm","llm-inference","openai","openai-api","serverless","vercel"],"created_at":"2025-03-11T23:22:33.223Z","updated_at":"2025-03-11T23:22:33.636Z","avatar_url":"https://github.com/ckt1031.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LLM Relay API\n\nThis is a OpenAI API relay server, which can be used to relay requests to multiple providers.\n\nThe project supports serverless deployment on Vercel.\n\n## Installation\n\n```bash\nbun install\n```\n\n## Usage of API\n\n```bash\nbun run dev\nbun run deploy # Deploy to Vercel\n```\n\n## CLI Tool (`helper.ts`)\n\nThis helper tool helps manage the `api.json` configuration file, allowing you to add user API keys, add providers, add keys to existing providers, add models to existing providers, and modify provider settings.\n\n### Usage\n\nTo run the helper tool, use the following command:\n\n```bash\nbun run helper\n```\n\nThis will start an interactive menu in your terminal, guiding you through the available options:\n\n1. **Add User API Key**: Generates and adds a new user API key to the configuration.\n2. **Add Provider**: Adds a new provider to the configuration, prompting for the provider's name, base URL, models, and keys.\n3. **Add Key to Existing Provider**: Adds a new API key to an existing provider.\n4. **Add Model to Existing Provider**: Adds a new model to an existing provider.\n5. **Modify Provider Settings**: Modifies the settings of an existing provider, such as the name, base URL, and Azure-specific settings.\n\n## File `api.json` Format\n\nMake sure all provider supports OpenAI API format.\n\nThe file is located in `./data/api.json`, make sure to create it if it doesn't exist, and keep it secure.\n\n```json\n{\n    \"userKeys\": [\n        {\n            \"name\": \"Test\",\n            \"key\": \"sk-123456\" // User key, generated locally\n        }\n    ],\n    \"providers\": {\n        // Azure\n        \"azure\": {\n            \"name\": \"Azure OpenAI\",\n            \"azure\": true, // Required for Azure providers\n            \"azureAPIVersion\": \"2024-10-21\", // Azure API version\n            \"baseURL\": \"https://azure-openai.azure-api.net/v1\",\n            \"models\": [\"gpt-4o\", \"gpt-4o-mini\"],\n            \"keys\": [\"123456\"]\n        },\n        // Google provider\n        \"google-genai\": {\n            \"name\": \"Google GenAI\",\n            \"baseURL\": \"https://generativelanguage.googleapis.com/v1beta/openai\",\n            \"models\": [\n                // 2 Types: Object (Need casting), String (Direct)\n                {\n                    \"request\": \"gpt-4o-mini\", // Model name from request to be casted\n                    \"destination\": \"openai/gpt-4o-mini\" // Model name sent to provider\n                },\n                \"gemini-1.5-flash-latest\", // Direct model name, without casting\n            ],\n            \"keys\": [\n                // User provided\n                \"AIzaSyB1234567890\" // Provider key, which sends requests to the provider\n            ]\n        }\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fckt1031%2Fllm-relay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fckt1031%2Fllm-relay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fckt1031%2Fllm-relay/lists"}