---
title: "Ollama: Run Local LLMs with Llama, Qwen, and More in Pixeltable"
date: "2025-06-05"
author: "Pixeltable Team"
tags:
  - Ollama
  - Local LLM
  - Llama
  - Qwen
  - Private AI
  - Self-Hosted
  - AI Integration
  - Pixeltable
description: "Build private AI applications that run entirely on your hardware with Ollama. Learn how to use Llama 3.3, Qwen, Mistral, and other open-source models with Pixeltable for complete data privacy and zero API costs."
url: "https://pixeltable.com/blog/ollama-local-llm-pixeltable"
---

# Ollama: Run Local LLMs with Llama, Qwen, and More in Pixeltable

Ollama makes running large language models locally as simple as running a container. Combined with Pixeltable, you can build production-ready AI applications that run entirely on your hardware.

 
## Why Run LLMs Locally with Ollama?

 
**Ollama** is the easiest way to run open-source LLMs locally. It handles model management, optimization, and serving, making local AI accessible to everyone.

 
 
When combined with Pixeltable's [declarative infrastructure](/blog/unified-multimodal-ai-infrastructure-pixeltable), you get powerful local AI with enterprise-grade orchestration.

 
## Key Benefits

 

 - **Complete Privacy:** Your data never leaves your machine

 - **Zero API Costs:** No per-token charges

 - **Full Control:** Choose and customize your models

 - **Offline Capable:** Works without internet connection

 

 
## Popular Models

 

 - **Llama 3.2:** Meta's latest open-weight model (1B, 3B)

 - **Qwen 2.5:** Alibaba's multilingual model

 - **Mistral:** European efficiency champion

 - **Gemma 2:** Google's compact powerhouse

 

 
## Getting Started

 
```bash
# Install Ollama (macOS)
brew install ollama

# Start the Ollama service
ollama serve

# Pull a model
ollama pull llama3.2

# Install Pixeltable
pip install pixeltable
```

 
## Basic Chat Completions

 
```python
import pixeltable as pxt
from pixeltable.functions import ollama

pxt.drop_dir('ollama_demo', force=True)
pxt.create_dir('ollama_demo')

t = pxt.create_table('ollama_demo.chat', {'input': pxt.String})

messages = [{'role': 'user', 'content': t.input}]
t.add_computed_column(output=ollama.chat(
 model='llama3.2',
 messages=messages
))

t.add_computed_column(response=t.output.message.content)

t.insert([{'input': 'What is the capital of France?'}])
t.select(t.input, t.response).show()
```

 
## Comparing Models

 
```python
import pixeltable as pxt
from pixeltable.functions import ollama

compare = pxt.create_table('ollama_demo.compare', {'prompt': pxt.String})

messages = [{'role': 'user', 'content': compare.prompt}]

compare.add_computed_column(
 llama_response=ollama.chat(
 model='llama3.2',
 messages=messages
 ).message.content
)

compare.add_computed_column(
 qwen_response=ollama.chat(
 model='qwen2.5:0.5b',
 messages=messages
 ).message.content
)

compare.insert([{'prompt': 'Explain quantum computing in one sentence.'}])
compare.show()
```

 
## Local Embeddings

 
```python
import pixeltable as pxt
from pixeltable.functions import ollama

docs = pxt.create_table('ollama_demo.docs', {'text': pxt.String})

docs.add_computed_column(
 embedding=ollama.embeddings(
 model='all-minilm',
 prompt=docs.text
 )
)

docs.insert([
 {'text': 'Machine learning transforms industries'},
 {'text': 'Deep learning is a subset of ML'}
])

docs.show()
```

 
## Hardware Requirements

 
| Model Size | RAM Needed | Best For |
| --- | --- | --- |
| 0.5B - 1B | 2-4GB | Development, simple tasks |
| 3B - 7B | 8-16GB | General use |
| 13B - 70B | 32GB+ | Complex reasoning |

 
## Ollama vs Cloud APIs

 
| Consideration | Ollama | Cloud APIs |
| --- | --- | --- |
| Privacy | Complete | Data leaves your network |
| Cost | Hardware only | Per-token pricing |
| Speed | Hardware-dependent | Consistent |
| Model Quality | Open-source | Proprietary (often better) |

 
## Next Steps

 

 - [llama.cpp for maximum performance](/blog/llama-cpp-local-inference-pixeltable)

 - [Production RAG Guide](/blog/production-rag-data-centric)

 - [All Integrations](https://docs.pixeltable.com/integrations/frameworks)

 

 
## Resources

 

 - [Pixeltable Ollama Documentation](https://docs.pixeltable.com/howto/providers/working-with-ollama)

 - [Ollama Website](https://ollama.ai)

 - [Join our Discord Community](https://discord.com/invite/QPyqFYx2UN)