Ollama
Ollama
A tool for easily running LLMs locally. Supports various models such as Llama and Mistral.
Ollama
A tool for easily running LLMs locally. Supports various models such as Llama and Mistral.
Ollama is an open-source tool that makes it easy to run large language models (LLMs) in a local environment. Like Docker, it lets you download and run a variety of open-source models such as Llama, Mistral, Gemma, and Qwen with simple commands.
Since its release in 2023, it has become the most popular choice among local LLM execution tools. In July 2025, a native desktop app for macOS/Windows was released, and as of v0.14.3 (January 2026), features were greatly improved, including automatic Flash Attention activation and image generation API support. The 'ollama launch' command connects it directly with AI coding tools such as Claude Code, Codex, and OpenCode.
Ollama is built on llama.cpp and supports GPU acceleration for NVIDIA (CUDA), Apple Silicon (Metal), AMD (ROCm), and Vulkan. It provides an OpenAI-compatible API (/v1/chat/completions), so existing OpenAI code can run locally with almost no modification. It also supports advanced API features such as Structured Outputs (JSON Schema) and Streaming Tool Calls.
In practice, Ollama is used for privacy-sensitive projects, API cost reduction, offline development, and LLM prototyping. 7B-13B models run smoothly even on a MacBook with 16GB of RAM, while 70B models require a high-end GPU.
# Ollama 사용 예제
# 설치: curl -fsSL https://ollama.com/install.sh | sh
# ===== 터미널에서 기본 사용 =====
# ollama pull llama3.2 # 모델 다운로드
# ollama run llama3.2 # 대화 시작
# ollama list # 설치된 모델 목록
# ===== Python SDK 사용 =====
# pip install ollama
import ollama
# 1. 기본 채팅
response = ollama.chat(
model='llama3.2',
messages=[
{'role': 'user', 'content': '파이썬으로 퀵소트 구현해줘'}
]
)
print(response['message']['content'])
# 2. 스트리밍 응답
for chunk in ollama.chat(
model='llama3.2',
messages=[{'role': 'user', 'content': '인공지능이란?'}],
stream=True
):
print(chunk['message']['content'], end='', flush=True)
# 3. 시스템 프롬프트 설정
response = ollama.chat(
model='llama3.2',
messages=[
{'role': 'system', 'content': '당신은 친절한 한국어 AI 어시스턴트입니다.'},
{'role': 'user', 'content': '오늘 날씨 어때?'}
]
)
# ===== OpenAI 호환 API 사용 =====
# pip install openai
from openai import OpenAI
client = OpenAI(
base_url='http://localhost:11434/v1', # Ollama 서버
api_key='ollama' # 아무 값이나 가능
)
response = client.chat.completions.create(
model='llama3.2',
messages=[
{'role': 'user', 'content': 'Hello, how are you?'}
]
)
print(response.choices[0].message.content)
# ===== 모델 커스터마이징 (Modelfile) =====
modelfile_content = """
FROM llama3.2
SYSTEM "당신은 한국어 번역 전문가입니다. 영어를 자연스러운 한국어로 번역합니다."
PARAMETER temperature 0.3
"""
# ollama create translator -f Modelfile
# ollama run translator
# ===== 임베딩 생성 =====
embeddings = ollama.embed(
model='nomic-embed-text',
input='This is a test sentence'
)
print(f"임베딩 차원: {len(embeddings['embeddings'][0])}")
These are the Ollama hardware requirements as of January 2025.
| Item | Specs/Pricing | Notes |
|---|---|---|
| Price | Open source (free) | Apache 2.0 License |
| Number of supported models | 100+ models | Llama, Mistral, Gemma, Qwen, etc. |
| 7B model RAM | 8GB or more | Recommended: 16GB |
| 13B model RAM | 16GB or more | Recommended: 32GB |
| 70B model VRAM | 48GB+ GPU | or 64GB+ RAM (CPU) |
| Supported GPUs | NVIDIA, Apple Silicon, AMD | CUDA, Metal, ROCm |
| Supported OS | macOS, Windows, Linux | Windows 10 22H2+ |
Performance note: About 30 tokens/sec for Llama 3.2 8B on an M2 Pro, and about 40-50 tokens/sec for a 7B model on an RTX 4060 8GB.
"If cloud APIs are a concern because we're handling customer data, it would be good to run the LLM locally with Ollama. Llama 3.2 8B runs well even on a MacBook Pro, and since it has an OpenAI-compatible API, we can use our existing code almost as is."
"Ollama is a local LLM execution tool based on llama.cpp. You run a model right away with 'ollama run llama3.2', and connect it to AI coding tools like Claude Code with 'ollama launch'. Because it has an OpenAI-compatible API, code migration is easy, and it is useful when privacy is important or in offline environments."
"Llama 3.2 8B gets about 30 tokens per second on an M2 Pro. A 70B model needs 48GB of VRAM or more. If you need more speed, you can use a quantized version (Q4_K_M) or tune the GPU memory settings."
Take a mock interview on this topic → WIA SOOM AI Interview · Start for free
A 70B model requires at least 48GB of VRAM. Choose a model size that fits your RAM/VRAM. 8GB is recommended for 7B and 16GB for 13B.
If the Ollama server is bound to 0.0.0.0, it is accessible from the network. Authentication and firewall settings are essential in production.
Start with a quantized model (Q4, Q5) that fits your hardware, and upgrade if performance is insufficient. When deploying to production, set up a reverse proxy and authentication.