Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ScrapeGraphAI/Scrapegraph-ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Ollama allows you to run large language models locally on your machine. This means:- Free: No API costs
- Private: Your data never leaves your computer
- Fast: No network latency
- Offline: Works without internet connection
Prerequisites
Install Ollama
Download and install Ollama from ollama.ai:
Pull a Model
Download a model (e.g., Llama 3.2):
First-time download may take a few minutes depending on model size.
Basic Configuration
This example is from:
examples/smart_scraper_graph/ollama/smart_scraper_ollama.pyRecommended Models
- Recommended
- Fast & Lightweight
- Specialized
Configuration Options
Custom Base URL
If Ollama is running on a different host or port:JSON Format Mode
Force JSON output (required for some models):Embeddings Configuration
Use local embeddings for better RAG performance:Complete Examples
Available Models
View all available models:| Model | Size | Context | RAM Needed |
|---|---|---|---|
llama3.2:1b | 1B | 128K | ~2GB |
llama3.2 | 7B | 128K | ~8GB |
llama3.3:70b | 70B | 128K | ~40GB |
mistral | 7B | 128K | ~8GB |
gemma2 | 9B | 128K | ~6GB |
qwen:14b | 14B | 32K | ~10GB |
codellama | 7B | 16K | ~8GB |
nomic-embed-text | - | 8K | ~1GB |
Performance Tips
Use GPU Acceleration
Use GPU Acceleration
Ollama automatically uses GPU if available. Verify with:For NVIDIA GPUs, ensure CUDA is installed. For Apple Silicon, Metal is used automatically.
Increase Context Length
Increase Context Length
For long documents, increase
model_tokens:Keep Model in Memory
Keep Model in Memory
Ollama keeps models in memory for 5 minutes by default. Increase this:
Use Lighter Models for Simple Tasks
Use Lighter Models for Simple Tasks
For basic scraping, use smaller models:
Troubleshooting
Connection Refused
Connection Refused
Error:
Connection refused to http://localhost:11434Solution: Ensure Ollama is running:Model Not Found
Model Not Found
Error:
model 'llama3.2' not foundSolution: Pull the model first:Out of Memory
Out of Memory
Error: System runs out of RAMSolution: Use a smaller model:
JSON Parsing Error
JSON Parsing Error
Error: Failed to parse JSON responseSolution: Add
format parameter:Advantages of Ollama
Free
No API costs - run unlimited scraping jobs
Private
Your data never leaves your machine
Fast
No network latency, especially with GPU
Offline
Works without internet connection
Next Steps
OpenAI
Compare with cloud-based OpenAI models
Advanced Config
Learn about proxy rotation and browser settings
