OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

Unable to change language model in OpenDevin UI

Open CmetankaJDD opened this issue 1 year ago • 2 comments

Describe the bug

When I try to change the language model in the OpenDevin UI menu, I receive the error message "You can find your API key at https://platform.openai.com/account/api-keys.", "type": "invalid_request_error", "param": None, "code": "invalid_api_key"}. This occurs when I attempt to select a different AI model, not the OpenAI model.

Setup and configuration

Current version: Latest version

My operating system: Ubuntu 20.04 LTS

My environment vars and other configuration (be sure to redact API keys):

export LLM_API_KEY="sk-..."
export WORKSPACE_DIR=$(pwd)/workspace

My model and agent (you can see these settings in the UI):

  • Model: [Non-OpenAI model]
  • Agent: Default

Commands I ran to install and run OpenDevin:

docker run \
    -e LLM_API_KEY \
    -e WORKSPACE_MOUNT_PATH=$WORKSPACE_DIR \
    -v $WORKSPACE_DIR:/opt/workspace_base \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -p 3000:3000 \
    ghcr.io/opendevin/opendevin:latest

Steps to Reproduce:

  1. Start OpenDevin using the provided Docker command.
  2. In the UI, navigate to the model selection menu.
  3. Attempt to change the language model to a non-OpenAI model.

Logs, error messages, and screenshots:

"You can find your API key at https://platform.openai.com/account/api-keys.", "type": "invalid_request_error", "param": None, "code": "invalid_api_key"}

Additional Context

It seems that the issue is related to an invalid API key. Please ensure that you are using the correct API key, which can be found at https://platform.openai.com/account/api-keys. If the issue persists, try verifying that your API key is valid and has the necessary permissions to use the selected non-OpenAI language model. 2024-04-16_20 11 51

CmetankaJDD avatar Apr 16 '24 19:04 CmetankaJDD

I'm able to repro. Investigating 👀

rbren avatar Apr 16 '24 21:04 rbren

Try with:

docker run
-e LLM_API_KEY=$LLM_API_KEY
-e WORKSPACE_MOUNT_PATH=$WORKSPACE_DIR
-v $WORKSPACE_DIR:/opt/workspace_base
-v /var/run/docker.sock:/var/run/docker.sock
-p 3000:3000
ghcr.io/opendevin/opendevin:latest

v4codeit avatar Apr 17 '24 02:04 v4codeit