{"id":88,"date":"2024-10-03T09:18:47","date_gmt":"2024-10-03T07:18:47","guid":{"rendered":"https:\/\/lukasza.hopto.org\/blog\/wordpress\/?p=88"},"modified":"2024-10-03T09:18:47","modified_gmt":"2024-10-03T07:18:47","slug":"tabby-your-self-hosted-ai-coding-assistant","status":"publish","type":"post","link":"https:\/\/lukasza.hopto.org\/index.php\/2024\/10\/03\/tabby-your-self-hosted-ai-coding-assistant\/","title":{"rendered":"Tabby: Your Self-Hosted AI Coding Assistant"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\"><strong>Because Why Let Big Tech Have All the Fun?<\/strong><\/h3>\n\n\n\n<p>Imagine this: you&#8217;re writing code, banging out functions, debugging like a champ, but instead of depending on a cloud-based AI assistant owned by a big corporation, you\u2019ve got your own AI assistant sitting right on your local server. <strong>Meet Tabby<\/strong>, a self-hosted AI coding assistant that does everything Copilot or ChatGPT can do\u2014but with <strong>you<\/strong> in control.<\/p>\n\n\n\n<p>Tabby isn\u2019t just another AI that writes code. It\u2019s a DIY powerhouse that you can host yourself, fine-tune for your specific needs, and run on your own hardware. No subscriptions, no creepy data mining, no hidden black boxes. Just you, your code, and a smart assistant to help you crush it.<\/p>\n\n\n\n<p>Let\u2019s break down what Tabby is, why it\u2019s cool, and how you can get it running on your machine faster than you can say \u201cimport os.\u201d<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>What is Tabby?<\/strong><\/h3>\n\n\n\n<p><strong>Tabby<\/strong> is an open-source, self-hosted AI coding assistant. Think of it as an open alternative to tools like GitHub Copilot, but designed to give you full control over the environment. Whether you&#8217;re looking to autocomplete your code, generate snippets, or get intelligent code suggestions, Tabby has your back.<\/p>\n\n\n\n<p>Here\u2019s what makes it stand out:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Self-Hosted<\/strong>: You can run Tabby locally or on your own server. No need to rely on cloud services.<\/li>\n\n\n\n<li><strong>Open Source<\/strong>: Fully transparent, customizable, and free for you to tweak and adapt.<\/li>\n\n\n\n<li><strong>Privacy-First<\/strong>: Since it&#8217;s running on your hardware, your code and data stay with you. Nothing gets shared unless you decide to share it.<\/li>\n\n\n\n<li><strong>Adaptable<\/strong>: Tabby can be trained or fine-tuned to better understand your coding style or specific use cases.<\/li>\n<\/ul>\n\n\n\n<p>Ready to take the leap? Let\u2019s dive into how you can get <strong>Tabby<\/strong> up and running on your Ubuntu server.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 1: Preparing Your Ubuntu Server<\/strong><\/h3>\n\n\n\n<p>Before you get cozy with Tabby, you need a machine ready to host it. This could be a spare PC, a virtual machine, or even a Raspberry Pi (though you might want something beefier for fast performance).<\/p>\n\n\n\n<p>Here\u2019s a quick guide to set up the environment.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Basic Setup:<\/strong><\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Install Ubuntu Server<\/strong>: Grab Ubuntu from the <a href=\"https:\/\/ubuntu.com\/download\/server\">official website<\/a> and get it installed.<\/li>\n\n\n\n<li><strong>Update Your System<\/strong>:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   sudo apt update &amp;&amp; sudo apt upgrade -y<\/code><\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>Install Required Tools<\/strong>: You&#8217;ll need a few basic dependencies to run Tabby, including Docker and Docker Compose. Let\u2019s get those installed:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   sudo apt install docker.io docker-compose<\/code><\/pre>\n\n\n\n<p>Make sure Docker is running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>   sudo systemctl start docker\n   sudo systemctl enable docker<\/code><\/pre>\n\n\n\n<p>Now that your server is prepped, let\u2019s install Tabby.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 2: Installing Tabby<\/strong><\/h3>\n\n\n\n<p>Tabby uses Docker for deployment, which makes it super easy to install. You don\u2019t need to mess around with complicated setups\u2014just pull down the Docker image and you\u2019re golden.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Download and Run Tabby\u2019s Docker Image<\/strong><\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Clone the Tabby repository<\/strong>: First, clone the Tabby repo from GitHub:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   git clone https:\/\/github.com\/TabbyML\/tabby\n   cd tabby<\/code><\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>Start Tabby Using Docker Compose<\/strong>: In the cloned directory, there\u2019s a <code>docker-compose.yml<\/code> file ready to go. Start the Tabby service with:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   sudo docker-compose up -d<\/code><\/pre>\n\n\n\n<p>This will pull the Tabby image from Docker Hub and start it up. The service will be running in the background, waiting to help you write code like a pro.<\/p>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>Check the Status<\/strong>: Make sure everything is running correctly by checking the status of your containers:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   sudo docker ps<\/code><\/pre>\n\n\n\n<p>You should see Tabby up and running, with ports mapped to your local machine.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 3: Integrating Tabby into Your Workflow<\/strong><\/h3>\n\n\n\n<p>Now that you\u2019ve got Tabby running, it\u2019s time to integrate it with your favorite code editor. Tabby works smoothly with <strong>Visual Studio Code<\/strong> (VSCode), so let\u2019s walk through setting that up.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>VSCode Integration<\/strong>:<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Install the Tabby VSCode Extension<\/strong>: Open VSCode and go to the <strong>Extensions<\/strong> tab. Search for <strong>Tabby<\/strong> and install the official extension.<\/li>\n\n\n\n<li><strong>Configure the Extension<\/strong>: Once installed, you\u2019ll need to point the extension to your locally hosted Tabby instance. By default, Tabby should be running on <code>http:\/\/localhost:8080<\/code>. Update the extension settings to connect to this URL.<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open the <strong>Command Palette<\/strong> in VSCode (<code>Ctrl+Shift+P<\/code>).<\/li>\n\n\n\n<li>Search for <strong>Tabby: Open Settings<\/strong>.<\/li>\n\n\n\n<li>Set the <strong>Tabby Server URL<\/strong> to <code>http:\/\/localhost:8080<\/code>.<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Start Coding with AI Support<\/strong>: That\u2019s it! Now, whenever you start writing code in VSCode, Tabby will suggest autocompletions, snippets, and more\u2014all while staying on your local network. No more sending your code to a third-party server!<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 4: Fine-Tuning Tabby (Optional)<\/strong><\/h3>\n\n\n\n<p>Tabby is open-source, so if you feel adventurous, you can fine-tune it to better suit your coding needs. For example, you can train Tabby to understand your unique coding style or specific programming languages.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Fine-Tuning the Model<\/strong>:<\/h4>\n\n\n\n<p>Tabby uses <strong>Hugging Face<\/strong> transformers under the hood, which means you can fine-tune the model if you have a dataset that represents the code patterns you want it to learn.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Set Up the Fine-Tuning Environment<\/strong>: Install the required libraries:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   pip install transformers datasets<\/code><\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>Train the Model<\/strong>: You can use any dataset of code snippets or projects you\u2019ve worked on. Follow the <a href=\"https:\/\/huggingface.co\/docs\/transformers\/training\">Hugging Face fine-tuning guide<\/a> to get started. Once the model is trained, you can plug it back into your Tabby instance.<\/li>\n\n\n\n<li><strong>Restart Tabby<\/strong>: Once fine-tuning is complete, restart the Tabby Docker container with the updated model.<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 5: Automating and Expanding Tabby\u2019s Capabilities<\/strong><\/h3>\n\n\n\n<p>You don\u2019t have to stop at basic autocomplete. Here are some cool ways to extend Tabby\u2019s capabilities:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Custom Code Snippets<\/strong>: Create a library of frequently used code snippets that Tabby can automatically suggest.<\/li>\n\n\n\n<li><strong>Error Fix Suggestions<\/strong>: Train Tabby to spot common errors in your code and suggest fixes.<\/li>\n\n\n\n<li><strong>Advanced Integrations<\/strong>: Hook Tabby up to other tools like JIRA or GitLab to automate your development process even further.<\/li>\n<\/ul>\n\n\n\n<p>The possibilities are endless when the AI is fully under your control!<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Final Thoughts: Self-Hosting for the Win<\/strong><\/h3>\n\n\n\n<p>Why rely on third-party coding assistants when you can have your own AI, tailored just for you? <strong>Tabby<\/strong> gives you all the power of a cloud-based AI assistant but with the privacy, control, and freedom of self-hosting. Whether you\u2019re an open-source enthusiast, a privacy advocate, or just a curious coder, Tabby offers a fantastic way to boost your productivity without sacrificing your independence.<\/p>\n\n\n\n<p>Get it running on your server, hook it up to your favorite code editor, and let your new AI assistant help you write code faster, smarter, and with complete peace of mind. After all, who better to assist your coding than a machine that <strong>you<\/strong> own?<\/p>\n\n\n\n<p>Happy coding\u2014and happy hosting!<\/p>\n\n\n\n<script type=\"text\/javascript\" src=\"https:\/\/cdnjs.buymeacoffee.com\/1.0.0\/button.prod.min.js\" data-name=\"bmc-button\" data-slug=\"lukasza\" data-color=\"#BD5FFF\" data-emoji=\"\"  data-font=\"Cookie\" data-text=\"Buy me a coffee\" data-outline-color=\"#000000\" data-font-color=\"#ffffff\" data-coffee-color=\"#FFDD00\" ><\/script>\n","protected":false},"excerpt":{"rendered":"<p>Because Why Let Big Tech Have All the Fun? Imagine this: you&#8217;re writing code, banging out functions, debugging like a champ, but instead of depending&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3,31,35],"class_list":["post-88","post","type-post","status-publish","format-standard","hentry","category-bez-kategorii","tag-ai-coding","tag-self-hosted","tag-tabby"],"_links":{"self":[{"href":"https:\/\/lukasza.hopto.org\/index.php\/wp-json\/wp\/v2\/posts\/88","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lukasza.hopto.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lukasza.hopto.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lukasza.hopto.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lukasza.hopto.org\/index.php\/wp-json\/wp\/v2\/comments?post=88"}],"version-history":[{"count":0,"href":"https:\/\/lukasza.hopto.org\/index.php\/wp-json\/wp\/v2\/posts\/88\/revisions"}],"wp:attachment":[{"href":"https:\/\/lukasza.hopto.org\/index.php\/wp-json\/wp\/v2\/media?parent=88"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lukasza.hopto.org\/index.php\/wp-json\/wp\/v2\/categories?post=88"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lukasza.hopto.org\/index.php\/wp-json\/wp\/v2\/tags?post=88"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}