Self-Hosted LLM: How to Run Your Own AI Model, What It Costs and When It Is Worth It

A man at a desk with a black desktop tower and a code editor on a monitor, beside a notebook and a mug, by a sash window.

By Annie Vane · Local · Mac and PC · Guide · Docs-only · Checked October 25, 2026

Prices are in US dollars. Hosting prices were checked on each provider's own pricing page on December 2, 2026. Mac and Framework prices are the US store prices listed in our guides to those machines, checked December 2, 2026. Electricity is the US average residential price for September 2026 from the Energy Information Administration. Tool versions were checked on October 25, 2026. Prices are before sales tax.

For a five-person team, self-hosting costs about $34 a month on an $899 Mac mini, $142 on a rented US GPU, or $1.12 on a managed API. It is worth it for data control, not to save money. A self-hosted LLM is an AI model you run on hardware you control instead of a provider's cloud, so your prompts and documents never leave your premises. In 2026 it is easier than ever: free tools such as Ollama and LM Studio run open models like Qwen3.8, Gemma 4 and OpenAI's gpt-oss on an $899 Mac mini or a gaming PC, and vLLM serves a whole team from one GPU server. It is rarely cheaper than an API for a small business, though. This guide covers when self-hosting is worth it, the tools, the models, hardware with US prices, real running costs and how to keep it secure, plus LLM hosting providers compared if you would rather rent.

For the full guide, see Local AI vs Cloud AI: Real Speeds, Real Costs and an Honest Quality Check.

Key facts

  • Worth it when: data must stay in-house, you run it all day, or a smaller open model does the job.
  • Tools: Ollama, LM Studio and Jan for one machine; vLLM or SGLang for a team; Open WebUI for staff logins.
  • Models: Qwen3.8-27B, Gemma 4 and gpt-oss, all Apache 2.0.
  • Memory: about 0.5-0.6GB per billion parameters at 4-bit, plus headroom.
  • Hardware: Mac mini from $899 (16GB); Mac Studio M5 Max with 64GB $3,499; Framework Desktop with 128GB $3,449 (out of stock when checked).
  • Running cost: a Mac mini at full load uses about 1.3 cents an hour in electricity at the US average residential price of 18.17 cents per kWh (September 2026).
  • Renting instead: gpt-oss-20b from $0.07 per million input tokens; GPU servers in AWS US East from $0.526 an hour.
  • Security: about 175,000 Ollama servers have been found exposed on the internet. Keep yours private.

What is a self-hosted LLM?

A large language model is the engine inside tools like ChatGPT. Most people use one through a provider's app or API, which means every prompt travels to that provider's servers. Self-hosting means downloading an open-weight model, one whose files are published for anyone to run, and running it on a machine you control: a laptop, a Mac mini in the office, a GPU server in a cupboard or a server you rent.

You cannot self-host ChatGPT, Claude or Gemini; those models are never released. You can self-host strong open alternatives, including OpenAI's own gpt-oss models, released under the Apache 2.0 license in August 2025.

Should you self-host an LLM?

Self-host when client confidentiality, a contract or regulation rules out sending data to a cloud AI provider; when you will run the model constantly, for example classifying every incoming document; or when a smaller model is good enough for the job and you want a fixed cost.

Do not self-host when you need the best reasoning available, your use is occasional, or no one in the business wants to look after a server. A business plan from OpenAI, Anthropic, Google or Microsoft, with training switched off and a data processing agreement in place, is simpler and usually cheaper. Our AI agent cost guide compares the routes.

Which tools do you use to self-host an LLM?

ToolWhat it is forLicenseVersion (checked October 25, 2026)
LM StudioDesktop app to find, run and serve models; headless mode (llmster) for serversFree for work; proprietary0.4.26
OllamaCommand-line runner that other apps plug into; one machine or small serverMIT0.40.11
JanSimple offline chat app with a local APIApache 2.00.8.7
llama.cppThe engine under many of these; its llama-server is OpenAI-compatibleMITBuild b11876
vLLMHigh-throughput server for many users on GPUsApache 2.00.32.0
SGLangHigh-performance serving for production workloadsApache 2.00.5.22
Open WebUIChatGPT-style web front end with staff accounts, roles and groupsOpen WebUI license (branding clause from 50 users)0.12.4 (0.13.4 by November 23)
LocalAIOpenAI-compatible API that runs without a GPUMIT4.9.0

Hugging Face's Text Generation Inference was archived in March 2026 and is in maintenance mode, so do not start a new project on it. For one person on a Mac, start with LM Studio or Ollama; our Ollama vs LM Studio vs Jan comparison helps you choose. For a team, a GPU server running vLLM with Open WebUI in front is the common pattern.

Which open models are worth self-hosting?

ModelSizeLicenseMemory needed (approx.)
OpenAI gpt-oss-20b21B total, 3.6B activeApache 2.0Runs within 16GB
Qwen3.8-27B27B dense, 262K contextApache 2.017.6GB at 4-bit (measured)
Google Gemma 4 26B A4B25.2B total, 3.8B activeApache 2.0About 16GB at 4-bit
Google Gemma 4 31B30.7B denseApache 2.0About 19GB at 4-bit
OpenAI gpt-oss-120b117B total, 5.1B activeApache 2.0One 80GB GPU
Mistral Small 4119B total, 6.5B activeApache 2.0Two GPUs in Mistral's example
DeepSeek V4 Flash304BMIT90.9GB at 2-bit (measured on a 128GB machine)
Meta Llama 4 Scout109B total, 17B activeLlama 4 Community LicenseOne H100 at 4-bit

"Active" parameters matter for speed: a mixture-of-experts model such as gpt-oss-20b only uses 3.6 billion of its 21 billion parameters for each word, so it runs fast, but it still needs memory for all of them. Gemma 4 moved to the Apache 2.0 license, which makes it as easy to use commercially as Qwen and gpt-oss.

How much memory do you need?

A model's weights need about 2GB per billion parameters at full 16-bit precision. Quantization shrinks that: about 1GB per billion at 8-bit and 0.5 to 0.6GB at 4-bit, which is the usual choice. Add room for the conversation (the context), the operating system and your other apps. If you are choosing a machine, my guide to which Mac or mini PC to buy for local AI compares 12 of them.

  • 16GB: gpt-oss-20b, or 8-9B models with room to spare.
  • 32GB: the 26-31B class (Qwen3.8-27B, Gemma 4), the sweet spot for business writing.
  • 64-128GB: two models at once, long documents, or gpt-oss-120b on 96GB or more.
  • Bandwidth decides speed. Two machines with the same memory can differ several times in speed because of how fast that memory is.

On a Mac, the processor and graphics share one pool of memory, so a Mac with 64GB can load models a PC would need a very expensive graphics card for. Our guide to running a local LLM on a Mac goes deeper.

What hardware should you buy?

MachineMemoryUS price (December 2, 2026)Notes
Mac mini M616GB (up to 32GB)From $8994 W idle, 70 W flat out; ideal for one person
Mac mini M5 Pro24GB (up to 64GB)From $1,699Quiet office server for a small team
Mac Studio M5 Max36GB or 64GB (up to 128GB)$2,499 / $3,499Fast memory (up to 614GB/s)
Mac Studio M5 Ultra96GB (up to 512GB)See Apple's Mac Studio page1.2TB/s; the biggest models on one desk
Framework Desktop (AMD Ryzen AI Max+ 395)64GB / 128GB$1,959 / $3,449128GB version out of stock when checked
PC with NVIDIA RTX 509032GB on the cardCard launched at $1,999; street prices vary widelyFastest for models that fit; 575 W card
NVIDIA DGX Spark128GBLaunched at $3,999Runs models up to 200B parameters

Apple changes its range often, so check the current lineup in Apple's US store before you buy. Graphics card prices rose sharply in September 2026 because of memory shortages, so compare several US retailers.

How fast is a self-hosted LLM?

For gpt-oss-20b, a fast mixture-of-experts model, an RTX 5090 generates about 282 tokens a second, an M3 Ultra about 116 and an M4 Max about 92, according to the llama.cpp project's benchmark thread (published August 2025, not re-run). All are far faster than anyone reads. Dense 27-31B models run several times slower, and the more people share one machine, the slower each gets, which is where vLLM's batching earns its keep. NVIDIA's DGX Spark trades speed for memory: LMSYS measured about 50 tokens a second on gpt-oss-20b under Ollama.

Can you rent a GPU instead?

ProviderExamplePriceWhere
AWSg6.xlarge (NVIDIA L4, 24GB)$0.80 an hourUS East, N. Virginia (us-east-1)
AWSg5.xlarge (NVIDIA A10G, 24GB)$1.01 an hourUS East, N. Virginia
HetznerGEX45 (RTX PRO 4000 Blackwell, 24GB)See Hetzner pricing (billed in euros)Helsinki
ScalewayL4-1-24GSee Scaleway pricing (billed in euros)Paris
RunPodRTX 5090 / H100 PCIe$1.39 / $2.89 an hourRegion varies
LambdaH100 PCIe$3.79 an hour14 regions, including Germany

Renting gives you a private model without buying hardware, and you can switch it off when idle. Check the provider's region and contract before you send personal data.

LLM hosting providers compared (US, 2026)

You do not need to own hardware to run an open-weight model privately. There are four kinds of LLM hosting: GPU clouds that rent you a server by the hour, managed services that run the model and bill per token, the big clouds that do both, and European hosts. I checked each provider's own pricing page on December 2, 2026, and its region pages on October 25, 2026. Prices are in US dollars as each provider lists them, before sales tax. Where a provider bills only in euros or shows no public dollar price, the table says "see" its pricing page instead of giving a number.

ProviderTypeCheapest GPU or per-token priceBest for
RunPodGPU cloudRTX A5000 $0.27 an hourCheap hourly GPUs for testing
LambdaGPU cloudV100 $0.79 an hour; H100 PCIe $3.79Large single GPUs by the hour
Hugging Face Inference EndpointsManaged endpointNVIDIA T4 on AWS $0.50 an hourDeploying a Hub model without managing servers
Together AIManaged, per tokengpt-oss-120b $0.15 in / $0.60 out per million tokensWide choice of open models
Fireworks AIManaged, per tokengpt-oss-120b $0.15 / $0.60 per millionFast serving of open and fine-tuned models
GroqManaged, per tokengpt-oss-20b $0.17 / $0.36 per millionVery fast replies
AWS BedrockBig cloud, per tokengpt-oss-20b in US East (N. Virginia) $0.07 / $0.30 per millionA per-token bill with US in-region processing
AWS EC2Big cloud, GPU serverg4dn.xlarge (NVIDIA T4, 16GB) $0.526 an hourYour own model server in the US
Microsoft AzureBig cloud, GPU serverNC4as T4 v3, Linux, $0.526 an hourFirms already on Azure
Google Vertex AIBig cloud, per tokengpt-oss-20b $0.07 / $0.25 per millionGoogle Cloud users who accept US processing
HetznerEU dedicated GPU serverGEX45 (24GB): see Hetzner pricing (billed in euros)Lowest fixed bill for 24/7 use; servers in Helsinki
OVHcloudEU GPU cloud and per-token APIL4 $1.00 an hour; L40S $1.80 (OVHcloud US, excl. taxes). AI Endpoints gpt-oss-20b: see OVHcloud pricingBilling in dollars on the US site, EU hosting available
ScalewayEU GPU cloudL4-1-24G: see Scaleway pricing (billed in euros)Hourly L4 servers in France
NscaleGPU cloud and per-token APIgpt-oss-20b: see Nscale pricing (not in its public serverless list)Low token prices; ask where it runs
CivoGPU cloudA100 40GB $1.09 an hourAn A100 by the hour

Two things stand out. Hetzner and Scaleway list prices in euros only, and Nscale's public serverless list no longer shows gpt-oss-20b, so the table points to their pricing pages instead of a dollar figure. I left Vast.ai out because its pricing page shows no fixed prices.

Is self-hosting cheaper than an API?

Usually not, once you count the hardware. The electricity is cheap: at the US average residential price of 18.17 cents per kWh in September 2026 (Energy Information Administration, Electric Power Monthly, released November 24, 2026), a Mac mini M6 flat out costs about 1.3 cents an hour (0.07 kW x $0.1817) and an RTX 5090 card about 10 cents an hour (0.575 kW x $0.1817). Commercial customers averaged 14.27 cents in the same month, and prices vary by state: 13.33 cents in Louisiana and 30.86 cents in California, for example.

Our arithmetic: generating one million output tokens (roughly 750,000 words) with gpt-oss-20b on an RTX 5090 takes about an hour and costs about 10 cents in electricity for the card (0.575 kW x 1 hour x $0.1817 = $0.104). Cheap hosted models such as OpenAI's gpt-6-luna and Anthropic's Claude Haiku 5.5 charge $0.50 for the same million output tokens, and Groq charges $0.36 for gpt-oss-20b itself. The saving is about 26 to 40 cents per million tokens ($0.36 - $0.104 = $0.256; $0.50 - $0.104 = $0.396), so paying back the $1,999 card alone takes about 5 to 8 billion tokens ($1,999 / $0.396 = 5.05 billion; $1,999 / $0.256 = 7.8 billion), before you count your time.

So self-host for control, privacy or a fixed predictable cost, not to save money on a small workload.

Self-host on your own server vs rented GPU vs managed API

Here is one job priced three ways. A five-person team sends 40 requests each per working day, with about 1,500 tokens in and 500 tokens out per request. Over 22 working days that is 4,400 requests: 6.6 million input tokens and 2.2 million output tokens a month. The model is gpt-oss-20b in every case. Prices are as of December 2, 2026.

Your own server: about $34 a month

A Mac mini M6 with 16GB costs $899 at Apple's US store, before sales tax. Spread over three years, that is $899 / 36 = $24.97 a month. Electricity at the worst case of 70 W flat out, all month: 0.07 kW x 730 hours = 51.1 kWh, x $0.1817 = $9.28. Total: $24.97 + $9.28 = about $34 a month, with $899 paid up front. The real power bill is lower, because it idles at about 4 W.

Wins when the data must not leave your premises, or use is heavy and steady. You also need someone to look after it. For a larger team, see the small office setup.

Rented GPU: about $142 a month

An AWS g6.xlarge in US East (N. Virginia), with one 24GB NVIDIA L4, costs $0.8048 an hour on demand with Linux. Run for office hours only: 8 hours x 22 days = 176 hours, x $0.8048 = $141.64, about $142. Left on all month it is 730 hours x $0.8048 = $587.50. Storage and data transfer are extra. A Hetzner GEX45 in Helsinki is a fixed alternative for running 24/7; it is billed in euros, so see Hetzner pricing.

Wins when you need a model, a fine-tune or settings that no API offers, or a contract asks for a single-tenant server, without buying hardware.

Managed API: about $1.12 a month

AWS Bedrock in US East (N. Virginia) charges $0.07 per million input tokens and $0.30 per million output tokens for gpt-oss-20b. So 6.6 x $0.07 = $0.46, plus 2.2 x $0.30 = $0.66. Total $0.462 + $0.66 = $1.12 a month.

Wins when use is light or uneven, which covers most small firms. At this volume the API costs under 1% of a rented GPU in office hours ($1.12 / $141.64 = 0.8%).

Privacy and data residency

Running the model on your own machine keeps your prompts and files off third-party servers. If you handle customers' personal data, check the privacy laws that apply to you. For UK and EU rules, see aiagents.org.uk.

Mixing routes with a self-hosted LLM gateway

You do not have to pick one route. A gateway is a small server you run in front of your models. LiteLLM's AI Gateway, open source under the MIT license, gives your apps one OpenAI-compatible address for over 100 providers. It issues each team its own key with a budget and tracks spend. You can send confidential work to your own server and everything else to a hosted API.

How do you keep a self-hosted LLM secure?

The biggest risk is accidentally putting your model on the internet. Cisco Talos found 1,139 Ollama servers exposed online in 2025, about one in five serving models with no authentication. A 2026 study by SentinelOne and Censys found about 175,000 exposed Ollama hosts in 130 countries, around half able to run code or call other services.

  1. Keep it on localhost. Ollama listens on 127.0.0.1:11434 by default; setting OLLAMA_HOST=0.0.0.0 exposes it to the network.
  2. Put something in front. For office access, use a VPN or a reverse proxy with logins (Open WebUI provides accounts and roles).
  3. Use API keys where offered (llama-server and vLLM support --api-key), but vLLM's own documentation warns not to rely on the key alone.
  4. Firewall and rate limits on any server, and never open the model port on your router.
  5. Treat tools as the bigger risk. Once the model can use tools through MCP, the tools are what can do damage. See LM Studio plugins and MCP for safe settings.

A simple setup for a small office

For five to fifteen people who want a private assistant for drafting and document questions:

  1. Hardware: a Mac mini M5 Pro or Mac Studio with 64GB, in the office, on a UPS.
  2. Model server: LM Studio in headless mode or Ollama, running a 26-31B model such as Qwen3.8-27B or Gemma 4.
  3. Front end: Open WebUI, so each person has a login and chats stay separated. Its branding clause only applies once you pass 50 users.
  4. Access: office network or VPN only. Nothing exposed to the internet.
  5. Automation: point a workflow tool such as n8n at the same server for scheduled jobs. That turns it into an agent; see how to build an AI agent.
  6. Paperwork: a short DPIA, an acceptable-use note for staff and a named person who applies updates.

Frequently asked questions

What is a self-hosted LLM?

A large language model you run on hardware you control, in your office, at home or on a rented server, instead of sending prompts to a provider such as OpenAI or Anthropic. You download an open-weight model and run it with software such as Ollama, LM Studio, llama.cpp or vLLM.

Is self-hosting an LLM cheaper than using an API?

Rarely, for a small business. Hosted open models are cheaper still: gpt-oss-20b costs $0.17 per million input tokens and $0.36 per million output tokens on Groq, and $0.07 and $0.30 on AWS Bedrock in US East, while capable hardware costs from about $899 to several thousand dollars. Self-hosting pays off with heavy, steady use, or when the data must not leave your premises.

What is the best self-hosted LLM?

There is no single best. In October 2026 strong Apache 2.0 options include Qwen3.8-27B, Gemma 4 (26B A4B and 31B) and OpenAI's gpt-oss-20b and gpt-oss-120b. Pick the largest model that fits your memory with room to spare, and test it on your own tasks.

Can I run ChatGPT locally?

Not ChatGPT itself, which only runs on OpenAI's servers. OpenAI's open-weight models, gpt-oss-20b and gpt-oss-120b, can be run locally under the Apache 2.0 license; gpt-oss-20b runs within 16GB of memory.

How much RAM do I need to run an LLM?

Roughly 0.5 to 0.6GB per billion parameters at 4-bit quantization, plus room for the conversation and your other apps. In practice, 16GB runs gpt-oss-20b, about 18GB runs Qwen3.8-27B at 4-bit, and gpt-oss-120b needs about 80GB.

Does self-hosting keep my data private?

Mostly. Running the model on your own machine keeps prompts and files off third-party servers, but you still have to secure the machine. If you handle customers' personal data, check the privacy laws that apply to you. For UK and EU rules, see aiagents.org.uk.

What is the best LLM hosting provider for a US business?

There is no single best. If you want a managed per-token bill with a US region, AWS is the simplest choice: Bedrock serves gpt-oss in US East (N. Virginia), and EC2 rents a g4dn.xlarge GPU server there from $0.526 an hour. For a fixed monthly bill, Hetzner's GEX45 GPU server in Helsinki is priced in euros, so see Hetzner pricing. Check the region and the contract before you send personal data.

How much does it cost to host your own LLM?

In my worked example for a five-person team, about $34 a month for an $899 Mac mini spread over three years plus electricity at full load, or about $142 a month for an NVIDIA L4 server in AWS US East used in office hours. The same work through a managed API running gpt-oss-20b in US East costs about $1.12 a month.

What is a self-hosted LLM gateway?

A server you run between your apps and your models, giving them one OpenAI-compatible address. LiteLLM's open-source gateway supports over 100 providers, gives each team its own key and budget, and tracks spend, so private work can go to your own server and the rest to a hosted API.

Related: Set up the most popular model runner with the Ollama guide.

This week: OVHcloud released Olala mini, a 7B Apache 2.0 model with 1B active parameters that runs on an 8GB machine, and Open WebUI 0.13.4 added Tether; both are covered in Local AI this week: Inkling 2 Mini, NariQ and Olala mini (November 17 to 23, 2026).

Next: set up the software with the LM Studio guide.

Self-hosting is one of three routes to keeping your data out of other people's data centers; the private AI guide compares it with running a model on your own Mac and with no-retention cloud contracts.

Sources

This page is reviewed monthly. Prices were last checked on December 2, 2026 and tool versions on October 25, 2026. Your next step: check the current US price of the machine or rented GPU you are considering before you commit.

Spotted a mistake? Tell us

Annie Vane, author of Local AI Scout

ABOUT THE AUTHOR

Annie Vane

Annie edits Local AI Scout and tests the models she covers on her own 24 GB M5 MacBook Air. She has worked in search, affiliate marketing and digital publishing for national newspapers and magazine groups.

More about Annie and how we test

Keep exploring: Apps · Models · All guides

Good finds.
Less noise.

The Scout Letter: new guides, app reviews and "Can I run it?" checks on new models, in one short email every two weeks. No spam.

Free to join. Unsubscribe with one click.