Nodes/ComfyUI Griptape Nodes/Griptape Agent Config: Amazon Bedrock Drivers
ComfyUI Node

Griptape Agent Config: Amazon Bedrock Drivers

Bedrock on one node — prompt, embeddings, images, and the max_tokens trap

By griptape-ai·Created 2 years ago·Updated about a year ago· 238
Griptape Agent Config: Amazon Bedrock Drivers
    • CONFIG
    prompt_model_commentPrompt Driver
    modelanthropic.claude-3-5-sonnet-20240620-v1:0
    max_attempts_on_fail2
    temperature0.10
    seed10342349342
    use_native_toolstrue
    max_tokens100
    min_p0.10
    top_k40
    aws_access_key_id_env_varAWS_ACCESS_KEY_ID
    aws_secret_access_key_env_varAWS_SECRET_ACCESS_KEY
    aws_default_region_env_varAWS_DEFAULT_REGION
    embedding_model_commentEmbedding Driver
    embedding_modelamazon.titan-text-premier-v1:0
    min_retry_delay2.00
    max_retry_delay10.00
    image_generation_model_commentImage Generation Driver
    image_generation_modelamazon.titan-image-generator-v1
    size512x512

    The Amazon Bedrock Drivers config is the modern, all-in-one way to run a Griptape agent on AWS Bedrock. Where the deprecated Bedrock config only handled the prompt driver, this one builds a full stack: a prompt driver (Claude or Titan), a Titan embedding driver, a Titan image-generation driver, and a local vector store wired to the embeddings - all behind your AWS credentials. It's the node to use if your organization lives in AWS and you'd rather not route agent traffic through per-vendor SaaS keys.

    The appeal is real if you're already an AWS shop: one credential set, billing consolidated on your AWS account, and Bedrock gives you Claude-class models plus Titan's image generation in one place. The catch is that this is the fiddliest of the pack's configs, because AWS has more moving parts than "paste an API key." The node tries to make that manageable by exposing the env var names and region explicitly.

    How it works

    The node constructs an AmazonBedrockDriversConfig with three drivers built from your inputs: AmazonBedrockPromptDriver for reasoning, AmazonBedrockTitanEmbeddingDriver for vectors, and AmazonBedrockImageGenerationDriver (the Titan image model) for image tasks, plus a LocalVectorStoreDriver on those Titan embeddings. Credentials come from the three env var names you provide - AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_DEFAULT_REGION by default.

    The inputs that matter

    • model - the prompt model: anthropic.claude-3-5-sonnet-20240620-v1:0 (default), other claude-3 IDs, or amazon.titan-text-*.
    • max_tokens - default 100, and the tooltip is worth reading: "Amazon Bedrock tends to fail if this isn't given." This is the fix the deprecated node never got. Leave it at 100 or raise it for long outputs, but don't zero it.
    • embedding_model - Titan embedding model (default amazon.titan-text-premier-v1:0).
    • image_generation_model - default amazon.titan-image-generator-v1, with a size dropdown (512x512 / 1024x1024).
    • temperature, min_p, top_k - the sampling dials, with Bedrock's own semantics.
    • The three aws_*_env_var fields - env var names, never literal keys.

    Output is a single CONFIG for agent creation.

    Install and credentials

    Same pack - ComfyUI Manager (search "Griptape") or:

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

    AWS access keys: console → your username → Security Credentials → Create Access Key (the README walks through it). Set the three vars in Settings → Griptape or your environment. griptape[all] installs torch; on Nvidia reinstall from the cu121 index if ComfyUI breaks.

    Common gotchas

    Bedrock failures are usually one of three things: the region doesn't host the model you picked (check Bedrock's model availability per region), the IAM role lacks Bedrock permissions, or max_tokens isn't set - which this node now handles by defaulting to 100. Titan image generation is also noticeably more limited than dall-e: the size dropdown tops out at 1024x1024 and there's no portrait option. And remember this is a config node - it emits CONFIG, so pair it with Griptape Create: Agent from Config, not with individual driver wiring.

    CategoryGriptape/Agent Configs

    Inputs (19)

    NameTypeDefaultDescription
    prompt_model_commentoptSTRINGPrompt Driver
    modeloptCOMBOanthropic.claude-3-5-sonnet-20240620-v1:07 options: anthropic.claude-3-5-sonnet-20240620-v1:0, anthropic.claude-3-opus-20240229-v1:0, anthropic.claude-3-sonnet-20240229-v1:0, anthropic.claude-3-haiku-20240307-v1:0, amazon.titan-text-premier-v1:0, amazon.titan-text-express-v1, +1
    max_attempts_on_failoptINT21–100Maximum attempts on failure
    temperatureoptFLOAT0.100–1Temperature for sampling
    seedoptINT10342349342Set the seed for random number generation.
    use_native_toolsoptBOOLEANtrueUse native tools for the LLM.
    max_tokensoptINT100Maximum tokens to generate. Amazon Bedrock tends to fail if this isn't given.
    min_poptFLOAT0.100–1Minimum probability for sampling. Lower values will be more random.
    top_koptINT40Top k for sampling. Lower values are more deterministic.
    aws_access_key_id_env_varoptSTRINGAWS_ACCESS_KEY_IDEnter the name of the environment variable for your AWS_ACCESS_KEY_ID, not your actual key.
    aws_secret_access_key_env_varoptSTRINGAWS_SECRET_ACCESS_KEYEnter the name of the environment variable for your AWS_SECRET_ACCESS_KEY, not your actual key.
    aws_default_region_env_varoptSTRINGAWS_DEFAULT_REGIONEnter the name of the environment variable for your AWS_DEFAULT_REGION, not your actual region.
    embedding_model_commentoptSTRINGEmbedding Driver
    embedding_modeloptCOMBOamazon.titan-text-premier-v1:0Select the embedding model to use.
    min_retry_delayoptFLOAT2.00Minimum retry delay
    max_retry_delayoptFLOAT10.00Minimum retry delay
    image_generation_model_commentoptSTRINGImage Generation Driver
    image_generation_modeloptSTRINGamazon.titan-image-generator-v1Select the image generation model to use.
    sizeoptCOMBO512x512Choose the size of the generated image.

    Outputs (1)

    NameTypeDescription
    CONFIGCONFIG