Hi everyone - is anyone tracking any LiteLLM chang...
# questions
n
Hi everyone - is anyone tracking any LiteLLM changes embedded within OpenHands when migrating from 0.48 to 0.49 or 0.50? I've got a simple bedrock setup that has been working for many versions now, but when I upgrade my containers to 0.49 or 0.50, I get the following error
Copy code
openhands:ERROR: agent_controller.py:306 - [Agent Controller be36e3ca54134bcfbe5d4fd2a25c3d1f] Error while running the agent (session ID: be36e3ca54134bcfbe5d4fd2a25c3d1f): litellm.APIConnectionError: BedrockException - {"Message":"Invalid API Key format: Must start with pre-defined prefix"}.
I've been trying to figure out what this prefix is, since all I've done is change the version from 0.48 to 0.49+, but for now I simply revert back and the setup is working fine.
c
Could it be because of litellm adding support for an API key: https://github.com/BerriAI/litellm/pull/12495/files
According to Bedrock docs, this is new, from July 16th: https://docs.aws.amazon.com/bedrock/latest/userguide/api-keys-generate.html
n
Good find - I'm guessing there's an issue perhaps with the fact that I've got a dummy API key set for
llm_api_key
in
.openhands/settings.json
looks like perhaps right here I've got to have a key regardless
c
Ahh. Openhands doesn't currently allow an empty/None key... which means, you would need to switch 🤔 because it takes priority in litellm
We should fix this, somehow. Are you normally using the CLI mode or the web app?
n
web app - this might mean though that I can get rid of the typical AWS environment variables (access key, secret key, etc) and just run the newer Bedrock API key (like other LLM providers)
it might make it cleaner and easier to support bedrock with this new change.
c
Hopefully!
Could you please let me know if you try this new api key and it works?
n
I will try to make some time today and report back, hopefully pretty easy to make an API key.
thanks on a stick 1
I got too eager and wanted to test this out... 1. 🚫 set env var
AWS_BEARER_TOKEN_BEDROCK
2. ✅ Directly set the token at key
llm_api_key
in
settings.json
(still retained old env vars for access/secret/region) 3. ✅ Only set
llm_api_key
and remove all prior references to access/secret/region At this point I've got 0.50 running and my settings.json file looks like this, no other AWS keys present in env vars...
Copy code
...
"llm_model": "bedrock/us.anthropic.claude-sonnet-4-20250514-v1:0",
  "llm_api_key": "<long-term-bedrock-api-key>",
  "llm_base_url": "https://bedrock-runtime.us-east-1.amazonaws.com",
...
so, definitely worth further testing but I seem to have a solution to the issue. Appreciate the assist!
c
Thank you!