Self-hosted LLM: how to run your own AI model, what it costs and when it is worth it

A home office desk with a monitor, office chair and plant

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 a £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 UK prices, real running costs, UK GDPR and how to keep it secure, plus LLM hosting providers compared if you would rather rent.

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.6 GB per billion parameters at 4-bit, plus headroom.
  • Hardware: Mac mini from £899 (16 GB); Mac Studio M5 Max with 64 GB £3,099; Framework Desktop with 128 GB £3,449.
  • Running cost: a Mac mini at full load uses about 2p an hour in electricity at the October 2026 price cap.
  • Renting instead: gpt-oss-20b from $0.075 per million input tokens; GPU servers in AWS London from $0.615 an hour.
  • Security: about 175,000 Ollama servers have been found exposed on the internet. Keep yours private.

On this page

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 licence in August 2025.

Should you self-host an LLM?

Decision flow for self-hosting an LLM: if the data must stay on your own hardware, you will run it all day, or a smaller open model is good enough, self-host; if not, use a hosted API with a business data agreement
Three questions decide it. Most small firms answer no to all three.

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 forLicenceVersion (October 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 licence (branding clause from 50 users)0.12.4
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?

ModelSizeLicenceMemory needed (approx.)
OpenAI gpt-oss-20b21B total, 3.6B activeApache 2.0Runs within 16 GB
Qwen3.8-27B27B dense, 262K contextApache 2.017.6 GB at 4-bit (measured)
Google Gemma 4 26B A4B25.2B total, 3.8B activeApache 2.0About 16 GB at 4-bit
Google Gemma 4 31B30.7B denseApache 2.0About 19 GB at 4-bit
OpenAI gpt-oss-120b117B total, 5.1B activeApache 2.0One 80 GB GPU
Mistral Small 4119B total, 6.5B activeApache 2.0Two GPUs in Mistral's example
DeepSeek V4 Flash304BMIT90.9 GB at 2-bit (measured on a 128 GB machine)
Meta Llama 4 Scout109B total, 17B activeLlama 4 Community LicenceOne 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 licence, 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 2 GB per billion parameters at full 16-bit precision. Quantisation shrinks that: about 1 GB per billion at 8-bit and 0.5 to 0.6 GB 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 with UK prices.

  • 16 GB: gpt-oss-20b, or 8-9B models with room to spare.
  • 32 GB: the 26-31B class (Qwen3.8-27B, Gemma 4), the sweet spot for business writing.
  • 64-128 GB: two models at once, long documents, or gpt-oss-120b on 96 GB 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 64 GB 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?

MachineMemoryUK price (16 October 2026)Notes
Mac mini M616 GB (up to 32 GB)From £8994 W idle, 70 W flat out; ideal for one person
Mac mini M5 Pro24 GB (up to 64 GB)From £1,699Quiet office server for a small team
Mac Studio M5 Max36 GB or 64 GB (up to 128 GB)£2,499 / £3,099Fast memory (up to 614 GB/s)
Mac Studio M5 Ultra96 GB (up to 512 GB)From £5,4991.2 TB/s; the biggest models on one desk
Framework Desktop (AMD Ryzen AI Max+ 395)64 GB / 128 GB£1,959 / £3,449128 GB version out of stock when checked
PC with NVIDIA RTX 509032 GB on the cardCard launched at £1,939; street prices vary widelyFastest for models that fit; 575 W card
NVIDIA DGX Spark128 GBLaunched at $3,999; no official UK price foundRuns models up to 200B parameters

Apple no longer sells the M4 Mac mini or the M3 Ultra and M4 Max Mac Studio in the UK store; check the current range before you buy. Graphics card prices rose sharply in September 2026 because of memory shortages, so compare several UK retailers.

How fast is a self-hosted LLM?

Bar chart of gpt-oss-20b generation speed on llama.cpp: NVIDIA RTX 5090 282 tokens per second, RTX 4090 223, Apple M3 Ultra 116, Apple M4 Max 92
A gaming GPU is about two and a half times faster than a top Mac for a model that fits on the card. Benchmark from August 2025.

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. 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 in the UK instead?

ProviderExamplePriceWhere
AWSg6.xlarge (NVIDIA L4, 24 GB)$1.02 an hourLondon (eu-west-2)
AWSg5.xlarge (NVIDIA A10G, 24 GB)$1.28 an hourLondon
HetznerGEX45 (RTX PRO 4000 Blackwell, 24 GB)€214 a month + €209 set-up, ex VATHelsinki
ScalewayL4-1-24G€0.79 an hourParis
RunPodRTX 5090 / H100$1.19 / $3.99 an hourRegion varies
LambdaH100$3.99 an hour14 regions, including Germany

Renting gives you a private model without buying hardware, and you can switch it off when idle. For UK GDPR, AWS London keeps data in the UK, and EU and EEA countries such as Finland and France are covered by UK adequacy regulations. US-based providers are covered only through the UK Extension to the EU-US Data Privacy Framework, so check the provider is certified.

LLM hosting providers compared (UK, 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 official pricing and region pages on 25 October 2026. Dollar prices are converted at about £0.75 to the dollar. Prices exclude VAT unless the table says so.

ProviderTypeCheapest GPU or per-token priceUK or EU data locationBest for
RunPodGPU cloudRTX A5000 $0.27 an hour (about £0.20)EU: yes (EU-RO-1 in its docs). UK: not listedCheap hourly GPUs for testing
LambdaGPU cloudV100 $0.79 an hour (about £0.59); H100 $3.99EU: Germany (europe-central-1). UK: noLarge single GPUs by the hour
Hugging Face Inference EndpointsManaged endpointNVIDIA T4 on AWS $0.50 an hour (about £0.38)EU: AWS Ireland (eu-west-1). UK: noDeploying a Hub model without managing servers
Together AIManaged, per tokengpt-oss-120b $0.15 in / $0.60 out per million tokens (about £0.11 / £0.45)EU: dedicated endpoints only, on Scale and Enterprise plansWide choice of open models
Fireworks AIManaged, per tokengpt-oss-120b $0.15 / $0.60 per million (about £0.11 / £0.45)EU: Frankfurt and Iceland for dedicated deployments, quota on request; region-restricted deployments cost 1.5 times moreFast serving of open and fine-tuned models
GroqManaged, per tokengpt-oss-20b $0.075 / $0.30 per million (about 6p / 23p)No EU-only option documentedVery fast replies
AWS BedrockBig cloud, per tokengpt-oss-20b in London $0.11 / $0.47 per million (about 8p / 35p)UK: London (eu-west-2), in-regionUK data residency with a per-token bill
AWS EC2Big cloud, GPU serverg4dn.xlarge (NVIDIA T4, 16 GB) $0.615 an hour (about £0.46)UK: London (eu-west-2)Your own model server in the UK
Microsoft AzureBig cloud, GPU serverNC4as T4 v3, Linux, $0.615 an hour (about £0.46)UK: UK SouthFirms already on Azure
Google Vertex AIBig cloud, per tokengpt-oss-20b $0.075 / $0.30 per million (about 6p / 23p)No for gpt-oss: served from the US (us-central1)Google Cloud users who accept US processing
HetznerEU dedicated GPU serverGEX45 (24 GB) €214 a month + €209 set-upEU: Helsinki; GEX131 also Falkenstein, GermanyLowest fixed bill for 24/7 use
OVHcloudEU GPU cloud and per-token APIQuadro RTX 5000 £0.34 an hour; L4 £0.68. AI Endpoints gpt-oss-20b €0.04 / €0.15 per million (shown incl. UK VAT)EU: widest GPU choice in Gravelines, France; AI Endpoints run in the EUBilling in pounds with EU hosting
ScalewayEU GPU cloudL4-1-24G €0.79 an hourEU: ParisHourly L4 servers in France
NscaleGPU cloud and per-token APIgpt-oss-20b $0.05 / $0.20 per million (about 4p / 15p)Data centres in the UK (Loughton, Hayes) and Norway; serverless location not statedLow token prices; ask where it runs
CivoGPU cloudA100 40 GB $1.09 an hour (about £0.82)UK: GPUs only in London (LON1)A UK-hosted GPU by the hour

Two things stand out. In this list, only AWS, Azure and Civo show a GPU in a UK region on their official pages, and only AWS Bedrock serves gpt-oss per token from London. Several US services offer Europe only on dedicated or enterprise plans, so the cheapest per-token price usually means US processing. 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 Ofgem price cap for October to December 2026 (26.32p per kWh for households, with VAT removed from electricity bills until 31 March 2027), a Mac mini M6 flat out costs about 2p an hour and an RTX 5090 card about 15p an hour. Business tariffs are not covered by the cap and are often higher.

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 15p in electricity for the card. 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.30 for gpt-oss-20b itself. The saving is tens of pence per million tokens, so paying back £2,000 or more of hardware takes billions of tokens, 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 25 October 2026.

Your own server: about £38 a month

A Mac mini M6 with 16 GB costs £899 at Apple UK, including VAT. 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 26.32p = £13.45. Total: about £38 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 £135 a month

An AWS g6.xlarge in London, with one 24 GB NVIDIA L4, costs $1.0216 an hour. Run for office hours only: 8 hours x 22 days = 176 hours, x $1.0216 = $179.80, about £135. Left on all month it is 730 hours x $1.0216 = $745.77, about £559. Storage and data transfer are extra. A Hetzner GEX45 in Helsinki is a fixed alternative: €214 + (€209 set-up / 12) = about €231 a month in the first year, ex VAT, running 24/7.

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.32 a month

AWS Bedrock in London charges $0.11 per million input tokens and $0.47 per million output tokens for gpt-oss-20b. So 6.6 x $0.11 = $0.73, plus 2.2 x $0.47 = $1.03. Total $1.76, about £1.32 a month.

Wins when use is light or uneven, which covers most small firms. At this volume the API costs about 1% of a rented GPU in office hours.

UK GDPR and data residency by route

  • Own server: no international transfer if it sits in the UK. Security is entirely your job; see how to keep it secure.
  • Rented GPU or API: the host is your processor, so you need a written contract that covers UK GDPR processor terms.
  • Check the routing, not just the region. Bedrock's global cross-Region inference can process a request in any supported AWS Region worldwide; choose in-Region London, or a geographic EU profile. Google says its global endpoint does not support data residency requirements.
  • EU and EEA hosts such as Helsinki, Paris, Frankfurt, Iceland and Norway are covered by UK adequacy regulations.
  • US services need the UK Extension to the Data Privacy Framework or UK transfer clauses. Together AI's privacy policy, for example, relies on standard contractual clauses for UK transfers, so ask for the UK Addendum.

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 licence, 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 UK-region API.

What does UK GDPR say about self-hosting?

  • No international transfer. Under the ICO's guidance, a restricted transfer is one to a separate organisation outside the UK. A model running on your own UK premises involves none.
  • You are still the controller. You decide why and how personal data is processed, so you still need a lawful basis, transparency and data minimisation.
  • Security is your job. The security principle requires measures appropriate to the risk; the ICO suggests Cyber Essentials as a starting point. If you rent a server, your contract with the host must require proper security.
  • DPIA. The ICO treats AI as innovative technology; combined with another factor, such as evaluating or scoring people, a DPIA is required.
  • Guidance is moving. The ICO's AI guidance is under review after the Data (Use and Access) Act, and it opened a call for evidence on agentic AI on 8 October 2026.

The full checklist is in AI agents and UK GDPR.

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 64 GB, 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.075 per million input tokens and $0.30 per million output tokens on Groq, while capable hardware costs from about £900 to several thousand pounds. 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 licence; gpt-oss-20b runs within 16 GB of memory.

How much RAM do I need to run an LLM?

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

Does self-hosting make me UK GDPR compliant?

No, but it simplifies things. Running the model on your own UK premises avoids an international transfer and a processor contract with an AI provider. You are still the controller, you still need a lawful basis and appropriate security, and a DPIA is likely if the AI is used to evaluate people.

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

There is no single best. If data must stay in the UK, AWS is the simplest choice: Bedrock serves gpt-oss per token in London, and EC2 rents GPU servers there from $0.615 an hour. For the lowest fixed bill, Hetzner's GEX45 GPU server in Helsinki costs €214 a month plus a €209 set-up fee, ex VAT. 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 £38 a month for a £899 Mac mini spread over three years plus electricity at full load, or about £135 a month for an NVIDIA L4 server in AWS London used in office hours. The same work through a managed API running gpt-oss-20b in London costs about £1.32 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: Reflection's 501B Beam went Apache 2.0 on 16 October and DeepSeek's V4.1 Flash 1017 is MIT; both are covered in local AI this week.

Next: set up the software with the LM Studio guide, or compare the costs of every route in how much AI agents cost in the UK.

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

Sources

About the author

Annie has spent twenty years in search, lead generation and ad tech, on the agency, client and publisher side, and has worked in growth for an AI agent platform. She writes aiagents.org.uk independently: no AI vendor pays for coverage. More about Annie · How guides are made · LinkedIn

Scroll to Top