mattvr / ShellGPT

Upgrade your terminal with GPT-4. Ask questions, automate commands, pipe I/O, etc. Made with Deno.
MIT License
232 stars 11 forks source link

Allow to set a custom OpenAI endpoint URL #14

Closed felipecrs closed 8 months ago

felipecrs commented 8 months ago

Which would be super useful to pair with https://github.com/aaamoon/copilot-gpt4-service.

mattvr commented 8 months ago

Hey @felipecrs, I just added support for changing the API URL in 0.3.6. You can set the environment variable for OPENAI_CHAT_URL and it will use that. Let me know if that works for you!

felipecrs commented 8 months ago

That's awesome! Thanks a lot.

felipecrs commented 8 months ago

BTW works like a charm!

❯ docker run -d --name copilot-gpt4-service -p 8080:8080 aaamoon/copilot-gpt4-service:latest
❯ export OPENAI_API_KEY="ghu_***"
❯ export OPENAI_CHAT_URL="http://localhost:8080/v1/chat/completions"
❯ gpt 'hi who are you'
I'm OpenAI's artificial intelligence assistant. I can help answer questions, provide information, and assist with various tasks.

It would be extra great to be able to set these in the config file as well, but don't worry, no rush.