Provider Slug.
Hugging Face
Obiguard SDK Integration with Hugging Face
Obiguard provides a consistent API to interact with models from various providers. To integrate Hugging Face with Obiguard:1. Install the Obiguard SDK
Add the Obiguard SDK to your application to interact with Hugging Face’s API through Obiguard’s gateway.2. Initialize Obiguard with the Virtual Key
To use Hugging Face with Obiguard, get your Hugging Face Access token from here, then add it to Obiguard to create the virtual key.3. Invoke Chat Completions with Hugging Face
Use the Obiguard instance to send requests to Hugging Face. You can also override the virtual key directly in the API call if needed.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 model.- 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 URL in the
Custom Host
field - Add required authentication headers and their values
Next Steps
The complete list of features supported in the SDK are available on the link below.Obiguard SDK Client
Learn more about the Obiguard SDK Client