{"id":46944,"date":"2024-07-25T14:19:19","date_gmt":"2024-07-25T14:19:19","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=46944"},"modified":"2024-07-25T14:23:28","modified_gmt":"2024-07-25T14:23:28","slug":"alpaca-gtk4-app-chat-ai-offline","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2024\/07\/alpaca-gtk4-app-chat-ai-offline\/","title":{"rendered":"Alpaca &#8211; New GTK4 App to Chat with AI Offline"},"content":{"rendered":"<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-logo.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-46945\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-logo-250x250.webp\" alt=\"\" width=\"250\" height=\"250\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-logo-250x250.webp 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-logo-300x300.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-logo-700x700.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-logo-768x768.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-logo.webp 1200w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>Want to chat with AI models locally without internet connection? Here&#8217;s a simple app can do the job in Linux Desktop!<\/p>\n<p>It&#8217;s <a href=\"https:\/\/github.com\/Jeffser\/Alpaca\" target=\"_blank\" rel=\"noopener\">Alpaca<\/a>, a free open-source application written in Python programming language. It uses <a href=\"https:\/\/github.com\/ollama\/ollama\" target=\"_blank\" rel=\"noopener\">Ollama<\/a> as backend to manage and chat with multiple AI models, without needing any API keys.<\/p>\n<p>By using GTK4 plus Adwaita toolkits, it provides a modern and simple graphical interface that&#8217;s well integrated into Ubuntu, Fedora Workstation and other Linux with GNOME desktop.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-light.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-46946\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-light-700x516.webp\" alt=\"\" width=\"610\" height=\"450\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-light-700x516.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-light-300x221.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-light-768x566.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-light-1320x973.webp 1320w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-light.webp 1410w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><br \/>\n<!--more--><\/p>\n<p><b>The app downloads the AI models to your local computer, so you can chat locally without privacy concerns.<\/b><\/p>\n<p>It features <b>Meta Llama 3<\/b>, <b>Google Gemma 2<\/b>, <b>Microsoft Phi3<\/b>, <b>Llava<\/b> AI models in the first launch welcome dialog. While, there are lots of other AI models available in the management dialog, including Alibaba Qwen2, Deepseek Coder V2, Mistral AI,\u00a0 Command R, Openchat, and more!<\/p>\n<p>It as well supports importing AI models from GGUF files, though the feature is experimental at the moment of writing.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-manage-aimodels.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-46947\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-manage-aimodels-700x454.webp\" alt=\"\" width=\"610\" height=\"396\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-manage-aimodels-700x454.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-manage-aimodels-300x195.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-manage-aimodels-768x498.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-manage-aimodels-1320x856.webp 1320w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-manage-aimodels.webp 1422w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>Alpaca allows you to chat with multiple AI models in same conversation, supports image recognition (with compatible models), document recognition, code highlighting, YouTube recognition, PDF and Website recognition. As well, it supports importing and exporting your chats.<\/p>\n<div id=\"attachment_46948\" style=\"width: 620px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-image.webp\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-46948\" class=\"size-large wp-image-46948\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-image-700x513.webp\" alt=\"\" width=\"610\" height=\"447\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-image-700x513.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-image-300x220.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-image-768x563.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-image.webp 1122w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><p id=\"caption-attachment-46948\" class=\"wp-caption-text\">image from Alpaca github page<\/p><\/div>\n<p>As the AI models are stored in local system, the data <strong>can take dozens of GB disk space<\/strong>, depends on how many models you downloaded. And, it can cause high CPU usage (especially for low end PC) while answering your questions.<\/p>\n<p>For choice, user can setup Ollama server in another machine, then use this app to connect remotely.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-foldersize.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-46949\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-foldersize.webp\" alt=\"\" width=\"602\" height=\"648\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-foldersize.webp 602w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/alpaca-foldersize-279x300.webp 279w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><\/a><\/p>\n<h3>How to Install Alpaca:<\/h3>\n<p>Alpaca is available to install as <a href=\"https:\/\/flathub.org\/apps\/com.jeffser.Alpaca\" target=\"_blank\" rel=\"noopener\">Flatpak package<\/a> that runs in sandbox environment.<\/p>\n<p><strong>Linux Mint (since 21.x)<\/strong> and <strong>Fedora 38+<\/strong> (with 3rd party repository enabled) can directly search for and install it from either Software Manager or GNOME Software.<\/p>\n<p>While other Linux can follow the steps below one by one to install.<\/p>\n<h4>1. Enable Flatpak Support<\/h4>\n<p>For Ubuntu, Debian, and their based systems, open terminal (Ctrl+Alt+T) and run command to enable Flatpak package support:<\/p>\n<pre>sudo apt install flatpak<\/pre>\n<p>While other Linux can follow this <a href=\"https:\/\/flatpak.org\/setup\/\" target=\"_blank\" rel=\"noopener\">setup guide<\/a> to get it supported.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/apt-flatpak-noble.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45732\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/apt-flatpak-noble-700x501.webp\" alt=\"\" width=\"610\" height=\"437\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/apt-flatpak-noble-700x501.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/apt-flatpak-noble-300x215.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/apt-flatpak-noble-768x550.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/apt-flatpak-noble.webp 786w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<h4>2. Install the Flatpak package<\/h4>\n<p>Once you got the file format support, you may then run the command below to install the AI chatting app:<\/p>\n<pre>flatpak install https:\/\/dl.flathub.org\/repo\/appstream\/com.jeffser.Alpaca.flatpakref<\/pre>\n<p>Or, go to <a href=\"https:\/\/flathub.org\/apps\/com.jeffser.Alpaca\" target=\"_blank\" rel=\"noopener\">this page<\/a>, download the installer file, finally run <code>flatpak install \/path\/to\/flatpak-file<\/code> to install.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/flaptak-alpaca.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-46950\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/flaptak-alpaca.webp\" alt=\"\" width=\"674\" height=\"475\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/flaptak-alpaca.webp 674w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/flaptak-alpaca-300x211.webp 300w\" sizes=\"auto, (max-width: 674px) 100vw, 674px\" \/><\/a><\/p>\n<p>After installed the package, you can search for and launch the app from either start menu or Gnome Overview depends on your desktop environment.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/launch-alpaca.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-46951\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/launch-alpaca.webp\" alt=\"\" width=\"584\" height=\"282\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/launch-alpaca.webp 584w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/launch-alpaca-300x145.webp 300w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a><\/p>\n<p>If you don&#8217;t see the app icon, try either log out and back in, or run the command below instead to start it from terminal:<\/p>\n<pre>flatpak run com.jeffser.Alpaca<\/pre>\n<h4>3. Update the package<\/h4>\n<p>Your system software manager may not support updating Flatpak app packages. In the case, open terminal and use the command below instead to check updates:<\/p>\n<pre>flatpak update com.jeffser.Alpaca<\/pre>\n<h4>4. Configure App Permissions (Optional)<\/h4>\n<p>At first launch of Alpaca app, you need internet connection to download AI models, unless you intend to use remote Ollama instance for chatting backend.<\/p>\n<p>After that, you can even disable network access permission for this app, by doing following steps:<\/p>\n<ul>\n<li>First, run command to install Flatseal:\n<pre>flatpak install https:\/\/dl.flathub.org\/repo\/appstream\/com.github.tchx84.Flatseal.flatpakref<\/pre>\n<\/li>\n<li>Then, launch Flatseal, navigate to &#8220;Alpaca&#8221; in left side-bar, finally turn off the network toggle option.<a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/configure-alpaca-permissions.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-46952\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/configure-alpaca-permissions-700x458.webp\" alt=\"\" width=\"610\" height=\"399\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/configure-alpaca-permissions-700x458.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/configure-alpaca-permissions-300x196.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/configure-alpaca-permissions-768x502.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/07\/configure-alpaca-permissions.webp 1043w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/li>\n<\/ul>\n<h3>Uninstall Alpaca<\/h3>\n<p>To remove the software, open terminal (press Ctrl+Alt+T in Ubuntu) and run command:<\/p>\n<pre>flatpak uninstall --delete-data com.jeffser.Alpaca<\/pre>\n<p>And, run <code>flatpak uninstall --unused<\/code> to clear any useless run-time libraries.<\/p>","protected":false},"excerpt":{"rendered":"<p>Want to chat with AI models locally without internet connection? Here&#8217;s a simple app can do the job in Linux Desktop! It&#8217;s Alpaca, a free open-source application written in Python programming language. It uses Ollama as backend to manage and chat with multiple AI models, without needing any API keys. By using GTK4 plus Adwaita [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":46945,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[52],"tags":[2168,2174],"class_list":["post-46944","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-app-review","tag-ai-chatbot","tag-ollama-client"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/46944","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=46944"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/46944\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/46945"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=46944"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=46944"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=46944"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}