[Bug]: Setup error
Is there an existing issue for the same bug?
- [X] I have checked the troubleshooting document at https://opendevin.github.io/OpenDevin/modules/usage/troubleshooting
- [X] I have checked the existing issues.
Describe the bug
I ran the docker container and entered my gpt4 (yes i pay) API key but it said i don't have access to the model? i made a new project key and got the same error. i tried gpt4 turbo and got the same error. lmk if you know what I'm missing.
Current Version
ghcr.io/opendevin/opendevin:0.5
Installation and Configuration
none extra
Model and Agent
gpt-4
Reproduction Steps
- Cloned
- Made workspace folder
- Set workspace_base
- Copy pasted docker run from the readme
- Waited
- Selected gpt-4 in pop menu and entered my new project key i made from openAI official website
- It failed :(
Logs, Errors, Screenshots, and Additional Context
I tried again today and it still does not work.
how do you run it?
I cloned the repo --> cd into it --> set workspace_base (export WORKSPACE_BASE=$(pwd)/workspace;) --> docker run command from the readme --> enter api key --> it doesnt work with new api keys (yes i pay for gpt4)
Run this to check whether LLM is working properly.
import tomllib as toml
from litellm import completion
from datetime import datetime
file_path=r'config.toml'
config = toml.load(open(file_path,'rb'))
messages = [{ "content": "If there are 10 books in a room and I read 2, how many books are still in the room?","role": "user"}]
dt = datetime.now()
response = completion(model=config['LLM_MODEL'],
api_key=config['LLM_API_KEY'],
base_url=config.get('LLM_BASE_URL'),
messages=messages)
content = response.choices[0].message.content
print(content)
if '8' in content:
print('--> Correct answer! 🎉')
print('There are still 10 books in the room; reading them does not reduce the count. Consider exploring more accurate models for better results.')
dt2 = datetime.now()
print('Used model:',config['LLM_MODEL'])
print(f"Time taken: {(dt2-dt).total_seconds():.1f}s")
@zlip123 Does it work with gpt-3.5-turbo?
@SmartManoj Do I make this file in the tests folder and download the dependencies and run through terminal?
You can run anywhere.
Run this to check whether LLM is working properly.
from litellm import completion
from datetime import datetime
config = {
'LLM_MODEL': 'gpt-4-turbo-2024-04-09',
'LLM_API_KEY': 'your-api-key',
'LLM_BASE_URL': None
}
messages = [{ "content": "If there are 10 books in a room and I read 2, how many books are still in the room?","role": "user"}]
dt = datetime.now()
response = completion(model=config['LLM_MODEL'],
api_key=config['LLM_API_KEY'],
base_url=config['LLM_BASE_URL'],
messages=messages)
content = response.choices[0].message.content
print(content)
if '8' in content:
print('--> Correct answer! 🎉')
print('There are still 10 books in the room; reading them does not reduce the count. Consider exploring more accurate models for better results.')
dt2 = datetime.now()
print('Used model:',config['LLM_MODEL'])
print(f"Time taken: {(dt2-dt).total_seconds():.1f}s")
Yes, @zlip123 , you can run it through the terminal. This will help test whether it's a problem with your API key or something else.
This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for over 30 days with no activity.