Skip to content

Hack Term Chat to use ollama+codellama, OpenAI, groq.com, etc (any OpenAI compat completions API)

Notifications You must be signed in to change notification settings

g0t4/term-chat-ollama

Repository files navigation

video

how to use this

terminal chat src code:

See features/llm branch: https://github.com/microsoft/terminal/blob/938b3ec2f2f5e1ba37a951dfdee078b1a7a40394/src/cascadia/QueryExtension/ExtensionPalette.cpp#L26

Win Terminal Chat Settings => Endpoint Examples

commands

# curls
curl -v -k -X POST "https://localhost:5000/fake" # -k/--insecure (no verify cert)
curl --ssl-revoke-best-effort https://fake.openai.azure.com:5000/fake # ignore missing CRL (revocation) but still verify cert => https://superuser.com/questions/1800816/

# mkcert
winget install FiloSottile.mkcert
mkcert -install
mkcert -cert-file cert.pem -key-file key.pem fake.openai.azure.com localhost 127.0.0.1 ::1 # I also added 192.168.1.X 

# /etc/hosts
notepad C:\Windows\System32\drivers\etc\hosts
# add:
# 127.0.0.1 fake.openai.azure.com

# mitmproxy
mitmproxy --insecure # ignore self-signed certs if using mitmproxy to snoop on traffic to/from dotnet api intermediate (BE VERY CAREFUL w/ this)

About

Hack Term Chat to use ollama+codellama, OpenAI, groq.com, etc (any OpenAI compat completions API)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages