{"id":44,"date":"2024-05-09T21:34:08","date_gmt":"2024-05-09T21:34:08","guid":{"rendered":"https:\/\/dashbenton.com\/blog\/?p=44"},"modified":"2024-05-09T21:58:38","modified_gmt":"2024-05-09T21:58:38","slug":"how-to-run-your-ai-locally-in-windows-and-linux-no-internet","status":"publish","type":"post","link":"https:\/\/dashbenton.com\/blog\/2024\/05\/09\/how-to-run-your-ai-locally-in-windows-and-linux-no-internet\/","title":{"rendered":"How To: Run Your AI Locally in Windows and Linux (No Internet)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In taday&#8217;s &#8220;How To,&#8221; we will be running my own AI locally; no internet required. To start, go to <a href=\"http:\/\/ollama.ai\" data-type=\"link\" data-id=\"ollama.ai\">ollama.ai<\/a> or <a href=\"http:\/\/ollama.com\" data-type=\"link\" data-id=\"ollama.com\">ollama.com<\/a>. If you are on Windows, do <strong>not<\/strong> click Windows (Preview). Instead, Install WSL (Windows Subsystem for Linux) using these commands (in CMD or PS):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ps\nwsl --install<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After that, in the Start Menu, search &#8220;Ubuntu&#8221; and open it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Install Ollama<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1a. Windows<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Open WSL and type: curl -fsSL https:\/\/ollama.com\/install.sh | sh<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1c. Linux<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Open Terminal and type: curl -fsSL https:\/\/ollama.com\/install.sh | sh<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. Is Ollama running?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To test if it is running, go to <a href=\"https:\/\/localhost:11434\/\">https:\/\/localhost:11434\/<\/a> and if it says &#8220;Ollama is running&#8221;, then it&#8217;s running!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. Install a model<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After installing, open the Terminal\/WSL and type: ollama pull llama3<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This will download llama3 (4.8GB), the latest Llama model.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4. Test<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After downloading, type ollama run llama3<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now, you can type with an AI in the command line.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">5. Install Open WebUI<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To install Open WebUI, a UI on the web, type these three commands to install Docker&#8230;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done\ncurl -fsSL https:\/\/get.docker.com -o get-docker.sh\nsudo sh get-docker.sh<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&#8230;and now install Open WebUI using this one command&#8230;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo docker run -d -p 3000:8080 -e OLLAMA_API_BASE_URL=http:\/\/127.0.0.1:11434\/api -v open-webui:\/app\/backend\/data --name open-webui --restart always ghcr.io\/open-webui\/open-webui:main<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, go to <a href=\"https:\/\/127.0.0.1:3000\">https:\/\/127.0.0.1:3000<\/a> to go to Open WebUI.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">6. Set Up Open WebUI<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To start go to <a href=\"https:\/\/127.0.0.1:3000\">https:\/\/127.0.0.1:3000<\/a> and click &#8220;Sign Up&#8221;. Enter your details and click Sign Up. For other users, you, the first one signing up, is automatically an admin. The other users can only have access if you go to the &#8220;admin panel&#8221; (user -> Admin Panel) and turn the user from &#8220;pending&#8221; to &#8220;user&#8221; or &#8220;admin&#8221;.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Optional: Make it Accessible from All Locations<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Optionally, install ngrok to make localhost:3000 a website that anyone could visit anywhere, anytime.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In conclusion, you can run an AI locally downloading files and using the Ollama service.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In taday&#8217;s &#8220;How To,&#8221; we will be running my own AI locally; no internet required. To start, go to ollama.ai or ollama.com. If you are on Windows, do not click Windows (Preview). Instead, Install WSL (Windows Subsystem for Linux) using these commands (in CMD or PS): After that, in the Start Menu, search &#8220;Ubuntu&#8221; and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-44","post","type-post","status-publish","format-standard","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/dashbenton.com\/blog\/wp-json\/wp\/v2\/posts\/44","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dashbenton.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dashbenton.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dashbenton.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dashbenton.com\/blog\/wp-json\/wp\/v2\/comments?post=44"}],"version-history":[{"count":3,"href":"https:\/\/dashbenton.com\/blog\/wp-json\/wp\/v2\/posts\/44\/revisions"}],"predecessor-version":[{"id":47,"href":"https:\/\/dashbenton.com\/blog\/wp-json\/wp\/v2\/posts\/44\/revisions\/47"}],"wp:attachment":[{"href":"https:\/\/dashbenton.com\/blog\/wp-json\/wp\/v2\/media?parent=44"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dashbenton.com\/blog\/wp-json\/wp\/v2\/categories?post=44"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dashbenton.com\/blog\/wp-json\/wp\/v2\/tags?post=44"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}