openchatai / copilot

🤖 🔥 Language-to-actions engine
https://open.cx
MIT License
5.07k stars 396 forks source link

connection refused! #635

Open hugo921 opened 8 months ago

hugo921 commented 8 months ago
          > Found out that the 'OPENAI_API_TYPE' value 'llama2' does not work. I also noticed that the `llm = get_llm()` is used 3 times but not used in the code. A llm is used via `chat = get_chat_model()`.

TLDR. To get OpenCopilot working with locally run LLM via Ollama set these variables in the .env file:

OPENAI_API_KEY=unused
CHAT_MODEL=openchat
EMBEDDING_PROVIDER=openchat
LOCAL_IP=http://host.docker.internal
VECTOR_SIZE=4096

i did according your config, but i got the below reply from bot copilot "HTTPConnectionPool(host='localhost', port=11434): Max retries exceeded with url: /api/generate/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f59863faaf0>: Failed to establish a new connection: [Errno 111] Connection refused'))" i dont know why this connection refused?

Originally posted by @hugo921 in https://github.com/openchatai/OpenCopilot/issues/497#issuecomment-1951060507

hugo921 commented 8 months ago

in the above test,I set LOCAL_IP variable as http://localhost ,so I set LOCAL_IP variable as http://host.docker.internal, and then i open the copilot ,chat with him;the progress is below. " bot's avatar Hey Pal! aaa bot's avatar HTTPConnectionPool(host='host.docker.internal', port=11434): Max retries exceeded with url: /api/generate/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f8af4723670>: Failed to establish a new connection: [Errno -2] Name or service not known')) Bot " this time the bot copilot show "Name or service not known"

codebanesr commented 8 months ago

Are you sure openchat model exists ? Try running this on your machine, if that works, then we might have to look into the code

ollama run openchat:latest

hugo921 commented 7 months ago

image openchat mode exists.