Nodes/ComfyUI Griptape Nodes/Griptape Prompt Driver: Anthropic
ComfyUI Node

Griptape Prompt Driver: Anthropic

Give your agent the Claude brain — the one people actually reach for

By griptape-ai·Created 2 years ago·Updated about a year ago· 238
Griptape Prompt Driver: Anthropic
    • DRIVER
    modelclaude-3-5-sonnet-latest
    max_attempts_on_fail2
    temperature0.10
    seed10342349342
    use_native_toolstrue
    max_tokens-1
    top_k250
    api_key_env_varANTHROPIC_API_KEY
    top_p1.00

    The Anthropic prompt driver is where most people land when they want a Griptape agent that actually thinks instead of just pattern-matching. Claude is the model family this pack's default configurations lean toward, and for good reason: it's consistently the best at following long, multi-step instructions, which is exactly what you need when an agent is chaining tools and reasoning about what to do next. If you're going to pay for one hosted brain for these nodes, this is the one to start with.

    It's a prompt driver, which in Griptape terms means it's the configurable brain you plug into an agent. The node builds an AnthropicPromptDriver with your chosen model and sampling settings, and hands it out on a single DRIVER output. Wire that into an agent configuration node, and every reply the agent generates comes from Claude.

    The inputs that matter

    • model - default claude-3-5-sonnet-latest. That "latest" alias means the node tracks Anthropic's current Sonnet release, which is a nice default for most work. If you need a specific version pinned for reproducibility, type it here.
    • api_key_env_var - the name of the environment variable holding your key. Default ANTHROPIC_API_KEY, and you should leave it alone unless you named yours differently. Get the key from console.anthropic.com/settings/keys.
    • max_tokens - default -1, meaning "let the model decide." Raise it if your agent's answers keep ending early on long writes.
    • temperature, top_k, top_p - the sampling knobs. Defaults (0.1 temperature, top_p 0.999, top_k 250) are deliberately close to deterministic; dial temperature up toward 1.0 when you want variety.

    use_native_tools defaults on, which lets Claude use Anthropic's native function-calling - that's what makes the agent's tool use (calculator, web scraping, file access) actually work. Leave it on. Output is DRIVER (PROMPT_DRIVER).

    Installing it

    Pack install is standard: ComfyUI Manager → search GriptapeComfyUI-Griptape → Install, restart. Manual:

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

    Then set your key. The pack reads ANTHROPIC_API_KEY from your environment automatically, or you can paste it into Settings → Griptape in ComfyUI's sidebar.

    Common issues

    The classic mistake is putting your actual key into api_key_env_var - that field wants the variable name, not the secret. If the node errors with an auth failure, check that first. Also note the tooltip: if you already have ANTHROPIC_API_KEY set in your shell, the pack's settings page shows it pre-filled, which trips people into thinking the key is stored elsewhere.

    And the pack-wide warning: griptape[all] installs torch and can fight ComfyUI's own torch on Nvidia. If ComfyUI breaks after installing this pack, uninstall and reinstall torch with the cu121 wheel (pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu121). If you hit ImportError: cannot import name 'OllamaPromptDriver', your griptape library is stale - python -m pip install griptape -U and restart.

    CategoryGriptape/Agent Drivers/Prompt

    Inputs (9)

    NameTypeDefaultDescription
    modeloptCOMBOclaude-3-5-sonnet-latestSelect the model you want to use from the available options.
    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.
    top_koptINT2500–500Limits the number of tokens considered for each step of the generation. Prevents the model from focusing too narrowly on the top choices.
    api_key_env_varoptSTRINGANTHROPIC_API_KEYEnter the name of the environment variable for your ANTHROPIC_API_KEY key, not your actual key.
    top_poptFLOAT1.000–1Controls the cumulative probability distribution cutoff. The model will only consider the top p% most probable tokens.

    Outputs (1)

    NameTypeDescription
    DRIVERPROMPT_DRIVER