Provider Slug.
ollama
Obiguard SDK Integration with Ollama Models
Obiguard provides a consistent API to interact with models from various providers.1. Expose your Ollama API
Expose your Ollama API by using a tunneling service like ngrok or any other way you prefer. For using Ollama with ngrok, here’s a useful guide2. Install the Obiguard SDK
Install the Obiguard SDK in your application to interact with your Ollama API through Obiguard.3. Initialize Obiguard with Ollama URL
Instantiate the Obiguard client by adding your Ollama publicly-exposed URL to thecustomHost
property.
For the Ollama integration, you only need to pass the base URL to
customHost
without the version identifier (such as
/v1
) - Obiguard takes care of the rest!4. Invoke Chat Completions with Ollama
Use the Obiguard SDK to invoke chat completions from your Ollama model, just as you would with any other provider.Using Virtual Keys
Virtual Keys serve as Obiguard’s unified authentication system for all LLM interactions, simplifying the use of multiple providers and Obiguard features within your application. For self-hosted LLMs, you can configure custom authentication requirements including authorization keys, bearer tokens, or any other headers needed to access your models.- Navigate to Virtual Keys in your Obiguard dashboard
- Click “Add Key” and enable the “Local/Privately hosted provider” toggle
- Configure your deployment:
- Select the matching provider API specification (typically
OpenAI
) - Enter your model’s base public URL in the
Custom Host
field - Add required authentication headers and their values
- Click “Create” to generate your virtual key