eca icon indicating copy to clipboard operation
eca copied to clipboard

Support for AWS Bedrock models (claude, etc)

Open skeezix opened this issue 9 months ago • 13 comments

AWS Bedrock offers various models, including Claude; but instead of the usual Claude approach, you just set env.. CLAUDE_CODE_USE_BEDROCK=1 AWS_BEARER_TOKEN_BEDROCK=....

So AWS in this case presents a REST endpoint that is a wrapper for the models.

Any chance eca can support that method of interaction? I would love to get off Claude Code cli per se, into ECA-emacs :)

One hopes we get normalized Claude-code credentials, but AWS is pretty commonly available, and this is a poor mans way to reach these models.

skeezix avatar Feb 24 '26 22:02 skeezix

@skeezix AFAICS that's already possible via the openai compatible API, via this config:

~/.config/eca/config.json

{
 "providers" : {
    "aws-bedrock": {
      "api": "openai-chat",
      "url": "https://bedrock-runtime.eu-west-1.amazonaws.com/openai/v1",
      "key": "${env:AWS_BEARER_TOKEN_BEDROCK}",
      "models": {
        "openai.gpt-oss-20b-1:0": {} // whatever model you want
      }
    }
  }
}

Can you try that?

if works, we should add an example configuration in providers examples

ericdallo avatar Feb 25 '26 13:02 ericdallo

Never having used eca/eca-emacs yet, I'm confuzzled :)

I still need to use /login I presume? and if so, which provider? ie: if I pick openai it wants a manual or sub; theres no bedrock or aws listed.

I had figured /login and the list of providers would now include aws-bedrock due to above config (perhaps not found?) .. though if I use /config and search, I do see bedrock mentioned there.

Hmmm..

skeezix avatar Feb 25 '26 16:02 skeezix

no, /login is just for models that use subscription/oauth, or a shortcut to add to config automatically for a provider, but in the end is just configure in your config.json

ericdallo avatar Feb 25 '26 16:02 ericdallo

We can include aws-bedrock when we have a working config, then we can add to that list if we want

ericdallo avatar Feb 25 '26 16:02 ericdallo

Using the above config (embedded my key, to avoid env lookup even) it offers the usual menu (/login etc), and instead of doing that I just put in 'hello world' and get 'Waiting model...' forever.

The various stderr buffers don't seem to scream anything.

Is there anything needing doing so it knows which provider to engage with?

skeezix avatar Feb 25 '26 16:02 skeezix

Can you share your ~/.config/eca/config.json? If the config is right, you can select the model clicking on the model in headerline or eca-chat-select-model (C-c C-m)

ericdallo avatar Feb 25 '26 16:02 ericdallo

Ended up restarting emacs and getting a fresh eca binary, and its picking up config changes now; currently the above 20b one is responding (showing the xml 'reasoning' tags response above with some errors.) I tried adding claude-sonnet and the 120b models but getting some LLM model selection errors.

(I know bedrock can get to claude, since claude-code via bedrock works fine.. but what secret model name do they uyse, I'll see if I can find it.)

Thanks so much, I've got some avenues to attack; if I get stimmied will let you know, but I've got to give it a good whack before harassing you.

Your config snippet above is likely correct or close, but let me see if I can get a solid useful session going.

skeezix avatar Feb 25 '26 17:02 skeezix

Glad it's working, please do share your config later so we can update https://eca.dev for other people that configure bedrock later

ericdallo avatar Feb 25 '26 17:02 ericdallo

So far just pulling my hair out for.. the 20b model you supplied above works (even swapping from eu-west-1 to us-west-1 or us-west-2 etc); but any other model-id I try to use, from official docs copy/pasted, with and without trailing version number, with and without prefix like us. or global. etc, I only ever get..

  • 'the provided model identifier is invalid'
  • 'the model doesn't exist or doesn't support this API'

Hmmrf; Bedrock is exposing the openai/v1 protocol via openai-chat type for ECA, but I wonder if theres some sneaky permissions rubbish in my bedrock key, or perhaps the region only offers specific models, or that protocol is not exposed...

Do you have an example with say the 120b oss one? I'd have figured that'd drop right in, but no dice; ideally I'd get claude-sonnet-4.6 or something going, but so far no success with anything other than "openai.gpt-oss-20b-1:0"

So close.. :)

skeezix avatar Feb 25 '26 20:02 skeezix

Sorry for that, unfortunatelly I have no bedrock account/keys to test that, but I know @jumarko already used eca with bedrock, let's see if he can help

ericdallo avatar Feb 25 '26 20:02 ericdallo

Figured out I can use aws cli via the bedrock token, so can ask it for a list of models.. and dropping the actual model-id right from aws cli into the config, no luck; but that 20b one works. Totally crazy :)

I can drop those same model names into gptel and get success, so I am pretty sure permissions sort out.

Took a quick look at ECA (clojure, surprise) but don't think it has any hardcoded model limits

skeezix avatar Feb 25 '26 21:02 skeezix

Yeah we have no models limit and if the API is correct (openai-api for example), it should work so I believe it must be model availability for your account or something. @skeezix I'd be really happy to see AWS bedrock setup in https://eca.dev/config/models/#providers-examples, would you be interested in opening a PR?

ericdallo avatar Feb 26 '26 12:02 ericdallo

Sorry for the slow response. I played with ECA + Bedrock a couple of months ago but since then I haven't used it at all. I think I got it working with "openai.gpt-oss-20b-1:0" using Eric's instructions but my main goal was to use it with Anthropic models, so I've been waiting for a related PR (I offered some testing there but unfortunately didn't have time for it yet). Even that PR, though, seems to offer no option for temporary IAM role credentials which is the primary way I interact with Bedrock (using Claude Code which supports this scenario well, at the moment).

jumarko avatar Mar 16 '26 09:03 jumarko