{"id":18232778,"url":"https://github.com/ultrasev/llmproxy-vercel","last_synced_at":"2026-02-27T23:43:05.166Z","repository":{"id":258178983,"uuid":"873637140","full_name":"ultrasev/llmproxy-vercel","owner":"ultrasev","description":"通过 vercel 搭建 LLM API 的反向代理 ","archived":false,"fork":false,"pushed_at":"2024-10-30T13:15:01.000Z","size":322,"stargazers_count":47,"open_issues_count":4,"forks_count":42,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-28T05:01:04.040Z","etag":null,"topics":["api","groq","llm","openai","proxy","vercel"],"latest_commit_sha":null,"homepage":"https://llmproxy-vercel.vercel.app","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ultrasev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-10-16T13:53:11.000Z","updated_at":"2025-09-16T12:43:06.000Z","dependencies_parsed_at":"2024-10-24T18:05:59.826Z","dependency_job_id":null,"html_url":"https://github.com/ultrasev/llmproxy-vercel","commit_stats":null,"previous_names":["ultrasev/llmproxy-vercel"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ultrasev/llmproxy-vercel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ultrasev%2Fllmproxy-vercel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ultrasev%2Fllmproxy-vercel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ultrasev%2Fllmproxy-vercel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ultrasev%2Fllmproxy-vercel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ultrasev","download_url":"https://codeload.github.com/ultrasev/llmproxy-vercel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ultrasev%2Fllmproxy-vercel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29919341,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"ssl_error","status_checked_at":"2026-02-27T19:37:41.463Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["api","groq","llm","openai","proxy","vercel"],"created_at":"2024-11-04T14:03:38.539Z","updated_at":"2026-02-27T23:43:05.149Z","avatar_url":"https://github.com/ultrasev.png","language":"Python","funding_links":["https://www.buymeacoffee.com/ultrasev"],"categories":[],"sub_categories":[],"readme":"\u003c!-- todo:\n1. change icon\n2. one-click deploy\n3. support cerebras\n--\u003e\n\n\u003cp align=\"center\"\u003e\n \u003cimg width=\"780px\" src=\"public/flow.png\" align=\"center\" alt=\"Deploy on Vercel\" /\u003e\n \u003ch2 align=\"center\"\u003e LLM API 反向代理 \u003c/h2\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/ultrasev/llmproxy-vercel/issues\"\u003e\n    \u003cimg alt=\"Issues\" src=\"https://img.shields.io/github/issues/ultrasev/llmproxy-vercel?style=flat\u0026color=336791\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/ultrasev/llmproxy-vercel/pulls\"\u003e\n    \u003cimg alt=\"GitHub pull requests\" src=\"https://img.shields.io/github/issues-pr/ultrasev/llmproxy-vercel?style=flat\u0026color=336791\" /\u003e\n  \u003c/a\u003e\n  \u003cbr /\u003e\n\u003c/p\u003e\n\n本项目旨在提供一个反向代理服务，解决在部分国家或地区无法直接访问 Google, Groq, Cerebras（Amazon cloudfront）等平台 API 的问题。\n\n# 功能\n\n通过 Vercel 边缘网络，反向代理 OpenAI、Groq、Google、Cerebras 等平台的 API 请求。\n\n- 支持供应商：Groq、Google、OpenAI、Cerebras、NVIDIA、Mistral、Sambanova\n- 支持流式输出\n- 兼容 OpenAI API 规范\n\n注：大陆不可直接访问 vercel.app 域名。如想直接访问，可参考之前作者的另一个项目[llmproxy](https://github.com/ultrasev/llmproxy)，通过 cloudflare worker 部署 LLM API 反向代理。\n\n# 使用\n部署到 Vercel 后，可使用自己的 API 地址为：https://your-project-name.vercel.app/。\n测试 API 地址：\n- https://llmproxy-vercel.vercel.app/ : 即 vercel 提供的 API 地址，局域网内不能直接访问，需科学上网。\n- https://llm.cufo.cc/ : 作者通过 cloudflare + 美区 VPS 搭建的反向代理，大陆等地区可直接访问，调用路径为 local -\u003e CF(HK) -\u003e VPS(US) -\u003e OpenAI。\n\n两个地址使用时均不需要携带 `/v1` 后缀，即 `base_url=\"https://llm.cufo.cc/openai\"` 或者 `chat_url=\"https://llm.cufo.cc/openai/chat/completions\"`。\n\n## 示例 1： OpenAI\n\n```python\nfrom openai import OpenAI\n\nclient = OpenAI(\n    api_key=\"sk-proj-...\",\n    base_url=\"https://llmproxy-vercel.vercel.app/openai\", # 没有 /v1 后缀\n)\n\nresponse = client.chat.completions.create(\n    model=\"gpt-3.5-turbo\",\n    messages=[{\"role\": \"user\", \"content\": \"Hello world!\"}],\n)\n\nprint(response.choices[0].message.content)\n```\n\n## 示例 2： Google Gemini\n\n```python\nfrom openai import OpenAI\n\nclient = OpenAI(\n    api_key=\"...\",\n    base_url=\"https://llmproxy-vercel.vercel.app/gemini\",\n)\n\nresponse = client.chat.completions.create(\n    model=\"gemini-1.5-flash\",\n    messages=[{\"role\": \"user\", \"content\": \"Hello world!\"}],\n)\n\nprint(response.choices[0].message.content)\n```\n\n## 示例 3： Cerebras\n\n```bash\ncurl --location 'https://llmproxy-vercel.vercel.app/cerebras/chat/completions' \\\n  --header 'Content-Type: application/json' \\\n  --header \"Authorization: Bearer ${CEREBRAS_API_KEY}\" \\\n  --data '{\n    \"model\": \"llama3.1-8b\",\n    \"stream\": false,\n    \"messages\": [{\"content\": \"why is fast inference important?\", \"role\": \"user\"}],\n    \"temperature\": 0,\n    \"max_tokens\": 1024,\n    \"seed\": 0,\n    \"top_p\": 1\n}'\n```\n\n# Vercel 一键部署\n\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fultrasev%2Fllmproxy-vercel)\n\n# 本地开发测试\n\n```bash\npip3 install -r requirements.txt\npip3 install uvicorn\nuvicorn main:app --host 0.0.0.0 --port 3000 --reload\n```\n\n# License\n\nCopyright © 2024 [ultrasev](https://github.com/ultrasev).\u003cbr /\u003e\nThis project is [MIT](LICENSE) licensed.\n\n# Support me\n\n[![\"Buy Me A Coffee\"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/ultrasev)\n\n## Contacts\n\n- [![Twitter Follow](https://img.shields.io/twitter/follow/ultrasev?style=social)](https://twitter.com/slippertopia)\n- [![YouTube Channel Subscribers](https://img.shields.io/youtube/channel/subscribers/UCt0Op8mQvqwjp18B8vNPjzg?style=social)](https://www.youtube.com/channel/UCt0Op8mQvqwjp18B8vNPjzg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fultrasev%2Fllmproxy-vercel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fultrasev%2Fllmproxy-vercel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fultrasev%2Fllmproxy-vercel/lists"}