Nodes/ComfyUI Griptape Nodes/Griptape Prompt Driver: Azure OpenAI
ComfyUI Node

Griptape Prompt Driver: Azure OpenAI

Talk to Azure OpenAI's GPT-4o — for people who need their LLM inside Azure

By griptape-ai·Created 2 years ago·Updated about a year ago· 238
Griptape Prompt Driver: Azure OpenAI
    • DRIVER
    modelgpt-4o
    max_attempts_on_fail2
    temperature0.10
    seed10342349342
    use_native_toolstrue
    max_tokens-1
    deployment_namegpt-4o
    response_formatdefault
    endpoint_env_varAZURE_OPENAI_ENDPOINT
    api_key_env_varAZURE_OPENAI_API_KEY

    Azure OpenAI is OpenAI's models wearing an enterprise suit: same GPT engines, but served through your Azure subscription with your data staying inside your tenant, which is a legal requirement in a lot of companies. This driver is the one you pick when your OpenAI access is behind Azure - either because your employer requires it or because you want the enterprise controls. If you have a normal OpenAI key, use the OpenAI-compatible driver instead; this one will just annoy you with extra fields.

    The extra friction is real, and it's baked into how Azure works: you don't call "gpt-4o" by name, you call the deployment you created in the Azure portal, which is why the node insists on a deployment_name separate from the model.

    How it works

    The node builds a Griptape AzureOpenAiChatPromptDriver. It grabs your endpoint and key from environment variables, pairs them with the deployment you specify, and hands out the finished driver on its DRIVER output. Same as every prompt driver here: plug it into an agent config or RAG module and the agent starts talking to your Azure deployment.

    The inputs that matter

    • deployment_name - this is the field that trips everyone up. It's the name of the deployment you created in the Azure portal (the "Deployments" page under your Azure OpenAI resource), not the model name. Default gpt-4o works if your deployment is named that; otherwise this must match exactly or you get a "resource not found" error.
    • model - dropdown of gpt-4o, gpt-4, gpt-3.5-turbo-16k, gpt-3.5-turbo. Azure requires the model to be enabled in your region for a deployment to exist.
    • endpoint_env_var and api_key_env_var - env-var names, defaults AZURE_OPENAI_ENDPOINT and AZURE_OPENAI_API_KEY. Both are required; a missing endpoint is the most common silent failure.
    • response_format - default or json_object. Switch to json_object when your agent output needs to be machine-parseable, like a tool result another node will read.

    temperature, seed, max_tokens, max_attempts_on_fail, and use_native_tools are the standard knobs. Output is DRIVER.

    Installing it

    Same pack install as always: ComfyUI Manager → GriptapeComfyUI-Griptape, or

    cd ComfyUI/custom_nodes
    git clone https://github.com/griptape-ai/ComfyUI-Griptape
    

    restart, then set AZURE_OPENAI_ENDPOINT and AZURE_OPENAI_API_KEY in Settings → Griptape or your environment. The Azure docs link in the README walks through getting them.

    Common issues

    The deployment-name mismatch is the #1 trap - Azure returns a confusing "invalid resource" style error when the deployment doesn't exist, and people blame the node. Also check the endpoint value is the full resource URL (the one ending in openai.azure.com/) - truncating it breaks everything. And remember Azure, unlike OpenAI proper, requires you to have created a deployment for the exact model you select; you can't just type "gpt-4o" and have it appear.

    If ComfyUI itself breaks after installing the pack, it's the usual griptape[all] torch clash - reinstall torch with the cu121 wheels and make sure griptape is current with python -m pip install griptape -U.

    CategoryGriptape/Agent Drivers/Prompt

    Inputs (10)

    NameTypeDefaultDescription
    modeloptCOMBOgpt-4o4 options: gpt-4o, gpt-4, gpt-3.5-turbo-16k, gpt-3.5-turbo
    max_attempts_on_failoptINT21–100Maximum attempts on failure
    temperatureoptFLOAT0.100–1Temperature for sampling
    seedoptINT10342349342Seed for random number generation
    use_native_toolsoptBOOLEANtrueUse native tools for the LLM.
    max_tokensoptINT-1Maximum tokens to generate. If <=0, it will use the default based on the tokenizer.
    deployment_nameoptSTRINGgpt-4o
    response_formatoptCOMBOdefault2 options: default, json_object
    endpoint_env_varoptSTRINGAZURE_OPENAI_ENDPOINTEnter the name of the environment variable for AZURE_OPENAI_ENDPOINT, not the actual endpoint.
    api_key_env_varoptSTRINGAZURE_OPENAI_API_KEYEnter the name of the environment variable for AZURE_OPENAI_API_KEY, not the actual API key.

    Outputs (1)

    NameTypeDescription
    DRIVERPROMPT_DRIVER