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
1client<llm> MyClient {
2 provider openai-generic
3 options {
4 base_url "https://api-inference.huggingface.co/v1"
5 api_key env.HUGGINGFACE_API_KEY
6 }
7}