Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to use an ollama running on a remote server? #590

Open
JonatanSahar opened this issue Jan 29, 2025 · 2 comments
Open

Is it possible to use an ollama running on a remote server? #590

JonatanSahar opened this issue Jan 29, 2025 · 2 comments
Labels
question Further information is requested

Comments

@JonatanSahar
Copy link

Briefly describe what you are trying to do

I have an Ollam instance running on a remote machine with ollama run [model]. I haven't found a reference to this type of configuration in the manual - is it possible to give a username to access the machine (ssh keys are configured), or by some other method?
Thanks!

Additional context
Emacs version: 29
Operating system: ubuntu

@JonatanSahar JonatanSahar added the question Further information is requested label Jan 29, 2025
@tusharhero
Copy link

tusharhero commented Jan 29, 2025

Yes it is possible. Here is my configuration which does this.

my gptel configuration.

And to expand, you don't need to run ollama run [model] on your remote server. Just make sure the server is running (Its a systemd service by default, or just run ollama serve).

@karthink
Copy link
Owner

karthink commented Jan 29, 2025

is it possible to give a username to access the machine (ssh keys are configured),

If ssh is the only way to access the machine, then you have to use ssh tunneling as @tusharhero does.

If the machine is on your local network, you can access it by IP and run Ollama like this:

OLLAMA_HOST=0.0.0.0 ollama run [model]

If the machine is elsewhere, you can set up a reverse proxy and access it by IP at whatever port you want.


In any case there's nothing special about the configuration in gptel -- you just provide the host and port to gptel-make-ollama, as usual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants