Provider Slug.
ollamaObiguard 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.- Python SDK
3. Initialize Obiguard with Ollama URL
Instantiate the Obiguard client by adding your Ollama publicly-exposed URL to thecustomHost property.
- Python SDK
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.- Python SDK
- cURL
Using Provider Credentials and Access Keys
Obiguard stores the credentials for your provider in its vault as a provider credential, and your application authenticates to the gateway with an access key. This simplifies 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 model.- Add your self-hosted model to Obiguard as a provider credential
- Configure your deployment:
- Select the matching provider API specification (typically
OpenAI) - Enter your model’s base URL as the custom host
- Add required authentication headers and their values
- Select the matching provider API specification (typically
- Create an access key for the agent or project that will call it
- Python SDK
- OpenAI SDK
- cURL
Ollama Tool Calling
Tool calling feature lets models trigger external tools based on conversation context. You define available functions, the model chooses when to use them, and your application executes them and returns results. Obiguard supports Ollama Tool Calling and makes it interoperable across multiple providers.Supported Ollama Models with Tool Calling
- Python SDK
- cURL

