Skip to main content
Obiguard provides a robust and secure gateway to facilitate the integration of various Large Language Models (LLMs) into your applications, including all the text generation models supported by Hugging Face’s Inference endpoints. With Obiguard, you can take advantage of features like fast AI gateway access, observability, prompt management, and more, all while ensuring your provider credentials stay in Obiguard and callers authenticate with access keys.
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 an access key

To use Hugging Face with Obiguard, get your Hugging Face Access token from here. Add it to Obiguard as a provider credential, then create an access key for the agent or project that will call it.

3. Invoke Chat Completions with Hugging Face

Use the Obiguard instance to send requests to Hugging Face.

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.
  1. Add your self-hosted model to Obiguard as a provider credential
  2. 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
  3. Create an access key for the agent or project that will call it
You can now use the access key in your requests:
For more information about managing self-hosted LLMs with Obiguard, see Bring Your Own LLM.

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