Skip to content

Integrate with Hugging Face models

You can integrate F5 AI Security. We provide a Python script to help with the process, which includes the following variables:

  • BASE_URL: The URL of the AI Security deployment. Depends on whether your deployment uses AI Security SaaS or your own on-premises system.
  • API_KEY: You can get your API_KEY, also known as an authorization token.
  • PROVIDER_API_KEY: Provided by Hugging Face. Consult their documentation for instructions.

Substitute actual values in the following Python script, and run it:

python
from calypsoai import CalypsoAI

cai = CalypsoAI(url={BASE_URL}, token={API_KEY})

provider = cai.providers.create(
    name="Example-HuggingFace",
    systemProvider="huggingface-chat",
    secrets={"apiKey": {"name": "HF API Key", "value": "{PROVIDER_API_KEY}"}},
    inputs={
        "model": "openai/gpt-oss-120b",
    },
)

Updated at: