Pass settings to your model or container, such as a file path or a framework option, as environment variables that the endpoint starts with.
Before you begin
Section titled “Before you begin”- Permission to create model endpoints in the project, or to update one that already exists. A Member needs a policy that grants create or update permission for the Inference service.
- The key and value for each variable.
Add the variables
Section titled “Add the variables”- On the create form, or on Update Inference, open Advanced Settings.
- Under Environment Variables, select Add Environment Variable.
- Type the Key and the Value. A key can use letters, digits, and underscores, and must start with a letter or an underscore. Every row needs both a key and a value.
- Repeat for each variable. You can remove a row that you added.
- Select Deploy Endpoint, or Update Endpoint on an existing endpoint.
If you add the same key twice, the endpoint uses the value you added last. TIR drops rows with an empty key before it creates the endpoint.
The variable the form adds
Section titled “The variable the form adds”TIR adds HF_HOME for you. You can change its value; its name stays fixed. It starts as the cache path plus /.cache, so the Hugging Face cache sits inside Model Cache Storage.
Check the variables
Section titled “Check the variables”Under Actions, select Update Inference to see your variables and change them. See Update an endpoint.
If a framework or container needs a Hugging Face or GitHub token, the create form asks for it as an integration. The integration takes the place of a variable. See Create an endpoint.