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

How to connect to a host? #18

Open
dk-0206 opened this issue Jun 9, 2024 · 14 comments
Open

How to connect to a host? #18

dk-0206 opened this issue Jun 9, 2024 · 14 comments

Comments

@dk-0206
Copy link

dk-0206 commented Jun 9, 2024

I am completely new to this as I just read about it on reddit. Can someone help me how to connect it to the host or what are the steps to follow for it to work properly as i don't know what to do.

@JHubi1
Copy link
Owner

JHubi1 commented Jun 9, 2024

I assume you have Ollama running on a PC in your local network.

Firstly, follow the steps discussed in #5 to make Ollama accessible from your phone.

After that, you have to find your PCs local IP. You can do that by either going to your router's device list or getting it in windows CMD (just google "windows get local IP").

Then enter the following in the host field: "http://[ip]:11434"

@JHubi1 JHubi1 closed this as completed Jun 10, 2024
@dk-0206
Copy link
Author

dk-0206 commented Jun 16, 2024

Actually I have ollama running on my android 14 (pixel). Can you help what to write in this host. Should i put my ip in place of localhost or my local ip from router?Screenshot_20240616-223912.png

@JHubi1 JHubi1 reopened this Jun 16, 2024
@JHubi1
Copy link
Owner

JHubi1 commented Jun 16, 2024

Have you done something similar to those steps? They seem to work, but I haven't tested it myself

#19 (comment)

@Sandeep-Devleloper
Copy link

yes that ,invalid host problem,i ve searched allover net to find a solution for it ,but i didn't found anything,please help in this connecting to host

@JHubi1
Copy link
Owner

JHubi1 commented Jun 16, 2024

When you enter the host you used into your browser (on your phone), can you access it?

@hackmannbr
Copy link

I may be wrong, but I think there are a few problems there...

  1. if you try to connect to localhost you are trying to connect to ollama server inside in your phone (doesn't exist). You should use your ollama server ip (computer). Since ollama server runs localhost (127.0.0.1) by default, you will need to change ollama server to listening on all local interfaces (0.0.0.0), so you will connect through your computer ip.

  2. Even if you manage to run ollama locally on your phone, I think there is another problem... If I remember correct, android doesn't accept cleartext connection by default (...http), you need to do a small change on android code (AndroidManifest.xml) and set to accept it:

android:usesCleartextTraffic="true"

Cheerz

@JHubi1
Copy link
Owner

JHubi1 commented Jun 19, 2024

I can confirm the first one. As already stated above you have to follow #5 to set the host on the server.

The second one shouldn't be an issue, someone in #19 managed to bring it to work without any modifications.

@makanimike
Copy link

are we allowed to latch onto this issue, or should I create a new one?

I have this issue as well. My ollama is running on my NAS server. I can connect perfectly fine from the same phone using the browser. But in the ollama app it just gives me the "issue: invalid host" error. (and it doesn't even appear to try)

@JHubi1
Copy link
Owner

JHubi1 commented Jun 20, 2024

Nah, writing here is fine.
What text is shown in the browser? The app checks for the content, maybe that's the cause of the issue

@makanimike
Copy link

makanimike commented Jun 20, 2024

If I am not logged in on the phone it just goes to the login screen. Otherwise it goes straight to the main page of ollama.
Screenshot_20240620-131844

I kinda feel like I am misunderstanding your question, perhaps...? :)

@JHubi1
Copy link
Owner

JHubi1 commented Jun 20, 2024

No no, that's exactly what I asked for. But Ollama App (this repo) is a client for Ollama, not for the UI you're using

@makanimike
Copy link

I am running a self-hosted instance of ollama. The truenas scale kubernetes implementation which is just (should be) the docker ollama instance. https://github.com/ollama/ollama

Surely, I must be real thick right now, and missing something incredibly basic....

@JHubi1
Copy link
Owner

JHubi1 commented Jun 20, 2024

The host you entered is not an Ollama host, but a frontend. If the host is correct, it should show this exact message:
Screenshot_20240620-143013~2.png

@makanimike
Copy link

ok. got it.

simple solution in case anyone else runs into this:

in > Settings > Connections you will find the Ollama Base URL which this app wants. You almost certainly only have to replace the port with 11434.

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

No branches or pull requests

5 participants