The ollama-token-api project aims to add bearer authentication to Ollama, allowing users to secure their access without needing different client libraries. It works by validating tokens stored in a MongoDB database and reverse proxying requests to the Ollama server using Hono.
- Bearer Authorization: Implement OAuth2 bearer token authentication for Ollama.
- MongoDB Token Storage: Store and retrieve tokens from a MongoDB database.
- Honol Reverse Proxying: Use Hono to reverse proxy requests to the Ollama server.
- Highly Customizable: Configurable via environmental variables or configuration files.
You can deploy this API using Docker. The official Docker image is available on both GitHub and our private registry.
docker pull ghcr.io/clowdertech/ollama-token-api:latest
Or, for a specific tag:
docker pull ghcr.io/clowdertech/ollama-token-api:<tag>
If you aim to contribute or access the latest development builds, use our dedicated registry.
docker pull forgejo.clowdertech.com/clowdertech/ollama-token-api:master
TODO: Add detailed installation instructions for manual setup (including setting up MongoDB and Hono).
Once installed, start using Ollama Token API by sending requests with appropriately authenticated bearer tokens.
For additional configuration options or advanced usage, please refer to the following file:
Contributions are highly welcomed! If you wish to contribute to this project, please follow these steps:
- Fork this repository using Forgejo (https://forgejo.clowdertech.com/clowdertech/ollama-token-api).
- Create a new feature branch from
master
. - Commit your changes following standard conventions.
- Push the branch to your fork and create a Pull Request.
For more details on contribution guidelines, see:
This project is licensed under the terms of the Apache License. See LICENSE file for full details.
Built with ❤️ by ClowderTech