Duck
AI Tools5 min read

Self Hosted AI: Stop Renting, Start Owning Your Stack

Samet Turan— Editor··5 min read

Learn to deploy self hosted AI models for your business. This guide covers hardware, open-source models, and the real costs of owning your own AI stack.

Why Bother with Self Hosted AI?

Control. Cost. Privacy. That’s the short answer. Relying on third-party APIs from OpenAI or Anthropic means you’re building your business on rented land. When they change their API, update their model, or raise their prices, you have to adapt or die. I’ve seen it happen. A prompt that worked perfectly one week suddenly produces garbage the next after an unannounced model tweak. With a self hosted AI setup, you are in complete command. You decide when to update, you own the prompts, and you own the model weights.

The cost argument gets real at scale. API calls are a death by a thousand cuts. A few cents per call seems trivial until you’re running thousands of tasks a day. That bill climbs fast. Owning the hardware has a higher upfront cost but a near-zero marginal cost per inference. Once you buy the GPU, running it is just the cost of electricity. For any process you run consistently, self-hosting will be cheaper in the long run.

And then there’s privacy. If you’re processing sensitive customer data, internal documents, or proprietary information, sending it to a third-party server is a massive liability. Self-hosting means your data never leaves your infrastructure. It’s the only way to be certain.

The Hardware You Actually Need (Not a Supercomputer)

Forget the images of massive data centers. You don’t need an NVIDIA H100 cluster to get started. For most small business automation tasks, a powerful consumer-grade PC is more than enough. The single most important component is the GPU, and specifically, its VRAM. VRAM determines the size of the model you can run. 24GB is the current sweet spot, which points directly to NVIDIA’s RTX 3090 or 4090 cards.

I run a lot of my own automations on a machine with a single RTX 4090. It’s a workhorse. It can run sophisticated 70-billion-parameter models (with quantization) and is incredibly fast with smaller, more specialized models. My concrete gripe? The heat and noise. Running inference jobs pegs the GPU at 100%, and the fans sound like a jet engine. It’s not a quiet office companion; it belongs in a server closet or a room you don’t frequent.

If you don’t want a space heater in your office, you can rent GPU time. Don’t go to the big cloud providers like AWS or Google Cloud unless you enjoy lighting money on fire. Services like Vast.ai or Runpod are built for this. They let you rent access to consumer and enterprise GPUs from other people and data centers. You can get an RTX 4090 on Runpod for about $0.79/hour. Honestly, this is a fantastic option for batch processing jobs where you need a few hours of heavy lifting but don’t want to own the hardware.

What Most Guides Get Wrong About Self-Hosting

Most tutorials on this topic are dangerously simplistic. They show you a one-line command to download a model and run a web UI, then declare victory. That isn’t a production system. It’s a toy.

They conveniently forget about the rest of the pipeline. Production AI isn’t just about inference. It’s about data ingestion, cleaning, embedding, storage, monitoring, and updating. They don’t talk about the dependency hell you’ll face with Python, NVIDIA drivers, and CUDA versions. Getting `bitsandbytes` to compile correctly the first time is a rite of passage you won’t forget.

The biggest oversight is model strategy. They tell you to download the latest, biggest model from Hugging Face. This is terrible advice. A massive, general-purpose model is often slower and less accurate for your specific task than a smaller model that has been fine-tuned. A 7-billion parameter model fine-tuned on your company’s support tickets will always outperform a generic 70-billion model for customer service automation. The goal isn’t to run the biggest model; it’s to run the *right* model.

And that requires a completely different set of skills that these guides ignore.

Is the Open-Source Software Ready for Production?

Yes, but you have to pick your tools carefully. The ecosystem is maturing fast, and some tools are genuinely brilliant while others are academic projects not meant for real work.

For running the models themselves, the absolute best tool right now is Ollama. I love it. It completely abstracts away the complexity of managing model files, configurations, and serving endpoints. You run `ollama run mistral` and a few seconds later you have a running API server for the Mistral model. It’s magic. It handles downloading the model, setting it up for your specific hardware, and exposing an OpenAI-compatible API. This is the foundation of my personal stack.

But Ollama is just the engine. You still need a chassis and a steering wheel. You need a way to structure your prompts, connect the model to your data sources (like a vector database), and chain multiple calls together to accomplish a complex task. This is the job of an AI agent framework. The most popular one is LangChain, but I have a love-hate relationship with it. It’s powerful, but it can be absurdly complex, and its documentation often feels like it was written for a different version of the library. For simple workflows, I’ve found it’s often faster to just write my own Python script using the `requests` library to call the Ollama API directly. Don’t add a heavy dependency if a few lines of code will do.

A Concrete Example: Building a Local RAG System

Let’s build something genuinely useful: a Retrieval-Augmented Generation (RAG) system that can answer questions about your own documents. This is the core of a custom chatbot or an internal knowledge base tool.

Here’s the stack:

We cover this in more depth elsewhere — deeper coverage of AI agent platforms.

  • Model Server: Ollama
  • LLM: mistral:7b-instruct-q5_K_M (A good balance of speed and intelligence)
  • Embedding Model: nomic-embed-text (A top-performing open model)
  • Vector Database: ChromaDB (Runs locally, super simple)
  • Orchestration: A basic Python script

Here are the steps to make it work:

  1. Setup Ollama: Install Ollama on your machine. Then, from your terminal, pull the models you need: ollama pull mistral:7b-instruct-q5_K_M and ollama pull nomic-embed-text. This downloads the models and makes them ready to serve.
  2. Setup ChromaDB: In your Python project, install the library: pip install chromadb. That’s it. It works with local files, so there’s no database server to configure.
  3. The Ingestion Script: You need to write a script that reads your source documents (e.g., a folder of .txt files), splits them into manageable chunks (maybe 500 words each), and then
— The Colophon

One AI tool. Tested. Reviewed.
In your inbox every Sunday.

~3 minute read. Real outcomes from operators, not marketers.

Free. One email per Sunday. Unsubscribe in one click.