TeXposit Tutorial

12. Using Ollama (Local LLM)

Run AI models locally on your machine for free.

10 min read Share

TeXposit supports Ollama, which lets you run language models directly on your computer. No data is sent to the cloud, there are no API costs, and it works offline.

System Requirements

Before setting up Ollama, verify your machine meets these requirements:

Minimum (Small Models)
  • • RAM: 8GB minimum, 16GB recommended
  • • Disk: 20GB free space
  • • CPU: Any modern processor (Intel/AMD)
  • • Good for: Ollama (7B-13B models)
Recommended (Better Quality)
  • • RAM: 32GB+ for smooth operation
  • • Disk: 50GB free space
  • • GPU: NVIDIA CUDA (optional but much faster)
  • • Good for: Larger models (30B-70B)

GPU Acceleration: Running models on NVIDIA GPUs with CUDA is ~10-50x faster than CPU. If you have a modern NVIDIA card (RTX 3060+), GPU support is highly recommended for a smooth experience.

Step 1: Install Ollama

Download and install Ollama for your operating system:

Download Ollama

Follow the installation instructions for your OS. Once installed, you can run Ollama from your terminal.

Step 2: Choose & Run a Model

Popular models for academic writing, ordered by quality/speed tradeoff:

Llama 3.2 (3B) - Best for Fast Responses

Lightweight but capable. Great for quick writing suggestions on modest hardware.

LaTeX
ollama run llama3.2
Llama 3.1 (8B) - Balanced Choice

Excellent for academic content. Runs comfortably on ~8-16GB RAM.

LaTeX
ollama run llama3.1
Qwen2.5-Coder (7B) - Recommended for LaTeX

Optimized for technical content and code. Handles LaTeX syntax well.

LaTeX
ollama run qwen2.5-coder
Mistral (7B) - Quality & Speed

Good reasoning with reasonable resource usage. Improving continuously.

LaTeX
ollama run mistral

Running ollama run [model-name] will download the model (one-time, can be 5-50 GB depending on size) and start a local server on localhost:11434.

Step 3: Connect TeXposit to Ollama

TeXposit automatically detects Ollama running on your machine. To use it:

  1. Make sure Ollama is running (terminal window open with model loaded)
  2. In TeXposit, open the AI Assistant panel (Cmd+Shift+B)
  3. Look for an option to "Use Local Ollama" or similar (depending on your TeXposit configuration)
  4. Select the model you want to use from the dropdown
  5. Start chatting! Responses will use your local model instead of cloud AI

Note: Ollama must be running in a terminal window for TeXposit to connect. If you stop the Ollama process, TeXposit will fall back to cloud AI.

Advanced: Custom Models for Academic Writing

For best results with academic LaTeX, you can create a custom model optimized for your writing style. Save this as Modelfile:

LaTeX
FROM qwen2.5-coder

SYSTEM """
You are an expert academic writing assistant specialized in LaTeX and research papers.
Your responsibilities:
- Improve clarity, precision, and academic tone while preserving technical accuracy
- Ensure all LaTeX code is syntactically correct and compilable
- Follow best practices for academic writing
- Maintain formal, professional tone suitable for peer-reviewed publications
- When generating LaTeX code, include proper package imports and formatting
"""

PARAMETER temperature 0.3
PARAMETER top_p 0.95
PARAMETER num_ctx 4096

Build your custom model:

LaTeX
ollama create texposit-academic -f Modelfile

Then run it with:

LaTeX
ollama run texposit-academic

Tips for Using Local Models

Best Practices

Keep Ollama Running: Local models need an active Ollama process. Start it once and keep it open in the background.

Match Model to Task: Use smaller models (7B) for quick edits, larger ones (13B+) for complex restructuring.

Monitor System Resources: Watch RAM/CPU usage. If your system gets sluggish, your model might be too large for your hardware.

Give Models Context: When asking for help, include relevant code snippets so the model understands your LaTeX setup.

Test with Cloud First: When unsure about results, compare local model output with cloud AI to verify quality.