--- title: "Set environment variables" description: "Add environment variables to a Model Endpoint under Advanced Settings, with the rules for keys and values and the one variable the form adds for you." content_type: "how-to" product: "model-endpoints" platform: "TIR" url: "/tir/model-endpoints/how-to/set-environment-variables/" topic: ["create"] --- # Set environment variables 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 - 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 1. On the create form, or on **Update Inference**, open **Advanced Settings**. 2. Under **Environment Variables**, select **Add Environment Variable**. 3. 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. 4. Repeat for each variable. You can remove a row that you added. 5. 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 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 Under **Actions**, select **Update Inference** to see your variables and change them. See [Update an endpoint](/tir/model-endpoints/how-to/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](/tir/model-endpoints/how-to/create-an-endpoint/).