{"id":11429,"date":"2024-05-27T12:36:00","date_gmt":"2024-05-27T04:36:00","guid":{"rendered":"https:\/\/www.1ai.net\/?p=11429"},"modified":"2024-05-27T12:36:00","modified_gmt":"2024-05-27T04:36:00","slug":"%e5%bc%80%e6%ba%90%e5%a4%a7%e6%a8%a1%e5%9e%8bllama3%e6%9c%ac%e5%9c%b0%e9%83%a8%e7%bd%b2%e6%95%99%e7%a8%8b%ef%bc%8c%e6%89%93%e9%80%a0%e4%b8%aa%e4%ba%ba%e7%9f%a5%e8%af%86%e5%ba%93","status":"publish","type":"post","link":"https:\/\/www.1ai.net\/en\/11429.html","title":{"rendered":"Open source large model Llama3 local deployment tutorial, build a personal knowledge base"},"content":{"rendered":"<p data-track=\"351\" data-pm-slice=\"0 0 []\"><strong><br \/>\n<a href=\"https:\/\/www.1ai.net\/en\/tag\/ollama\" title=\"_Other Organiser\" target=\"_blank\" >Ollama<\/a><\/strong><\/p>\n<blockquote>\n<p data-track=\"353\"><strong>Official Website<\/strong>: https:\/\/ollama.com\/<\/p>\n<p data-track=\"354\"><strong>Github<\/strong>\uff1ahttps:\/\/github.com\/ollama\/ollama<\/p>\n<p data-track=\"355\">\n<\/blockquote>\n<p data-track=\"356\">Ollama is a<a href=\"https:\/\/www.1ai.net\/en\/tag\/%e5%bc%80%e6%ba%90\" title=\"[View articles tagged with [open source]]\" target=\"_blank\" >Open Source<\/a>Platform for managing and running various large language models (LLMs), such as <a href=\"https:\/\/www.1ai.net\/en\/tag\/llama3\" title=\"_Other Organiser\" target=\"_blank\" >Llama3<\/a>, gemma and qwen.<\/p>\n<p data-track=\"357\">It provides a command line interface (CLI) for installation, model management, and interaction.<\/p>\n<p data-track=\"359\">You can use Ollama to download, load, and run different LLM models based on your needs.<\/p>\n<p data-track=\"360\"><strong># Windows Installation<\/strong><\/p>\n<blockquote>\n<p data-track=\"361\">Requirements: Windows 10 or above operating system<\/p>\n<p data-track=\"362\">Installation package download address: https:\/\/ollama.com\/download\/windows<\/p>\n<p data-track=\"363\">\n<\/blockquote>\n<p data-track=\"364\">Download the corresponding system installation package<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11404\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/05\/get-633.jpg\" alt=\"\" width=\"1129\" height=\"1186\" \/><\/div>\n<p data-track=\"367\">After the download is complete, double-click the downloaded installer<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11402\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/05\/get-631.jpg\" alt=\"\" width=\"917\" height=\"694\" \/><\/div>\n<p data-track=\"370\">Click Install to install<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11403\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/05\/get-632.jpg\" alt=\"\" width=\"928\" height=\"682\" \/><\/div>\n<p data-track=\"373\">After the installation is complete, open a terminal and enter the following command in the terminal to run a large language model for testing. Here we take Qianwen, which performs relatively well in Chinese, as an example:<\/p>\n<pre><code>ollama run qwen<\/code><\/pre>\n<p data-track=\"376\">The model will be downloaded first when it is run for the first time. After the download is complete, you can ask questions<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11405\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/05\/get-634.jpg\" alt=\"\" width=\"1049\" height=\"658\" \/><\/div>\n<p data-track=\"378\">Once the model is downloaded, we can use it by entering questions in the terminal:<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11406\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/05\/get-635.jpg\" alt=\"\" width=\"1058\" height=\"647\" \/><\/div>\n<p data-track=\"379\"><strong>So far, we ordinary people can also use AI<a href=\"https:\/\/www.1ai.net\/en\/tag\/%e5%a4%a7%e6%a8%a1%e5%9e%8b\" title=\"[View articles tagged with [large models]]\" target=\"_blank\" >Large Model<\/a>Question and answer session!!!<\/strong><\/p>\n<p data-track=\"380\"><strong>#Docker installation<\/strong><\/p>\n<p data-track=\"381\"><strong>\u2460Docker deployment<\/strong><\/p>\n<pre><code># Only CPU uses this docker run -itd --name ollama -v ollama:\/root\/.ollama -p 11434:11434 ollama\/ollama # There is a GPU and use this docker run -itd --name ollama --restart always --gpus=all -v \/home\/suxy\/ollama:\/root\/.ollama -p 11434:11434 ollama\/ollama<\/code><\/pre>\n<p data-track=\"384\"><strong>\u2461 Pull the model and run it<\/strong><\/p>\n<pre><code># Qianwen 4b docker exec -it ollama ollama run qwen #llama3 docker exec -it ollama ollama run llama3 #gemma docker exec -it ollama ollama run gemma<\/code><\/pre>\n<p data-track=\"387\">When you pull a model for the first time, you will first download the model. After the model is downloaded, you can start a conversation. The example is as follows:<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11407\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/05\/get-636.jpg\" alt=\"\" width=\"1074\" height=\"539\" \/><\/div>\n<p data-track=\"390\"><strong>\u2462Other models<\/strong><\/p>\n<p data-track=\"391\">You can view:<u>https:\/\/ollama.ai\/library<\/u><\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11408\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/05\/get-637.jpg\" alt=\"\" width=\"1080\" height=\"482\" \/><\/div>\n<p data-track=\"394\">You can also download models with different parameter levels according to your needs.<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11409\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/05\/get-638.jpg\" alt=\"\" width=\"1079\" height=\"475\" \/><\/div>\n<p data-track=\"397\"><strong>Open WebUI<\/strong><\/p>\n<p data-track=\"400\">The above can only be used in the terminal, and the operation interface is not as beautiful as ChatGPT. If you can use the web page to interact, the user experience will be better, and you can also keep the previous chat records and look through them for inquiries.<\/p>\n<p data-track=\"402\">In this case, deploying the Open WebUI project can implement an interactive interface similar to chatgpt.<\/p>\n<p data-track=\"404\">This tutorial takes the Open WebUI project as an example. It was formerly known as Formerly Ollama WebUI and is specifically adapted for Ollama&#039;s WebUI.<\/p>\n<blockquote>\n<p data-track=\"405\">Official documentation: https:\/\/docs.openwebui.com\/getting-started\/<\/p>\n<p data-track=\"406\">Github: https:\/\/github.com\/open-webui\/open-webui<\/p>\n<\/blockquote>\n<p data-track=\"407\"><strong>#docker quick deployment<\/strong><\/p>\n<p data-track=\"408\">Execute the following command<\/p>\n<pre><code>The # example uses ollama-webui docker run -itd --name ollama-webui --restart always -p 3500:8080 --add-host=host.docker.internal:host-gateway ghcr.io\/ollama-webui\/ ollama-webui:latest # or docker run -itd --name open-webui --restart always -p 3500:8080 --add-host=host.docker.internal:host-gateway -v open-webui:\/app\/ backend\/data ghcr.io\/open-webui\/open-webui:latest<\/code><\/pre>\n<p data-track=\"410\">After successful deployment, the browser opens the connection:<u>http:\/\/127.0.0.1:3500<\/u><\/p>\n<p data-track=\"412\">First time login, create an account first<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11410\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/05\/get-639.jpg\" alt=\"\" width=\"844\" height=\"590\" \/><\/div>\n<p data-track=\"414\">Click sign up to register, and remember your account, email address, and password. You will need to use your email address and password to log in next time:<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11411\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/05\/get-640.jpg\" alt=\"\" width=\"1120\" height=\"910\" \/><\/div>\n<p data-track=\"416\">Then click create account to create an account, and then you can use the Open WebUI similar to the chatgpt interface in the browser!<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11412\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/05\/get-641.jpg\" alt=\"\" width=\"1075\" height=\"536\" \/><\/div>\n<p data-track=\"418\">Add and click on the settings in the upper right corner to set the ollama service installed above, for example:<u>http:\/\/localhost:11434\/api<\/u><\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11413\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/05\/get-642.jpg\" alt=\"\" width=\"1078\" height=\"700\" \/><\/div>\n<p data-track=\"420\">At the same time, you can download the model you want to install on the page. After clicking the download button, you can see the download progress<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11414\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/05\/get-643.jpg\" alt=\"\" width=\"1079\" height=\"718\" \/><\/div>\n<p data-track=\"422\">Click select a model to select which installed model to use<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11415\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/05\/get-644.jpg\" alt=\"\" width=\"1079\" height=\"448\" \/><\/div>\n<p data-track=\"425\">Next, you can chat happily with AI!<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11416\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/05\/get-645.jpg\" alt=\"\" width=\"1080\" height=\"532\" \/><\/div>\n<p data-track=\"427\"><strong>AnythingLLM<\/strong><\/p>\n<blockquote>\n<p data-track=\"429\">Official documentation: https:\/\/docs.useanything.com\/<\/p>\n<p data-track=\"430\">Github: https:\/\/github.com\/Mintplex-Labs\/anything-llm<\/p>\n<\/blockquote>\n<p data-track=\"432\">AnythingLLM is an open source, efficient, and customizable private knowledge base solution built on the RAG (Retrieval-Augmented Generation) solution. You can use commercial off-the-shelf LLM or popular open source LLM and vectorDB solutions to build private ChatGPT<\/p>\n<p data-track=\"433\"><strong># download and install AnythingLLM<\/strong><\/p>\n<blockquote>\n<p data-track=\"434\">Official installation tutorial: https:\/\/docs.useanything.com\/anythingllm-desktop\/windows-instructions<\/p>\n<p data-track=\"435\">Installation package download address: https:\/\/useanything.com\/download<\/p>\n<\/blockquote>\n<p data-track=\"436\">This example takes Windows as an example:<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11417\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/05\/get-646.jpg\" alt=\"\" width=\"772\" height=\"535\" \/><\/div>\n<p data-track=\"438\">After the installation package is downloaded, double-click the installation package to install it.<\/p>\n<p data-track=\"439\">Because I have already configured it, it is difficult to take a screenshot of the initial configuration interface, but you can find it in the settings<\/p>\n<p data-track=\"440\"><strong># configuration LLM<\/strong><\/p>\n<p data-track=\"441\">AnythingLLM supports LLMs such as OpenAI, LocalAi, Ollama, etc.<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11418\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/05\/get-647.jpg\" alt=\"\" width=\"963\" height=\"468\" \/><\/div>\n<p data-track=\"443\">Select Ollama as the background service here, and fill in the URL here<u>http:\/\/127.0.0.1:11434<\/u>, which is the service port started by Ollama above. After filling in the LLM model, select llama3<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11419\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/05\/get-648.jpg\" alt=\"\" width=\"1075\" height=\"519\" \/><\/div>\n<p data-track=\"444\"><strong># configuration Embedding Model<\/strong><\/p>\n<p data-track=\"445\">The Embedding Models supported by AnythingLLM include: AnythingLLM Native Embedder (default), OpenAi, LocalAi, Ollama, etc.<\/p>\n<p data-track=\"447\">Here we also select Ollama as the background service and fill in the URL here<u>http:\/\/127.0.0.1:11434<\/u>After filling in the Embedding Model, select nomic-embed-text:latest:<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11420\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/05\/get-649.jpg\" alt=\"\" width=\"1066\" height=\"531\" \/><\/div>\n<p data-track=\"448\"><strong># Configure Vector Datebase<\/strong><\/p>\n<p data-track=\"449\">The vector databases supported by AnythingLLM are: LanceDB (default), Astra DB, Pinecone, Chroma, Weaviate, QDrant, Milvus, Zilliz, etc.<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11421\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/05\/get-650.jpg\" alt=\"\" width=\"1077\" height=\"542\" \/><\/div>\n<p data-track=\"451\"><strong>After completing the above three key configurations, you can start using AnythingLLM!!!<\/strong><\/p>\n<p data-track=\"453\">Click New Workspace to create a new document library and fill in the name<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11422\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/05\/get-651.jpg\" alt=\"\" width=\"1079\" height=\"528\" \/><\/div>\n<p data-track=\"455\">Click the Upload Files button to start adding documents:<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11423\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/05\/get-652.jpg\" alt=\"\" width=\"1074\" height=\"503\" \/><\/div>\n<p data-track=\"457\">Now you can ask questions based on the content of the document.<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11424\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/05\/get-653.jpg\" alt=\"\" width=\"1066\" height=\"545\" \/><\/div>\n<p>&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>Ollama Official Website: https:\/\/ollama.com\/ Github: https:\/\/github.com\/ollama\/ollama Ollama is an open source platform for managing and running a variety of Large Language Models (LLMs), such as Llama3, gemma, and qwen. It provides a command line interface (CLI) for installation, model management, and interaction. You can use Ollama to download, load and run different LLM models according to your needs. #Windows Installation Requirements: Win10 or higher Operating System Installation package download at: https:\/\/ollama.com\/download<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[149,144],"tags":[2403,2405,216,219],"collection":[],"class_list":["post-11429","post","type-post","status-publish","format-standard","hentry","category-jiaocheng","category-baike","tag-llama3","tag-ollama","tag-216","tag-219"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts\/11429","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/comments?post=11429"}],"version-history":[{"count":0,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts\/11429\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/media?parent=11429"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/categories?post=11429"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/tags?post=11429"},{"taxonomy":"collection","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/collection?post=11429"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}