Back to Baml

huggingface

fern/03-reference/baml/clients/providers/huggingface.mdx

0.223.0476 B
Original Source

HuggingFace supports the OpenAI client, allowing you to use the openai-generic provider with an overridden base_url.

See https://huggingface.co/docs/inference-endpoints/index for more information on their Inference Endpoints.

baml
client<llm> MyClient {
  provider openai-generic
  options {
    base_url "https://api-inference.huggingface.co/v1"
    api_key env.HUGGINGFACE_API_KEY
  }
}