Skip to content

The easiest way to add Apikey authentication to Ollama. Prevent Ollama from being abused by exposing it directly to the public network. Also support trimming the reasoning </think>. / 防止 Ollama 直接暴露在公网受到滥用,为 Ollama 添加 Apikey 鉴权的最简单方式。同时支持裁剪推理模型 </think> 思考过程,节省上下文。

License

Notifications You must be signed in to change notification settings

onllama/Onllama.LiteGateway

Repository files navigation

Onllama.LiteGateway

Prevent Ollama from being abused by exposing it directly to the public network. The easiest way to add Apikey authentication to Ollama.

防止 Ollama 直接暴露在公网受到滥用,为 Ollama 添加 Apikey 鉴权的最简单方式。

wget https://github.com/onllama/Onllama.LiteGateway/releases/latest/download/Onllama.LiteGateway.linux-x64 -O /usr/bin/Onllama.LiteGateway
wget https://raw.githubusercontent.com/onllama/Onllama.LiteGateway/refs/heads/main/onllama-litegateway@.service -O /etc/systemd/system/onllama-litegateway@.service
chmod +x /usr/bin/Onllama.LiteGateway 
systemctl enable onllama-litegateway@sk-just-for-example --now

# Please replace 'sk-just-for-example' with the apikey you want to set. / 请替换 'sk-just-for-example' 为你想要设置的 apikey。
# curl http://127.0.0.1:22434

TODO

  • HTTPS
  • Host
  • Log
  • CORS
  • Rate Limit
  • Public URL
  • Trim <think/>
  • Override num_ctx
  • Input content security based on llamaguard/shieldgemma
  • Auto context summary compress
  • Apikey from DB
  • ACME Auto HTTPS

About

The easiest way to add Apikey authentication to Ollama. Prevent Ollama from being abused by exposing it directly to the public network. Also support trimming the reasoning </think>. / 防止 Ollama 直接暴露在公网受到滥用,为 Ollama 添加 Apikey 鉴权的最简单方式。同时支持裁剪推理模型 </think> 思考过程,节省上下文。

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published