{"id":823,"date":"2024-11-29T15:09:07","date_gmt":"2024-11-29T06:09:07","guid":{"rendered":"http:\/\/practical.kr\/?p=823"},"modified":"2024-11-29T15:09:07","modified_gmt":"2024-11-29T06:09:07","slug":"complete-guide-from-ollama-installation-to-mobile-app-integration","status":"publish","type":"post","link":"http:\/\/practical.kr\/?p=823","title":{"rendered":"Complete Guide: From Ollama Installation to Mobile App Integration"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">Overview<\/h1>\n\n\n\n<p>This technical guide covers the complete process of setting up Ollama, a local LLM server, including external access configuration and mobile app integration using MyOllama.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Introduction to Ollama<\/h2>\n\n\n\n<p>Ollama is an open-source project enabling local execution of various LLMs (Llama, Mistral, Gemma, etc.) on personal computers. It ensures privacy through local execution and offers API accessibility for various implementations.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. Installation Guide<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">macOS<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">brew install ollama<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Linux (Ubuntu\/Debian)<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">curl -fsSL https:\/\/ollama.com\/install.sh | sh<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Windows<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Download Windows installer from <a href=\"https:\/\/ollama.com\/download\">ollama.com\/download<\/a><\/li>\n\n\n\n<li>Execute installer<\/li>\n\n\n\n<li>Follow installation wizard<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">3. Model Management<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Basic Commands<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Download model\nollama pull llama2\n\n# Run model\nollama run llama2\n\n# List models\nollama list<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">4. External Access Configuration<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">macOS Configuration<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Edit config file\necho \"OLLAMA_HOST=0.0.0.0\" > ~\/.ollama\/config\n\n# Restart service\nollama serve<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Linux (Ubuntu) Configuration<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Create service file\nsudo tee \/etc\/systemd\/system\/ollama.service &lt;&lt; EOF\n[Unit]\nDescription=Ollama Service\nAfter=network.target\n\n[Service]\nExecStart=\/usr\/local\/bin\/ollama serve\nEnvironment=\"OLLAMA_HOST=0.0.0.0\"\nRestart=always\nUser=root\n\n[Install]\nWantedBy=multi-user.target\nEOF\n\n# Enable and start service\nsudo systemctl daemon-reload\nsudo systemctl enable ollama\nsudo systemctl start ollama<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Windows Configuration<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Set environment variable\nsetx OLLAMA_HOST 0.0.0.0\n\n# Restart service\nollama.exe stop\nollama.exe start<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">5. MyOllama Integration<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Installation<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Install from App Store &#8211; <a href=\"https:\/\/apps.apple.com\/us\/app\/my-ollama\/id6738298481\">https:\/\/apps.apple.com\/us\/app\/my-ollama\/id6738298481<\/a><\/li>\n\n\n\n<li>Build from Github &#8211; <a href=\"https:\/\/github.com\/bipark\/my_ollama_app\">https:\/\/github.com\/bipark\/my_ollama_app<\/a><\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image alignwide size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1122\" height=\"600\" src=\"http:\/\/practical.kr\/wp-content\/uploads\/2024\/11\/image_en.jpg\" alt=\"\" class=\"wp-image-825\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Configuration Steps<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Launch MyOllama<\/li>\n\n\n\n<li>Navigate to Settings<\/li>\n\n\n\n<li>Enter Ollama server URL: <code>http:\/\/&lt;your-ip>:11434<\/code><\/li>\n\n\n\n<li>Test connection<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Usage<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Select model from available list<\/li>\n\n\n\n<li>Initialize new conversation<\/li>\n\n\n\n<li>Input prompt to begin interaction<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">6. Troubleshooting Guide<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Common Issues and Solutions<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Connection Issues<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Check service status\nsystemctl status ollama  # Linux\nsudo lsof -i :11434     # macOS\n\n# Verify firewall settings\nsudo ufw status         # Linux\nsudo pfctl -s rules     # macOS<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Model Loading Failures<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Clear model cache\nrm -rf ~\/.ollama\/models\/*\n\n# Verify system resources\nfree -h                 # Memory\ndf -h                   # Disk space<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Security Considerations<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Network Security<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Implement firewall rules<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Ubuntu UFW example\nsudo ufw allow from 192.168.1.0\/24 to any port 11434<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Best Practices<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use VPN for remote access<\/li>\n\n\n\n<li>Regular system updates<\/li>\n\n\n\n<li>Monitor access logs<\/li>\n\n\n\n<li>Implement authentication if needed<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Technical Specifications<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Default Port: 11434<\/li>\n\n\n\n<li>Protocol: HTTP<\/li>\n\n\n\n<li>API Format: REST<\/li>\n\n\n\n<li>Response Format: JSON<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Additional Resources<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/ollama.com\/docs\/api\">API Documentation<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/ollama\/ollama\">GitHub Repository<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/bipark\/my_ollama_app\">MyOllama Source<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Version Information<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Document Version: 1.0.6<\/li>\n\n\n\n<li>Ollama Version: Latest<\/li>\n\n\n\n<li>Last Updated: 2024<\/li>\n<\/ul>\n\n\n\n<p>For technical support or additional information, please create an issue in the respective GitHub repository or consult the official documentation.<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/bipark\/my_ollama_app\">https:\/\/github.com\/bipark\/my_ollama_app<\/a><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview This technical guide covers the complete process of setting up Ollama, a local LLM server, including external access configuration and mobile app integration using MyOllama. 1. Introduction to Ollama Ollama is an open-source project enabling local execution of various LLMs (Llama, Mistral, Gemma, etc.) on personal computers. It ensures privacy through local execution and<\/p>\n<div class=\"more-link\">\n\t\t\t\t <a href=\"http:\/\/practical.kr\/?p=823\" class=\"link-btn theme-btn\"><span>Read More <\/span> <i class=\"fa fa-caret-right\"><\/i><\/a>\n\t\t\t<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[110,1],"tags":[],"class_list":["post-823","post","type-post","status-publish","format-standard","hentry","category-ollama","category-uncategorized"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/practical.kr\/index.php?rest_route=\/wp\/v2\/posts\/823","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/practical.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/practical.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/practical.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/practical.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=823"}],"version-history":[{"count":3,"href":"http:\/\/practical.kr\/index.php?rest_route=\/wp\/v2\/posts\/823\/revisions"}],"predecessor-version":[{"id":827,"href":"http:\/\/practical.kr\/index.php?rest_route=\/wp\/v2\/posts\/823\/revisions\/827"}],"wp:attachment":[{"href":"http:\/\/practical.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=823"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/practical.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=823"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/practical.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=823"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}