All postsTüm yazılar
AIYapay zekâ

How to host your own AI model, for free or close to itKendi yapay zekâ modelinizi nasıl barındırırsınız: ücretsiz ya da neredeyse ücretsiz

From a model on your laptop to a private API your phone and friends can use. Four practical ways to host an open model, what each costs, and the security mistake almost everyone makes.Dizüstünüzdeki bir modelden telefonunuzun ve arkadaşlarınızın kullanabileceği özel bir API'ye. Açık bir modeli barındırmanın dört pratik yolu, her birinin maliyeti ve neredeyse herkesin yaptığı güvenlik hatası.

By Athene SoftworksAthene Softworks4 min read3 dk okuma

Running an AI model in a chat app on your own computer is the first step. The next question people ask us is: how do I make it available somewhere else? To your phone, to a website you're building, to a small team. That's what "hosting" a model means: running it as a server that other programs can talk to over the network.

Good news: the open-source tools make this much easier than it sounds, and you can do a lot without spending money.

The building block: an OpenAI-compatible server

Most AI apps and libraries speak the same simple HTTP format, originally designed by OpenAI: you send a list of messages to /v1/chat/completions and get a reply back. Open-source engines copy this format, so once your model speaks it, almost any client can use it.

The two easiest ways to get one running:

# llama.cpp: one command, any GGUF model
llama-server -m qwen-4b-q4_k_m.gguf --port 8080 --api-key "pick-a-long-secret"

# Ollama: downloads and serves models for you
ollama pull llama3.2
ollama serve   # API on http://127.0.0.1:11434

Test it from the same computer:

curl http://127.0.0.1:8080/v1/chat/completions \
  -H "Authorization: Bearer pick-a-long-secret" \
  -H "Content-Type: application/json" \
  -d '{"messages":[{"role":"user","content":"Hello!"}]}'

Option 1: your own computer, plus a tunnel

Cost: free. Keep the model on your desktop or an old laptop and expose it safely with a tunnel such as Cloudflare Tunnel or Tailscale. A tunnel creates an outgoing connection, so you don't open ports on your router, and your home IP address stays hidden.

  • Tailscale is best when only your devices need access: your phone joins your private network and reaches the model as if you were at home.
  • Cloudflare Tunnel gives you a public HTTPS address, useful for a website or friends, ideally protected with Cloudflare Access on top of the API key.

The downside: the computer has to stay on, and speed depends on your hardware.

Option 2: free cloud tiers

Cost: free, with limits. Several platforms offer free compute that can run small models on CPU:

  • Hugging Face Spaces has a free CPU tier (at the time of writing, 2 vCPUs and 16 GB of RAM). Enough for a 1–4B model at modest speed. Free Spaces go to sleep when unused and take a while to wake up.
  • Oracle Cloud's Always Free tier includes Arm virtual machines with up to 4 cores and 24 GB of RAM in total, which can serve a quantized 7–8B model slowly but steadily. Sign-up requires a card and capacity is sometimes limited.

Free tiers change often, so check current terms before you build on them.

Option 3: rent a GPU by the hour

Cost: pay as you go. Services like RunPod, Vast.ai and Lambda rent graphics cards by the hour or second. This is the way to serve larger models fast, or to fine-tune a model, without buying hardware. Use vLLM or llama.cpp on the rented machine and shut it down when you're done: a forgotten GPU is the classic surprise bill.

Option 4: managed APIs for open models

Cost: per token, often with a free allowance. If you don't need the model on your own hardware, providers like Groq, OpenRouter and Hugging Face Inference host popular open models for you behind the same OpenAI-style API. You lose some privacy and control, but you get speed with zero maintenance.

The security mistake almost everyone makes

Never expose a model server to the internet without authentication.Researchers regularly find thousands of open Ollama and llama.cpp servers online that anyone can use. That means strangers spending your electricity or cloud credit, reading prompts in progress, and in some cases reaching other services on the same machine.
  • Keep the server bound to 127.0.0.1 (Ollama's default) and reach it through a tunnel or VPN.
  • If it must be public, require an API key (--api-key in llama.cpp) and put it behind HTTPS.
  • Don't run the server as an administrator or root user.
  • Download models only from trusted publishers. Prefer GGUF and safetensors files over older "pickle" formats, which can contain code.
  • Keep the engine updated; these projects ship security fixes often.

Which should you pick?

You want…Use
Your own model on your phone, totally privateYour computer + Tailscale
A demo website for a small modelHugging Face Spaces
A 24/7 small server for nothingOracle Always Free + llama.cpp
A big model, fast, for a few hoursRented GPU + vLLM
Speed with no maintenanceA managed API

If you just want to chat with local or free cloud models without setting up any of this, Synapse does it in one app. And if you're new to the topic, start with our guide to local vs. cloud AI.

Bir yapay zekâ modelini kendi bilgisayarınızda bir sohbet uygulamasında çalıştırmak ilk adımdır. İnsanların bize sorduğu bir sonraki soru şu: Bunu başka bir yerden nasıl kullanılabilir hâle getiririm? Telefonunuzdan, geliştirdiğiniz bir web sitesinden, küçük bir ekipten. Bir modeli "barındırmak" tam olarak budur: onu, diğer programların ağ üzerinden konuşabildiği bir sunucu olarak çalıştırmak.

İyi haber: açık kaynaklı araçlar bunu göründüğünden çok daha kolay hâle getiriyor ve para harcamadan çok şey yapabilirsiniz.

Temel yapı taşı: OpenAI uyumlu bir sunucu

Çoğu yapay zekâ uygulaması ve kütüphanesi, ilk olarak OpenAI'ın tasarladığı aynı basit HTTP biçimini konuşur: /v1/chat/completions adresine bir mesaj listesi gönderirsiniz ve bir yanıt alırsınız. Açık kaynaklı motorlar bu biçimi taklit eder; böylece modeliniz bu dili konuştuğunda neredeyse her istemci onu kullanabilir.

Bir tane çalıştırmanın en kolay iki yolu:

# llama.cpp: tek komut, herhangi bir GGUF modeli
llama-server -m qwen-4b-q4_k_m.gguf --port 8080 --api-key "uzun-bir-gizli-anahtar"

# Ollama: modelleri sizin için indirir ve sunar
ollama pull llama3.2
ollama serve   # API: http://127.0.0.1:11434

Aynı bilgisayardan deneyin:

curl http://127.0.0.1:8080/v1/chat/completions \
  -H "Authorization: Bearer uzun-bir-gizli-anahtar" \
  -H "Content-Type: application/json" \
  -d '{"messages":[{"role":"user","content":"Merhaba!"}]}'

Seçenek 1: kendi bilgisayarınız ve bir tünel

Maliyet: ücretsiz. Modeli masaüstünüzde ya da eski bir dizüstünde tutun ve Cloudflare Tunnel ya da Tailscale gibi bir tünelle güvenli şekilde dışarı açın. Tünel dışarıya giden bir bağlantı kurar; böylece modeminizde port açmazsınız ve ev IP adresiniz gizli kalır.

  • Erişmesi gereken yalnızca sizin cihazlarınızsa en iyisi Tailscale'dir: telefonunuz özel ağınıza katılır ve modele evdeymişsiniz gibi ulaşır.
  • Cloudflare Tunnel size herkese açık bir HTTPS adresi verir; bir web sitesi ya da arkadaşlar için kullanışlıdır. API anahtarının üstüne ideal olarak Cloudflare Access ile korunmalıdır.

Dezavantajı: bilgisayarın açık kalması gerekir ve hız donanımınıza bağlıdır.

Seçenek 2: ücretsiz bulut katmanları

Maliyet: ücretsiz, sınırlı. Birçok platform, küçük modelleri işlemcide çalıştırabilecek ücretsiz işlem gücü sunar:

  • Hugging Face Spaces'in ücretsiz bir CPU katmanı var (bu yazı yazılırken 2 vCPU ve 16 GB RAM). 1–4B bir model için makul bir hızda yeterlidir. Ücretsiz Space'ler kullanılmadığında uykuya geçer ve uyanmaları biraz zaman alır.
  • Oracle Cloud'un Always Free katmanı, toplamda 4 çekirdeğe ve 24 GB RAM'e kadar Arm sanal makineler içerir; nicemlenmiş 7–8B bir modeli yavaş ama istikrarlı şekilde sunabilir. Kayıt için kart gerekir ve kapasite zaman zaman sınırlıdır.

Ücretsiz katmanlar sık değişir; üzerine bir şey kurmadan önce güncel koşulları kontrol edin.

Seçenek 3: saatlik GPU kiralamak

Maliyet: kullandıkça öde. RunPod, Vast.ai ve Lambda gibi servisler ekran kartlarını saatlik ya da saniyelik kiralar. Donanım satın almadan büyük modelleri hızlı sunmanın ya da bir modeli ince ayarlamanın yolu budur. Kiraladığınız makinede vLLM ya da llama.cpp kullanın ve işiniz bitince kapatın: unutulmuş bir GPU, klasik sürpriz faturadır.

Seçenek 4: açık modeller için yönetilen API'ler

Maliyet: token başına, çoğu zaman ücretsiz bir kotayla. Modelin kendi donanımınızda olmasına gerek yoksa Groq, OpenRouter ve Hugging Face Inference gibi sağlayıcılar popüler açık modelleri aynı OpenAI tarzı API'nin arkasında sizin için barındırır. Biraz gizlilik ve kontrol kaybedersiniz, ama sıfır bakım ile hız kazanırsınız.

Neredeyse herkesin yaptığı güvenlik hatası

Bir model sunucusunu kimlik doğrulaması olmadan asla internete açmayın.Araştırmacılar, internette herkesin kullanabildiği binlerce açık Ollama ve llama.cpp sunucusunu düzenli olarak buluyor. Bu, yabancıların elektriğinizi ya da bulut kredinizi harcaması, süren istekleri okuması ve bazı durumlarda aynı makinedeki diğer servislere ulaşması demektir.
  • Sunucuyu 127.0.0.1 adresine bağlı tutun (Ollama'nın varsayılanı) ve ona bir tünel ya da VPN üzerinden ulaşın.
  • Herkese açık olması gerekiyorsa bir API anahtarı zorunlu kılın (llama.cpp'de --api-key) ve HTTPS arkasına koyun.
  • Sunucuyu yönetici ya da root kullanıcısı olarak çalıştırmayın.
  • Modelleri yalnızca güvenilir yayıncılardan indirin. İçinde kod barındırabilen eski "pickle" biçimleri yerine GGUF ve safetensors dosyalarını tercih edin.
  • Motoru güncel tutun; bu projeler sık sık güvenlik düzeltmesi yayımlar.

Hangisini seçmelisiniz?

İstediğiniz…Kullanın
Telefonunuzda tamamen gizli, kendi modelinizBilgisayarınız + Tailscale
Küçük bir model için demo web sitesiHugging Face Spaces
Hiç para ödemeden 7/24 küçük bir sunucuOracle Always Free + llama.cpp
Birkaç saatliğine büyük ve hızlı bir modelKiralık GPU + vLLM
Bakımsız hızYönetilen bir API

Bunların hiçbirini kurmadan yerel ya da ücretsiz bulut modelleriyle sohbet etmek istiyorsanız Synapse bunu tek bir uygulamada yapıyor. Konuya yeniyseniz yerel ve bulut yapay zekâ rehberimizle başlayın.

SynapseRun open AI models privately on your Mac or PC, or use free cloud models. Free and open source.Açık yapay zekâ modellerini Mac ya da PC’nizde gizlice çalıştırın veya ücretsiz bulut modellerini kullanın. Ücretsiz ve açık kaynaklı.
Get SynapseSynapse’i edinin

Keep readingOkumaya devam edin

All posts →Tüm yazılar →