Skip to main content

Hugging Face

Hugging Face provides access to thousands of models via their Inference Endpoints.

Basic Example​

client<llm> MyClient {
provider openai-generic
options {
base_url "https://api-inference.huggingface.co/v1"
api_key env.HUGGINGFACE_API_KEY
model "meta-llama/Llama-3-70B-Instruct"
}
}

BAML-Specific Options​

OptionTypeDefaultDescription
base_urlstring-https://api-inference.huggingface.co/v1
api_keystringenv.HUGGINGFACE_API_KEYAPI key
modelstring-Model identifier

See Hugging Face Inference Endpoints for more information.

See Also​