{"id":25348499,"url":"https://github.com/onllama/onllama.litegateway","last_synced_at":"2025-04-08T19:55:06.100Z","repository":{"id":277538965,"uuid":"932735939","full_name":"onllama/Onllama.LiteGateway","owner":"onllama","description":"The easiest way to add Apikey authentication to Ollama. Prevent Ollama from being abused by exposing it directly to the public network. / 防止 Ollama 直接暴露在公网受到滥用，为 Ollama 添加 Apikey 鉴权的最简单方式。","archived":false,"fork":false,"pushed_at":"2025-02-24T14:58:06.000Z","size":33,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-02-24T15:46:55.132Z","etag":null,"topics":["api-gateway","api-proxy","apikey","ollama","reverse-proxy"],"latest_commit_sha":null,"homepage":"","language":"C#","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/onllama.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":"2025-02-14T12:29:15.000Z","updated_at":"2025-02-24T14:58:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"3ae205de-a806-4690-9e83-53c0180dca31","html_url":"https://github.com/onllama/Onllama.LiteGateway","commit_stats":null,"previous_names":["onllama/onllama.litegateway"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onllama%2FOnllama.LiteGateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onllama%2FOnllama.LiteGateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onllama%2FOnllama.LiteGateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onllama%2FOnllama.LiteGateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onllama","download_url":"https://codeload.github.com/onllama/Onllama.LiteGateway/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247918933,"owners_count":21018044,"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":["api-gateway","api-proxy","apikey","ollama","reverse-proxy"],"created_at":"2025-02-14T15:38:23.166Z","updated_at":"2025-04-08T19:55:06.088Z","avatar_url":"https://github.com/onllama.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Onllama.LiteGateway \nPrevent Ollama from being abused by exposing it directly to the public network. The easiest way to add Apikey authentication to Ollama.\n\n防止 Ollama 直接暴露在公网受到滥用，为 Ollama 添加 Apikey 鉴权的最简单方式。 \n\n```\nwget https://github.com/onllama/Onllama.LiteGateway/releases/latest/download/Onllama.LiteGateway.linux-x64 -O /usr/bin/Onllama.LiteGateway\nwget https://raw.githubusercontent.com/onllama/Onllama.LiteGateway/refs/heads/main/onllama-litegateway@.service -O /etc/systemd/system/onllama-litegateway@.service\nchmod +x /usr/bin/Onllama.LiteGateway \nsystemctl enable onllama-litegateway@sk-just-for-example --now\n\n# Please replace 'sk-just-for-example' with the apikey you want to set. / 请替换 'sk-just-for-example' 为你想要设置的 apikey。\n# curl http://127.0.0.1:22434\n```\n\n```\nOnllama.LiteGateway - The simplest Ollama authentication way.\nCopyright (c) 2025 Milkey Tan. Code released under the MIT License\n\nUsage: Onllama.LiteGateway [options] \u003ckeys\u003e\n\nArguments:\n  keys                                     Setting up the API key\n\nOptions:\n  -?|-he|--help                            Show help information.\n  -l|--listen \u003cIPEndPoint\u003e                 Set server listening address and port\n  -t|--target \u003cUri\u003e                        Set target address and port\n  --log                                    Enable logging\n  -s|--https                               Set enable HTTPS (Self-signed by default, not recommended)\n  -pem|--pemfile[:\u003cFilePath\u003e]              Set your pem certificate file path \u003c./cert.pem\u003e\n  -key|--keyfile[:\u003cFilePath\u003e]              Set your pem certificate key file path \u003c./cert.key\u003e\n  -h|--host[:\u003cHostname\u003e]                   Set the allowed host names. (Allow all by default)\n  --no-think-trim                          Disable ThinkTrim\n  --no-token                               Disable API key verification\n  --use-model-manage                       Enable model management via API\n  --use-model-info-public-path             Allows get model information via API without APIKEY\n  --use-cors-any                           Allow cross-origin requests\n  --use-rate-limit                         Enable request rate limiting (with ipratelimiting.json)\n  --num-ctx[:\u003cNumCtx\u003e]                     Set the number of contexts per request\n  --use-input-security                     Enable input security\n  --risk-model[:\u003cRiskModel\u003e]               Set the input security risk model\n  --risk-model-prompt[:\u003cRiskModelPrompt\u003e]  Set the input security risk model prompt\n  --risk-keywords \u003cRiskKeywords\u003e           Set the input security risk model keywords\n```\n\n## TODO\n- [x] HTTPS\n- [x] Host\n- [x] Log\n- [x] CORS\n- [x] Rate Limit\n- [x] Public URL\n- [x] Trim `\u003cthink/\u003e`\n- [x] Override `num_ctx`\n- [x] Input content security based on llamaguard/shieldgemma\n- [ ] Auto context summary compress\n- [ ] Apikey from DB\n- [ ] ACME Auto HTTPS\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonllama%2Fonllama.litegateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonllama%2Fonllama.litegateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonllama%2Fonllama.litegateway/lists"}