{"id":21803048,"url":"https://github.com/litongjava/go-llm-proxy","last_synced_at":"2026-04-25T22:31:32.322Z","repository":{"id":239752121,"uuid":"800454680","full_name":"litongjava/go-llm-proxy","owner":"litongjava","description":"go-llm-proxy","archived":false,"fork":false,"pushed_at":"2024-11-22T21:30:39.000Z","size":27,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-11T07:49:55.175Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/litongjava.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,"zenodo":null}},"created_at":"2024-05-14T11:16:13.000Z","updated_at":"2025-03-02T09:17:06.000Z","dependencies_parsed_at":"2024-05-14T12:44:30.831Z","dependency_job_id":"b64fcef8-5843-4b95-b7f9-3c9fcfd6bd7d","html_url":"https://github.com/litongjava/go-llm-proxy","commit_stats":null,"previous_names":["litongjava/go-llm-proxy"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/litongjava/go-llm-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litongjava%2Fgo-llm-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litongjava%2Fgo-llm-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litongjava%2Fgo-llm-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litongjava%2Fgo-llm-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/litongjava","download_url":"https://codeload.github.com/litongjava/go-llm-proxy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litongjava%2Fgo-llm-proxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32279652,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T18:29:39.964Z","status":"ssl_error","status_checked_at":"2026-04-25T18:29:32.149Z","response_time":59,"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":[],"created_at":"2024-11-27T11:37:41.014Z","updated_at":"2026-04-25T22:31:32.310Z","avatar_url":"https://github.com/litongjava.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-llm-proxy\n\n## Introduction\n\n`go-llm-proxy` is a service designed to proxy OpenAI API requests. It receives OpenAI API requests from clients and forwards them to the official OpenAI servers. This project solely acts as a proxy and does not store any data.\n\n**Note**: You must obtain your own OpenAI API key.\n\n## Quick Start\n\nAfter deployment, the service is accessible at: `https://llm.maxkb.ai`\n\n### Example Request\n\nUse `curl` to send a request:\n\n```shell\ncurl --location --request POST 'https://llm.maxkb.ai/openai/v1/chat/completions' \\\n--header 'Authorization: Bearer YOUR_OPENAI_API_KEY' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"messages\": [\n        {\n            \"role\": \"system\",\n            \"content\": \"Just say hi\"\n        }\n    ],\n    \"model\": \"gpt-4o-mini\",\n    \"stream\": true\n}'\n```\n\n**Important**: Replace `YOUR_OPENAI_API_KEY` with your actual API key.\n\n## Build\n\nCompile the project using Go:\n\n```sh\ngo build\n```\n\n## Run\n\nAfter building, run the generated executable:\n\n```sh\n./go-llm-proxy\n```\n\n## Test\n\nUse `curl` to test whether the proxy service correctly forwards requests and displays the returned data:\n\n```sh\ncurl --location --request POST 'http://127.0.0.1:8888/openai/v1/chat/completions' \\\n--header 'Authorization: Bearer YOUR_OPENAI_API_KEY' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"messages\": [\n        {\n            \"role\": \"system\",\n            \"content\": \"Just say hi\"\n        }\n    ],\n    \"model\": \"gpt-3.5-turbo\",\n    \"stream\": true\n}'\n```\n\n### Example Response\n\n```shell\ndata:{\"id\":\"chatcmpl-9P3fvvyk4IuCprCnvMytoKN8UtskC\",\"object\":\"chat.completion.chunk\",\"created\":1715759355,\"model\":\"gpt-3.5-turbo-0125\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":\"\"},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata:{\"id\":\"chatcmpl-9P3fvvyk4IuCprCnvMytoKN8UtskC\",\"object\":\"chat.completion.chunk\",\"created\":1715759355,\"model\":\"gpt-3.5-turbo-0125\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"content\":\"Hi\"},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata:{\"id\":\"chatcmpl-9P3fvvyk4IuCprCnvMytoKN8UtskC\",\"object\":\"chat.completion.chunk\",\"created\":1715759355,\"model\":\"gpt-3.5-turbo-0125\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"content\":\"!\"},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata:{\"id\":\"chatcmpl-9P3fvvyk4IuCprCnvMytoKN8UtskC\",\"object\":\"chat.completion.chunk\",\"created\":1715759355,\"model\":\"gpt-3.5-turbo-0125\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"content\":\" How\"},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata:{\"id\":\"chatcmpl-9P3fvvyk4IuCprCnvMytoKN8UtskC\",\"object\":\"chat.completion.chunk\",\"created\":1715759355,\"model\":\"gpt-3.5-turbo-0125\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"content\":\" can\"},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata:{\"id\":\"chatcmpl-9P3fvvyk4IuCprCnvMytoKN8UtskC\",\"object\":\"chat.completion.chunk\",\"created\":1715759355,\"model\":\"gpt-3.5-turbo-0125\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"content\":\" I\"},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata:{\"id\":\"chatcmpl-9P3fvvyk4IuCprCnvMytoKN8UtskC\",\"object\":\"chat.completion.chunk\",\"created\":1715759355,\"model\":\"gpt-3.5-turbo-0125\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"content\":\" assist\"},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata:{\"id\":\"chatcmpl-9P3fvvyk4IuCprCnvMytoKN8UtskC\",\"object\":\"chat.completion.chunk\",\"created\":1715759355,\"model\":\"gpt-3.5-turbo-0125\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"content\":\" you\"},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata:{\"id\":\"chatcmpl-9P3fvvyk4IuCprCnvMytoKN8UtskC\",\"object\":\"chat.completion.chunk\",\"created\":1715759355,\"model\":\"gpt-3.5-turbo-0125\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"content\":\" today\"},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata:{\"id\":\"chatcmpl-9P3fvvyk4IuCprCnvMytoKN8UtskC\",\"object\":\"chat.completion.chunk\",\"created\":1715759355,\"model\":\"gpt-3.5-turbo-0125\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"content\":\"?\"},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata:{\"id\":\"chatcmpl-9P3fvvyk4IuCprCnvMytoKN8UtskC\",\"object\":\"chat.completion.chunk\",\"created\":1715759355,\"model\":\"gpt-3.5-turbo-0125\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata:[DONE]\n```\n\n## Supported Models\n\nCurrently supported models include: [OpenAI Models](https://platform.openai.com/docs/models)\n\nPlease configure the specific model you wish to connect to via the proxy as needed.\n\n## Contribution\n\nContributions from the community are welcome! Whether it's adding new features or improving existing ones, feel free to submit Pull Requests to our [GitHub repository](https://github.com/your-repo/go-llm-proxy).\n\n## License\n\nThis project is licensed under the MIT License. See the [`LICENSE`](LICENSE) file for details.\n\n## Security Notice\n\n**Do not** expose your OpenAI API key in public repositories or shared environments. Ensure that your API key is securely stored to prevent unauthorized use.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitongjava%2Fgo-llm-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flitongjava%2Fgo-llm-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitongjava%2Fgo-llm-proxy/lists"}