byterover-cli icon indicating copy to clipboard operation
byterover-cli copied to clipboard

[BUG] AWS Bedrock LLM provider not recognized at startup (fails without other API keys)

Open takayama-dm opened this issue 1 year ago • 5 comments

Bug Description

When configuring llm.provider: aws-bedrock in cipher.yml and setting the required AWS environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION, etc.), Cipher still fails to start.

The startup validation in src/app/index.ts requires at least one of OPENAI_API_KEY, ANTHROPIC_API_KEY, OPENROUTER_API_KEY, or OLLAMA_BASE_URL to be present. This effectively prevents using AWS Bedrock as the sole LLM provider, even though the official documentation lists it as supported.

Steps to Reproduce

  1. Create a .env with only AWS Bedrock credentials and model info:

    AWS_ACCESS_KEY_ID=***
    AWS_SECRET_ACCESS_KEY=***
    AWS_REGION=us-west-2
    AWS_LLM_MODEL=us.anthropic.claude-sonnet-4-20250514-v1:0
    AWS_EMBEDDING_MODEL=amazon.titan-embed-text-v2:0
    AWS_EMBEDDING_DIMENSION=1024
    
  2. Configure memAgent/cipher.yml:

    llm:
      provider: aws-bedrock
      model: ${AWS_LLM_MODEL}
      region: ${AWS_REGION}
    
    embedding:
      type: aws-bedrock
      model: ${AWS_EMBEDDING_MODEL}
      dimensions: ${AWS_EMBEDDING_DIMENSION}
      region: ${AWS_REGION}
    
  3. Run cipher in terminal.

  4. Observe error.

Expected Behavior

Cipher should start successfully and use AWS Bedrock for both LLM and embeddings without requiring keys for other providers.

Actual Behavior

Cipher exits with:

ERROR: No API key or Ollama configuration found, please set at least one of OPENAI_API_KEY, ANTHROPIC_API_KEY, OPENROUTER_API_KEY, or OLLAMA_BASE_URL
Available providers: OpenAI, Anthropic, OpenRouter, Ollama, Qwen

takayama-dm avatar Aug 14 '25 12:08 takayama-dm

Thank you for reporting the bug, i will have a look and resolve it asap

willingWill17 avatar Aug 14 '25 13:08 willingWill17

Hi, @RyoTakayama-Eurus. It looks like the LLM provider configuration was set incorrectly. The correct configuration should be:

lm:
  provider: aws
  model: ${AWS_LLM_MODEL}
  maxIterations: 50
  aws: 
    region: ${AWS_REGION}
    accessKeyId: ${AWS_ACCESS_KEY_ID}
    secretAccessKey: ${AWS_SECRET_ACCESS_KEY}
    sessionToken: ${AWS_SESSION_TOKEN}  # Optional, for temporary credentials

Please try this, and leave a comment if the initialization still fails.

Oxazolidinone avatar Aug 17 '25 04:08 Oxazolidinone

Sorry for the delay, i resolved the problem in pr #212, you will need to change the yml configuration file accordingly to the example. Thank you for reporting the issue.

willingWill17 avatar Aug 17 '25 15:08 willingWill17

Thank you for the super quick fix!

Just to share an additional detail: AWS_INFERENCE_PROFILE_ARN needs to be specified.

Also, here’s an example of one-line command for adding MCP in Claude Code:

claude mcp add cipher \
  -e MCP_SERVER_MODE="aggregator" \
  -e AWS_ACCESS_KEY_ID="***" \
  -e AWS_SECRET_ACCESS_KEY="***" \
  -e AWS_REGION="us-west-2" \
  -e AWS_INFERENCE_PROFILE_ARN="arn:aws:bedrock:us-west-2:***:inference-profile/us.anthropic.claude-sonnet-4-20250514-v1:0" \
  -- cipher --mode mcp

takayama-dm avatar Aug 19 '25 12:08 takayama-dm

Thank you for the super quick fix!

Just to share an additional detail: AWS_INFERENCE_PROFILE_ARN needs to be specified.

Also, here’s an example of one-line command for adding MCP in Claude Code:

claude mcp add cipher \
  -e MCP_SERVER_MODE="aggregator" \
  -e AWS_ACCESS_KEY_ID="***" \
  -e AWS_SECRET_ACCESS_KEY="***" \
  -e AWS_REGION="us-west-2" \
  -e AWS_INFERENCE_PROFILE_ARN="arn:aws:bedrock:us-west-2:***:inference-profile/us.anthropic.claude-sonnet-4-20250514-v1:0" \
  -- cipher --mode mcp

That's good to know, I'll add this guide in the docs soon

RyanNg1403 avatar Aug 19 '25 16:08 RyanNg1403