[GH-ISSUE #3238] Add a google colab notebook link to the github for new users. #1997

Closed
opened 2026-04-12 12:11:43 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @jquintanilla4 on GitHub (Mar 19, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/3238

What are you trying to do?

Every once in a while people will ask about how to get Ollama running on Google Colab, either for doing dev work inside of Colab or as a remote GPU. I think if the github repo had a one click button to a notebook, it would solve this evergreen question on the community.

How should we solve this?

I created a notebook and tested it to solve this issue.
https://colab.research.google.com/drive/1-K00WnTdDJC2JCuFNLKKa-ScmcDWi1Nw?usp=sharing

What is the impact of not solving this?

Always pasting the link on discord.

Anything else?

Happy to make edits.

Originally created by @jquintanilla4 on GitHub (Mar 19, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/3238 ### What are you trying to do? Every once in a while people will ask about how to get Ollama running on Google Colab, either for doing dev work inside of Colab or as a remote GPU. I think if the github repo had a one click button to a notebook, it would solve this evergreen question on the community. ### How should we solve this? I created a notebook and tested it to solve this issue. https://colab.research.google.com/drive/1-K00WnTdDJC2JCuFNLKKa-ScmcDWi1Nw?usp=sharing ### What is the impact of not solving this? Always pasting the link on discord. ### Anything else? Happy to make edits.
Author
Owner

@mxyng commented on GitHub (Mar 19, 2024):

Thanks for the issue but we're not looking to add buttons into the repo at this time. A jupyter notebook example is provided here which can be imported into colab

<!-- gh-comment-id:2006431403 --> @mxyng commented on GitHub (Mar 19, 2024): Thanks for the issue but we're not looking to add buttons into the repo at this time. A jupyter notebook example is provided [here](https://github.com/ollama/ollama/tree/main/examples/jupyter-notebook) which can be imported into colab
Author
Owner

@jquintanilla4 commented on GitHub (Mar 19, 2024):

the jupyter notebook example is outdated; ngrok now requires a token to function inside of google colab. The notebook in the document also doesn't account for people that may want to develop inside of google colab.

Should i do PR to update it, or do you guys wanna handle that in-house?

<!-- gh-comment-id:2006633787 --> @jquintanilla4 commented on GitHub (Mar 19, 2024): the jupyter notebook example is outdated; ngrok now requires a token to function inside of google colab. The notebook in the document also doesn't account for people that may want to develop inside of google colab. Should i do PR to update it, or do you guys wanna handle that in-house?
Author
Owner

@jquintanilla4 commented on GitHub (Mar 19, 2024):

It also seems that either Google colab is no longer allowing incoming connections or ollama no longer works well with google colab as a host for the model. I continually get the same error every time i try to run an ollama command.

It didn't use to be like this a few months ago. So something broke on one side or the other. I've tried troubleshooting it with multiple computers and different network connections. I've tried running the code multiple different ways. Still same issue "403".

On my local machine:
Error: something went wrong, please see the ollama server logs for details

On google collab:

t=2024-03-19T14:27:50+0000 lvl=info msg="join connections" obj=join id=79e6e5abc953 l=127.0.0.1:11434 r=13.112.162.81:20803
[GIN] 2024/03/19 - 14:27:50 | 403 |      29.101µs |   13.112.162.81 | HEAD     "/"
t=2024-03-19T14:27:55+0000 lvl=info msg="join connections" obj=join id=5fb01b39a16f l=127.0.0.1:11434 r=13.112.162.81:28345
[GIN] 2024/03/19 - 14:27:55 | 403 |      28.672µs |   13.112.162.81 | HEAD     "/"
t=2024-03-19T14:34:29+0000 lvl=info msg="join connections" obj=join id=26bd347ea979 l=127.0.0.1:11434 r=35.72.149.104:29315
[GIN] 2024/03/19 - 14:34:29 | 403 |        28.3µs |   35.72.149.104 | GET      "/"
t=2024-03-19T14:34:39+0000 lvl=info msg="join connections" obj=join id=2e421b419332 l=127.0.0.1:11434 r=35.72.149.104:27865
[GIN] 2024/03/19 - 14:34:39 | 403 |      28.137µs |   35.72.149.104 | GET      "/"
t=2024-03-19T14:34:44+0000 lvl=info msg="join connections" obj=join id=8752538dfb07 l=127.0.0.1:11434 r=13.112.180.81:20171
[GIN] 2024/03/19 - 14:34:44 | 403 |      27.152µs |   13.112.180.81 | GET      "/"
t=2024-03-19T14:34:49+0000 lvl=info msg="join connections" obj=join id=a8544ecbf7c5 l=127.0.0.1:11434 r=13.112.162.81:16007
[GIN] 2024/03/19 - 14:34:49 | 403 |      30.361µs |   13.112.162.81 | GET      "/"
<!-- gh-comment-id:2007420588 --> @jquintanilla4 commented on GitHub (Mar 19, 2024): It also seems that either Google colab is no longer allowing incoming connections or ollama no longer works well with google colab as a host for the model. I continually get the same error every time i try to run an ollama command. It didn't use to be like this a few months ago. So something broke on one side or the other. I've tried troubleshooting it with multiple computers and different network connections. I've tried running the code multiple different ways. Still same issue "403". On my local machine: `Error: something went wrong, please see the ollama server logs for details` On google collab: ``` t=2024-03-19T14:27:50+0000 lvl=info msg="join connections" obj=join id=79e6e5abc953 l=127.0.0.1:11434 r=13.112.162.81:20803 [GIN] 2024/03/19 - 14:27:50 | 403 | 29.101µs | 13.112.162.81 | HEAD "/" t=2024-03-19T14:27:55+0000 lvl=info msg="join connections" obj=join id=5fb01b39a16f l=127.0.0.1:11434 r=13.112.162.81:28345 [GIN] 2024/03/19 - 14:27:55 | 403 | 28.672µs | 13.112.162.81 | HEAD "/" t=2024-03-19T14:34:29+0000 lvl=info msg="join connections" obj=join id=26bd347ea979 l=127.0.0.1:11434 r=35.72.149.104:29315 [GIN] 2024/03/19 - 14:34:29 | 403 | 28.3µs | 35.72.149.104 | GET "/" t=2024-03-19T14:34:39+0000 lvl=info msg="join connections" obj=join id=2e421b419332 l=127.0.0.1:11434 r=35.72.149.104:27865 [GIN] 2024/03/19 - 14:34:39 | 403 | 28.137µs | 35.72.149.104 | GET "/" t=2024-03-19T14:34:44+0000 lvl=info msg="join connections" obj=join id=8752538dfb07 l=127.0.0.1:11434 r=13.112.180.81:20171 [GIN] 2024/03/19 - 14:34:44 | 403 | 27.152µs | 13.112.180.81 | GET "/" t=2024-03-19T14:34:49+0000 lvl=info msg="join connections" obj=join id=a8544ecbf7c5 l=127.0.0.1:11434 r=13.112.162.81:16007 [GIN] 2024/03/19 - 14:34:49 | 403 | 30.361µs | 13.112.162.81 | GET "/" ```
Author
Owner

@atul-ai commented on GitHub (Apr 23, 2024):

This is a big pain for me right now, I want to use ollama for a small llm-related tutorial and I am trying to install it on a Colab with gemma:2b for ease of use.
Based on responses, it is unclear if this still works.

<!-- gh-comment-id:2071427748 --> @atul-ai commented on GitHub (Apr 23, 2024): This is a big pain for me right now, I want to use ollama for a small llm-related tutorial and I am trying to install it on a Colab with gemma:2b for ease of use. Based on responses, it is unclear if this still works.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#1997