From 2f3501e8f30dc1a750d7c5457f2717b873817479 Mon Sep 17 00:00:00 2001 From: Rachael Rose Renk <91027132+rachaelrenk@users.noreply.github.com> Date: Thu, 9 Jul 2026 15:19:46 -0600 Subject: [PATCH 1/7] docs: add written procedures to Ollama and PR review guides Add thorough step-by-step written procedures to two high-traffic guides that previously had video content but thin written coverage. how-to-set-up-ollama.mdx: - Add Prerequisites section with VRAM/RAM requirements table - Add platform-specific install instructions (macOS, Linux, Windows) - Add proper model pull/run commands with real model names - Add model types glossary (updated formatting) - Add model performance comparison section with timing tips - Add OpenAI-compatible API integration with Python and Node.js examples - Add Modelfile customization section with worked example - Add Productivity tips and Next steps sections how-to-review-prs-like-a-senior-dev.mdx: - Rewrite opening with clearer framing (structured review vs. AI summaries) - Add Prerequisites section - Add 'Why structured review matters' conceptual section - Add step-by-step procedure: get diff, attach context, use prompt - Keep existing structured prompt template (preserved verbatim) - Add section-by-section explanation of the prompt output - Add Tips for iterating with example follow-up prompts - Add Next steps with related guides Co-Authored-By: Oz --- .../how-to-review-prs-like-a-senior-dev.mdx | 185 ++++++++++----- .../external-tools/how-to-set-up-ollama.mdx | 217 ++++++++++++++---- 2 files changed, 303 insertions(+), 99 deletions(-) diff --git a/src/content/docs/guides/agent-workflows/how-to-review-prs-like-a-senior-dev.mdx b/src/content/docs/guides/agent-workflows/how-to-review-prs-like-a-senior-dev.mdx index 6fdd4d6bb..dc5acbc38 100644 --- a/src/content/docs/guides/agent-workflows/how-to-review-prs-like-a-senior-dev.mdx +++ b/src/content/docs/guides/agent-workflows/how-to-review-prs-like-a-senior-dev.mdx @@ -11,92 +11,165 @@ tags: --- import VideoEmbed from '@components/VideoEmbed.astro'; -import { Steps } from '@astrojs/starlight/components'; -Learn how to prompt Warp’s AI to review pull requests like an experienced engineer — focusing on structure, red flags, and clarity. +AI can summarize a pull request in seconds — but a summary isn't a review. This guide shows you how to prompt Warp's agent to produce structured, prioritized feedback that mirrors how a senior engineer would approach a large PR: start with risk, surface blockers, and give a clear merge recommendation. Plan on about 10 minutes to complete. +## Prerequisites + +- A **Git-tracked project** with a branch or open PR to review +- The [GitHub CLI](https://cli.github.com) (`gh`) if you want to pull diffs directly from GitHub + +## Why structured review matters + +Generic AI summaries describe what changed. Structured reviews tell you what to care about: + +- **Risk Assessment** flags blast radius before you've read a single line of code +- **Critical Issues** surface blockers first, so you don't spend time on style when there's a security hole +- **Merge confidence scoring** gives reviewers a shared signal for go/no-go decisions + +The prompt in this guide forces the agent to follow this structure, which produces output that's much faster to act on than a prose summary. The same workflow applies to large PRs, design docs, or any feature diff you need to triage quickly. + +## 1. Get the PR diff + +Before the agent can review the PR, it needs to see the changes. There are a few ways to get the diff into your Warp session: + +**Option A: GitHub CLI** + +If the PR is on GitHub, pull the diff directly: + +```bash +# View the diff as text +gh pr diff + +# Or open the PR in your browser to copy the diff URL +gh pr view --web +``` + +**Option B: Git diff** + +If you have the branch checked out locally: + +```bash +git diff main... +``` + +**Option C: Warp Code Review panel** + +If you have the branch checked out, open Warp's Code Review panel with `⌘+Shift++` (macOS) or `Ctrl+Shift++` (Windows/Linux) to see a visual diff of all changes. You can select diff hunks and attach them as context to your agent prompt. + +## 2. Start an agent session and provide context + +Open a new agent session in Warp and navigate to your project directory: + +```bash +cd ~/your-project +``` + +Attach the diff as context so the agent can reason about the actual code. You have a few options: + +- **Select terminal output** — Run `gh pr diff ` or `git diff`, then select the output block and attach it using the block action menu. +- **Reference specific files** — Use `@path/to/file` in your prompt to point the agent at changed files. +- **Paste inline** — For smaller diffs, paste the diff directly into the agent input. + +## 3. Use the structured review prompt + +Once the diff is attached as context, paste this prompt into Warp's agent input. The structure forces the agent to lead with risk, surface blockers with file-level precision, and end with a merge recommendation: + +``` +## Prompt: Structured PR Review Format + +Review this pull request and format your response for rapid scanning by a busy maintainer. Follow the structure below. + --- - +### 1. 🚨 Risk Assessment + +**Overall Risk:** 🔴 HIGH | 🟠 MEDIUM | 🟢 LOW +**Complexity:** [Simple | Moderate | Complex | Very Complex] +**Blast Radius:** [Isolated | Module-wide | System-wide | External APIs affected] +**Requires Immediate Review:** [YES / NO – why] + +--- -1. #### Intro +### 2. 🔍 Critical Issues +_If none, write "None found" and skip to the next section._ - This tutorial teaches you how to use Warp to make **pull-request reviews faster and smarter**.\ - Instead of relying on AI summaries, you’ll prompt Warp to generate an **index and priority list**, guiding your review order while flagging risky sections. +#### 1. [CRITICAL ISSUE TITLE] +**File:** `path/to/file.js:L125` +**Impact:** Data loss / Security hole / System crash +**Fix:** +// Quick code fix example here - Although this example focuses on large PRs, the same workflow applies to **code reviews**, **design docs**, or **feature diffs**. +--- -2. #### The problem +### 3. ⚠️ Concerns +_Should discuss or fix before merge. If none, write "None found."_ - Large PRs are difficult to parse.\ - AI summaries gloss over nuance and may miss subtle issues — you need structured, prioritized insight instead. +Examples: +- [PERFORMANCE] Unindexed query on large table +- [SECURITY] Missing input sanitization in login form -3. #### The prompt +--- - Use this in Warp’s AI input: +### 4. 🎯 Maintainer Decision Guide - ``` - ## Prompt: Structured PR Review Format +**Merge confidence:** [0–100]% +- □ Safe to merge after fixing blockers +- □ Needs architecture discussion first +- □ Requires performance testing +- □ Get security team review +- □ Author should split into smaller PRs - > Review this pull request and format your response for rapid scanning by a busy maintainer. Follow the structure below. +**Time to properly review:** ~[X] minutes +**Recommended reviewer expertise:** [Backend | Security | Database | Frontend] - --- +--- - ### 1. 🚨 Risk Assessment +### 5. 🧭 Formatting rules - **Overall Risk:** 🔴 HIGH | 🟠 MEDIUM | 🟢 LOW - **Complexity:** [Simple | Moderate | Complex | Very Complex] - **Blast Radius:** [Isolated | Module-wide | System-wide | External APIs affected] - **Requires Immediate Review:** [YES / NO – why] +- Use emoji headers for instant visual recognition +- Keep sections short; if empty, say "None found" +- Blockers get full detail, everything else stays concise +- Include code examples only for blockers +- Bold key impact/risk words +- Use consistent prefixes like [SECURITY], [PERFORMANCE], [LOGIC] for easy scanning +- If PR is genuinely fine, end with: ✅ "This PR is safe to merge as-is." +``` - --- +## 4. Understand the output - ### 2. 🔍 Critical Issues - _If none, write “None found” and skip to the next section._ +Here's what each section means and what to do with it: - #### 1. [CRITICAL ISSUE TITLE] - **File:** `path/to/file.js:L125` - **Impact:** Data loss / Security hole / System crash - **Fix:** - // Quick code fix example here +- **Risk Assessment** — Read this first. It tells you the PR's overall risk level, how complex the changes are, how many parts of the system they affect (blast radius), and whether it needs urgent review. If the blast radius is "System-wide" and you weren't expecting that, stop and discuss before going further. - --- +- **Critical Issues** — These are blockers. Each issue includes the specific file and line number, the type of impact (data loss, security hole, crash), and a suggested fix. Address all of these before merge. If the section says "None found," the PR cleared the most important bar. - ### 3. ⚠️ Concerns - _Should discuss or fix before merge. If none, write “None found.”_ +- **Concerns** — These are "should fix" items: performance risks, missing tests, design trade-offs. They don't block merge by default, but they should be tracked and discussed. - **Examples:** - - [PERFORMANCE] Unindexed query on large table - - [SECURITY] Missing input sanitization in login form +- **Maintainer Decision Guide** — The merge confidence score (0–100%) gives you and your team a shared signal. The checklist tells you what still needs to happen: architecture discussion, security review, performance testing, or splitting the PR. - --- +- **Formatting Rules** — This section is instructions to the agent, not output for you. Ignore it in the response. - ### 4. 🎯 Maintainer Decision Guide +## Tips for iterating - **Merge confidence:** [0–100]% - - □ Safe to merge after fixing blockers - - □ Needs architecture discussion first - - □ Requires performance testing - - □ Get security team review - - □ Author should split into smaller PRs +The initial output is a starting point. Use follow-up prompts to go deeper on anything that stands out: - **Time to properly review:** ~[X] minutes - **Recommended reviewer expertise:** [Backend | Security | Database | Frontend] +- **Focus on a specific file**: "Look more closely at `auth/middleware.js` — are there edge cases in the token expiration logic?" +- **Dig into a concern**: "Explain the performance risk you flagged. How significant is it at 10k requests per minute?" +- **Get a fix drafted**: "Write the fix for the input sanitization issue in the login form." +- **Check scope creep**: "Does this PR include changes unrelated to the stated goal? List anything that seems out of scope." +- **Split a large PR**: "Suggest how to split this PR into smaller, independently reviewable pieces." - --- +If the PR is large, break it into logical groups of files and run the prompt once per group. The output is easier to act on when you're reviewing one area of the codebase at a time. - ### 5. 🧭 Formatting Rules +## Next steps - - Use emoji headers for instant visual recognition - - Keep sections short; if empty, say “None found” - - Blockers get full detail, everything else stays concise - - Include code examples only for blockers - - Bold key impact/risk words - - Use consistent prefixes like [SECURITY], [PERFORMANCE], [LOGIC] for easy scanning - - If PR is genuinely fine, end with: ✅ “This PR is safe to merge as-is.” +You now have a structured, repeatable workflow for PR reviews that surfaces risk, blockers, and merge confidence fast. - ``` +Explore related guides and features: - +- [Review AI-generated code](/guides/agent-workflows/how-to-review-ai-generated-code/) — review and comment on code diffs directly in Warp's Code Review panel +- [Attach agent session context to GitHub PRs](/guides/agent-workflows/how-to-attach-agent-session-context-to-github-prs/) — embed the prompt, plan, and agent decisions into the PR for your reviewers +- [Code Review panel](/code/code-review/) — full reference for visual diffs and inline comments in Warp diff --git a/src/content/docs/guides/external-tools/how-to-set-up-ollama.mdx b/src/content/docs/guides/external-tools/how-to-set-up-ollama.mdx index b620bcf5e..7a6088cab 100644 --- a/src/content/docs/guides/external-tools/how-to-set-up-ollama.mdx +++ b/src/content/docs/guides/external-tools/how-to-set-up-ollama.mdx @@ -11,76 +11,207 @@ tags: --- import VideoEmbed from '@components/VideoEmbed.astro'; -Running AI models locally just got easier — and faster — with Ollama.\ -\ -In this guide, we’ll walk through how to use Warp to install, profile, and integrate Ollama into your local setup. +Run AI models locally — with no API costs, no data leaving your machine, and your choice of model. This guide walks through installing Ollama, running your first model, integrating it into an existing app, and customizing model behavior using Warp. ---- +## Prerequisites -### 1. Check your system specs +**Hardware requirements** -Before running large language models (LLMs) locally, confirm your hardware can handle them. +You'll need enough memory to load the model weights. The rule of thumb: roughly 1GB of memory per billion parameters. -Example setups: +| Model size | Example models | Minimum RAM/VRAM | +|---|---|---| +| 3B | Llama 3.2 3B, Phi-3 Mini | 4GB | +| 7–8B | Mistral 7B, Llama 3.1 8B | 8GB | +| 13B | Llama 2 13B | 16GB | +| 30–34B | Mixtral, Codestral | 24GB | +| 70B | Llama 3.1 70B | 48GB | -* Mac: 64GB unified memory — good for larger models but with lower throughput. -* Windows (NVIDIA RTX 5090): 32GB VRAM — excellent performance, but limited by VRAM capacity. +On Apple Silicon Macs, unified memory is shared between CPU and GPU — an M2 Mac with 16GB unified memory can run 7–8B models comfortably. -> 🧠 Rule of thumb: You’ll need roughly 1GB of VRAM per billion parameters. +**Software requirements** ---- +- macOS 12+, Windows 10+, or Ubuntu 20.04+ +- No account required — Ollama is free and open source -### 2. Run your first model +## 1. Install Ollama -Run a model locally: +**macOS** -> ollama run gpt-oss +Download the macOS app from [ollama.com/download](https://ollama.com/download). Once installed, Ollama runs as a background service and appears in your menu bar. -For example: +Alternatively, install via Homebrew: -* Try GPT-OSS 20B (requires ≥16GB VRAM, supports tool calling). -* Then try Mistral 8B for a faster, smaller alternative. +```bash +brew install ollama +``` -Compare their performance and quality side-by-side.\ -Use Warp to easily monitor GPU usage and model response time. +If you installed via Homebrew, start the server manually before using it: ---- +```bash +ollama serve +``` -### 3. Understanding model terms +**Linux** -Here’s a quick glossary for choosing the right local model: +```bash +curl -fsSL https://ollama.com/install.sh | sh +``` -| Term | Meaning | -| ---------------- | ------------------------------------------------------------------ | -| **Thinking** | The model “thinks” before answering; better for complex reasoning. | -| **Tools** | Models can use external utilities (e.g., web search). | -| **Vision** | Can process and respond to images. | -| **Embedding** | Converts text to numeric form for search or RAG pipelines. | -| **Quantization** | Reduces memory use by lowering precision (e.g., 4-bit). | +The installer sets up Ollama as a `systemd` service that starts automatically on boot. ---- +**Windows** -### 4. Integrate Ollama into your app +Download the Windows installer from [ollama.com/download](https://ollama.com/download). Ollama runs as a background service after installation. -Most apps use OpenAI-compatible APIs, so integration is simple. +## 2. Run your first model -1. Open your app’s code in Warp. -2. Locate the OpenAI client initialization. -3. Replace the base URL with Ollama's -4. Update your API key and model name. +Pull a model to download it locally. This example uses Llama 3.2 (3B), a lightweight model that runs on most hardware: -Warp helps you quickly locate, edit, and test the integration directly from the terminal. +```bash +ollama pull llama3.2 +``` ---- +Then start an interactive chat session: + +```bash +ollama run llama3.2 +``` + +Type your prompt and press Enter. Type `/bye` to exit the session. + +To try a larger model with stronger reasoning: + +```bash +ollama run llama3.1:8b +``` + +Use `ollama list` to see all models you've downloaded, and `ollama ps` to see which models are currently loaded in memory. + +## 3. Understand model types + +When browsing [ollama.com/library](https://ollama.com/library), you'll see labels on models that indicate their capabilities: + +| Term | Meaning | +|---|---| +| **Thinking** | The model "thinks" before answering; better for complex reasoning. | +| **Tools** | Models can call external functions or utilities (e.g., web search). | +| **Vision** | Can process and respond to images. | +| **Embedding** | Converts text to numeric vectors for search or RAG pipelines. | +| **Quantization** | Reduces memory use by lowering weight precision (e.g., 4-bit, 8-bit). | + +Quantized models (e.g., `q4_0`, `q8_0` variants) use significantly less memory than full-precision originals. Start with a quantized version if you're memory-constrained. + +## 4. Compare model performance + +To benchmark models side by side, Warp makes it easy to run prompts in parallel tabs and compare results. Use `ollama run` with a specific prompt to get inline timing stats: + +```bash +ollama run llama3.2 "Summarize the Rust ownership model in one paragraph" +``` + +Ollama prints timing information at the end of each non-interactive request, including tokens generated and throughput (`eval rate: X tokens/s`). Run the same prompt on two different models to compare speed and output quality before committing to one. + +To monitor memory usage while a model runs: + +```bash +# See which models are loaded and how much memory they're using +ollama ps +``` + +## 5. Integrate Ollama into your app + +Ollama exposes an OpenAI-compatible REST API at `http://localhost:11434/v1`. You can drop it in wherever you're currently using the OpenAI API — just update three values: + +1. **Base URL** → `http://localhost:11434/v1` +2. **API key** → any non-empty string (e.g., `"ollama"`) +3. **Model name** → the name of your local model (e.g., `"llama3.2"`) + +**Python (OpenAI SDK)** + +```python +from openai import OpenAI + +client = OpenAI( + base_url="http://localhost:11434/v1", + api_key="ollama", # required by the SDK but not validated by Ollama +) + +response = client.chat.completions.create( + model="llama3.2", + messages=[ + {"role": "user", "content": "Explain async/await in Python"} + ] +) + +print(response.choices[0].message.content) +``` + +**Node.js (OpenAI SDK)** + +```javascript +import OpenAI from "openai"; + +const client = new OpenAI({ + baseURL: "http://localhost:11434/v1", + apiKey: "ollama", // required by the SDK but not validated by Ollama +}); + +const response = await client.chat.completions.create({ + model: "llama3.2", + messages: [{ role: "user", content: "Explain async/await in Python" }], +}); + +console.log(response.choices[0].message.content); +``` + +Open your app's code in Warp and use the agent to locate the OpenAI client initialization, swap in the new values, and test the connection — all from the same terminal session. + +## 6. Customize model behavior + +You can create a custom model variant by writing a `Modelfile` — a configuration file that sets a system prompt, adjusts generation parameters, or builds on any existing Ollama model. + +Create a file called `Modelfile`: + +``` +FROM llama3.2 + +SYSTEM """ +You are a focused code review assistant. +Always identify security issues first, then logic errors, then style. +Keep feedback concise and actionable. +""" + +PARAMETER temperature 0.3 +PARAMETER num_ctx 8192 +``` + +Then build and run your custom model: + +```bash +ollama create code-reviewer -f ./Modelfile +ollama run code-reviewer +``` + +Your custom model is saved locally and available any time you run `ollama run code-reviewer`. Ask Warp's agent to generate a Modelfile for a specific use case — describe what you want the model to do, and let the agent write the configuration. + +## Productivity tips -### 6. Customize model behavior +- **Preload a model** — Run `ollama run ""` to load a model into memory before your first real prompt, so the initial response isn't delayed by model loading time. +- **Unload to free memory** — Use `ollama stop ` to unload a model from memory before loading a larger one. +- **Script with the REST API** — For quick testing without the SDK: `curl http://localhost:11434/api/generate -d '{"model": "llama3.2", "prompt": "Hello", "stream": false}'` +- **Keep a model inventory** — `ollama list` shows all locally cached models with their sizes and last-used dates. Use `ollama rm ` to delete models you no longer need. +- **Compare models in parallel** — Open side-by-side Warp tabs and run the same prompt against two different models to compare quality and speed before deciding which to use in your app. -Pull and modify a model. +## Next steps -Then save it as a custom model with new settings like temperature or system prompt. +You have Ollama installed, a model running locally, and a path to integrate it into any app using the OpenAI-compatible API. -Use Warp to generate a model file automatically. +Explore related guides and features: -This adds a structured system prompt for that task — ready to use instantly. +- [Set up Claude Code](/guides/external-tools/how-to-set-up-claude-code/) or [Set up Codex CLI](/guides/external-tools/how-to-set-up-codex-cli/) — use cloud-based agents alongside your local Ollama setup +- [Run multiple agents at once](/guides/agent-workflows/how-to-run-multiple-ai-coding-agents/) — run Ollama and a cloud agent in parallel to compare outputs on the same task +- [Ollama model library](https://ollama.com/library) — browse all available models with size and capability details +- [Ollama documentation](https://github.com/ollama/ollama/blob/main/README.md) — advanced configuration, GPU setup, and environment variables From 68b4387358ca62bac1f227f268a5024dd1342cfe Mon Sep 17 00:00:00 2001 From: Rachael Rose Renk <91027132+rachaelrenk@users.noreply.github.com> Date: Thu, 9 Jul 2026 15:26:37 -0600 Subject: [PATCH 2/7] fix: correct factual errors in Ollama guide after review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After cross-checking against official Ollama docs: - Fix macOS minimum version: macOS 12+ → macOS 14 Sonoma+ - Fix macOS install: replace non-official brew path with official curl script (same script as Linux); add DMG as manual alternative - Fix Windows install: add official PowerShell one-liner (irm https://ollama.com/install.ps1 | iex) alongside manual installer - Fix CLI command: ollama list → ollama ls (official canonical command) - Fix base URL: add trailing slash to http://localhost:11434/v1/ per official OpenAI compat docs - Fix REST API curl example: /api/generate → /api/chat with messages format - Remove undocumented preloading tip (ollama run "") - Add --verbose flag for timing stats instead of claiming they print by default - Mention native ollama-python/ollama-js SDKs alongside OpenAI compat path - Fix gh pr view --web comment (was incorrectly 'copy the diff URL') Co-Authored-By: Oz --- .../how-to-review-prs-like-a-senior-dev.mdx | 2 +- .../external-tools/how-to-set-up-ollama.mdx | 56 ++++++++++--------- 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/src/content/docs/guides/agent-workflows/how-to-review-prs-like-a-senior-dev.mdx b/src/content/docs/guides/agent-workflows/how-to-review-prs-like-a-senior-dev.mdx index dc5acbc38..a3063f73b 100644 --- a/src/content/docs/guides/agent-workflows/how-to-review-prs-like-a-senior-dev.mdx +++ b/src/content/docs/guides/agent-workflows/how-to-review-prs-like-a-senior-dev.mdx @@ -43,7 +43,7 @@ If the PR is on GitHub, pull the diff directly: # View the diff as text gh pr diff -# Or open the PR in your browser to copy the diff URL +# Or open the PR in your browser for full context gh pr view --web ``` diff --git a/src/content/docs/guides/external-tools/how-to-set-up-ollama.mdx b/src/content/docs/guides/external-tools/how-to-set-up-ollama.mdx index 7a6088cab..7cf2b92ef 100644 --- a/src/content/docs/guides/external-tools/how-to-set-up-ollama.mdx +++ b/src/content/docs/guides/external-tools/how-to-set-up-ollama.mdx @@ -33,26 +33,20 @@ On Apple Silicon Macs, unified memory is shared between CPU and GPU — an M2 Ma **Software requirements** -- macOS 12+, Windows 10+, or Ubuntu 20.04+ +- macOS 14 Sonoma+, Windows 10+, or Ubuntu 20.04+ - No account required — Ollama is free and open source ## 1. Install Ollama **macOS** -Download the macOS app from [ollama.com/download](https://ollama.com/download). Once installed, Ollama runs as a background service and appears in your menu bar. - -Alternatively, install via Homebrew: +Run the install script in your terminal: ```bash -brew install ollama +curl -fsSL https://ollama.com/install.sh | sh ``` -If you installed via Homebrew, start the server manually before using it: - -```bash -ollama serve -``` +Or download the macOS app manually from [ollama.com/download](https://ollama.com/download/Ollama.dmg). The app runs as a background service and appears in your menu bar. **Linux** @@ -64,7 +58,13 @@ The installer sets up Ollama as a `systemd` service that starts automatically on **Windows** -Download the Windows installer from [ollama.com/download](https://ollama.com/download). Ollama runs as a background service after installation. +Run this in PowerShell: + +```powershell +irm https://ollama.com/install.ps1 | iex +``` + +Or download the installer manually from [ollama.com/download](https://ollama.com/download). Ollama runs as a background service after installation. ## 2. Run your first model @@ -88,7 +88,7 @@ To try a larger model with stronger reasoning: ollama run llama3.1:8b ``` -Use `ollama list` to see all models you've downloaded, and `ollama ps` to see which models are currently loaded in memory. +Use `ollama ls` to see all models you've downloaded, and `ollama ps` to see which models are currently loaded in memory. ## 3. Understand model types @@ -106,27 +106,30 @@ Quantized models (e.g., `q4_0`, `q8_0` variants) use significantly less memory t ## 4. Compare model performance -To benchmark models side by side, Warp makes it easy to run prompts in parallel tabs and compare results. Use `ollama run` with a specific prompt to get inline timing stats: +To benchmark models side by side, Warp makes it easy to run prompts in parallel tabs and compare results. Pass a prompt directly to `ollama run` for a quick, non-interactive response: ```bash ollama run llama3.2 "Summarize the Rust ownership model in one paragraph" ``` -Ollama prints timing information at the end of each non-interactive request, including tokens generated and throughput (`eval rate: X tokens/s`). Run the same prompt on two different models to compare speed and output quality before committing to one. +Run the same prompt on two different models to compare output quality before committing to one. For detailed timing stats (tokens generated, throughput), add the `--verbose` flag: + +```bash +ollama run --verbose llama3.2 "Summarize the Rust ownership model in one paragraph" +``` -To monitor memory usage while a model runs: +To see which models are currently loaded and their memory usage: ```bash -# See which models are loaded and how much memory they're using ollama ps ``` ## 5. Integrate Ollama into your app -Ollama exposes an OpenAI-compatible REST API at `http://localhost:11434/v1`. You can drop it in wherever you're currently using the OpenAI API — just update three values: +Ollama exposes an OpenAI-compatible REST API at `http://localhost:11434/v1/`. You can drop it in wherever you're currently using the OpenAI API — just update three values: -1. **Base URL** → `http://localhost:11434/v1` -2. **API key** → any non-empty string (e.g., `"ollama"`) +1. **Base URL** → `http://localhost:11434/v1/` +2. **API key** → any non-empty string (e.g., `"ollama"` — required by the SDK but ignored by Ollama) 3. **Model name** → the name of your local model (e.g., `"llama3.2"`) **Python (OpenAI SDK)** @@ -135,8 +138,8 @@ Ollama exposes an OpenAI-compatible REST API at `http://localhost:11434/v1`. You from openai import OpenAI client = OpenAI( - base_url="http://localhost:11434/v1", - api_key="ollama", # required by the SDK but not validated by Ollama + base_url="http://localhost:11434/v1/", + api_key="ollama", # required by the SDK but ignored by Ollama ) response = client.chat.completions.create( @@ -155,8 +158,8 @@ print(response.choices[0].message.content) import OpenAI from "openai"; const client = new OpenAI({ - baseURL: "http://localhost:11434/v1", - apiKey: "ollama", // required by the SDK but not validated by Ollama + baseURL: "http://localhost:11434/v1/", + apiKey: "ollama", // required by the SDK but ignored by Ollama }); const response = await client.chat.completions.create({ @@ -167,6 +170,8 @@ const response = await client.chat.completions.create({ console.log(response.choices[0].message.content); ``` +Ollama also provides native Python and JavaScript libraries (`ollama-python`, `ollama-js`) if you prefer an SDK built specifically for Ollama rather than the OpenAI compatibility layer. See the [Ollama README](https://github.com/ollama/ollama) for details. + Open your app's code in Warp and use the agent to locate the OpenAI client initialization, swap in the new values, and test the connection — all from the same terminal session. ## 6. Customize model behavior @@ -199,10 +204,9 @@ Your custom model is saved locally and available any time you run `ollama run co ## Productivity tips -- **Preload a model** — Run `ollama run ""` to load a model into memory before your first real prompt, so the initial response isn't delayed by model loading time. - **Unload to free memory** — Use `ollama stop ` to unload a model from memory before loading a larger one. -- **Script with the REST API** — For quick testing without the SDK: `curl http://localhost:11434/api/generate -d '{"model": "llama3.2", "prompt": "Hello", "stream": false}'` -- **Keep a model inventory** — `ollama list` shows all locally cached models with their sizes and last-used dates. Use `ollama rm ` to delete models you no longer need. +- **Script with the REST API** — For quick testing without the SDK: `curl http://localhost:11434/api/chat -d '{"model": "llama3.2", "messages": [{"role": "user", "content": "Hello"}], "stream": false}'` +- **Keep a model inventory** — `ollama ls` shows all locally cached models with their sizes and last-used dates. Use `ollama rm ` to delete models you no longer need. - **Compare models in parallel** — Open side-by-side Warp tabs and run the same prompt against two different models to compare quality and speed before deciding which to use in your app. ## Next steps From a751589b3bd1ee27b812d3e22f82e1ede5743c78 Mon Sep 17 00:00:00 2001 From: Rachael Rose Renk <91027132+rachaelrenk@users.noreply.github.com> Date: Thu, 9 Jul 2026 16:08:49 -0600 Subject: [PATCH 3/7] Update src/content/docs/guides/external-tools/how-to-set-up-ollama.mdx Co-authored-by: oz-for-oss[bot] <277970191+oz-for-oss[bot]@users.noreply.github.com> --- src/content/docs/guides/external-tools/how-to-set-up-ollama.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/guides/external-tools/how-to-set-up-ollama.mdx b/src/content/docs/guides/external-tools/how-to-set-up-ollama.mdx index 7cf2b92ef..577802950 100644 --- a/src/content/docs/guides/external-tools/how-to-set-up-ollama.mdx +++ b/src/content/docs/guides/external-tools/how-to-set-up-ollama.mdx @@ -109,7 +109,7 @@ Quantized models (e.g., `q4_0`, `q8_0` variants) use significantly less memory t To benchmark models side by side, Warp makes it easy to run prompts in parallel tabs and compare results. Pass a prompt directly to `ollama run` for a quick, non-interactive response: ```bash -ollama run llama3.2 "Summarize the Rust ownership model in one paragraph" +ollama run llama3.2 --verbose "Summarize the Rust ownership model in one paragraph" ``` Run the same prompt on two different models to compare output quality before committing to one. For detailed timing stats (tokens generated, throughput), add the `--verbose` flag: From 01f33cad2d4127e35a7542f98a411e262d815303 Mon Sep 17 00:00:00 2001 From: Rachael Rose Renk <91027132+rachaelrenk@users.noreply.github.com> Date: Thu, 9 Jul 2026 16:09:02 -0600 Subject: [PATCH 4/7] Update src/content/docs/guides/agent-workflows/how-to-review-prs-like-a-senior-dev.mdx Co-authored-by: oz-for-oss[bot] <277970191+oz-for-oss[bot]@users.noreply.github.com> --- .../agent-workflows/how-to-review-prs-like-a-senior-dev.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/content/docs/guides/agent-workflows/how-to-review-prs-like-a-senior-dev.mdx b/src/content/docs/guides/agent-workflows/how-to-review-prs-like-a-senior-dev.mdx index a3063f73b..fe5d7cc6d 100644 --- a/src/content/docs/guides/agent-workflows/how-to-review-prs-like-a-senior-dev.mdx +++ b/src/content/docs/guides/agent-workflows/how-to-review-prs-like-a-senior-dev.mdx @@ -41,10 +41,10 @@ If the PR is on GitHub, pull the diff directly: ```bash # View the diff as text -gh pr diff +gh pr diff PR_NUMBER -# Or open the PR in your browser for full context -gh pr view --web +# Or open the PR in your browser to copy the diff URL +gh pr view PR_NUMBER --web ``` **Option B: Git diff** From a4390524651a557878628f0d7fed5537705ed7a3 Mon Sep 17 00:00:00 2001 From: Rachael Rose Renk <91027132+rachaelrenk@users.noreply.github.com> Date: Fri, 10 Jul 2026 11:47:16 -0600 Subject: [PATCH 5/7] Apply suggestion from @rachaelrenk --- src/content/docs/guides/external-tools/how-to-set-up-ollama.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/guides/external-tools/how-to-set-up-ollama.mdx b/src/content/docs/guides/external-tools/how-to-set-up-ollama.mdx index 577802950..743ef6200 100644 --- a/src/content/docs/guides/external-tools/how-to-set-up-ollama.mdx +++ b/src/content/docs/guides/external-tools/how-to-set-up-ollama.mdx @@ -29,7 +29,7 @@ You'll need enough memory to load the model weights. The rule of thumb: roughly | 30–34B | Mixtral, Codestral | 24GB | | 70B | Llama 3.1 70B | 48GB | -On Apple Silicon Macs, unified memory is shared between CPU and GPU — an M2 Mac with 16GB unified memory can run 7–8B models comfortably. +On Apple Silicon Macs, unified memory is shared between CPU and GPU. An M2 Mac with 16GB unified memory can run 7–8B models comfortably. **Software requirements** From 2717d4ae7e15a39965171b7e4874acfcaeb39fbf Mon Sep 17 00:00:00 2001 From: Rachael Rose Renk <91027132+rachaelrenk@users.noreply.github.com> Date: Fri, 10 Jul 2026 11:50:43 -0600 Subject: [PATCH 6/7] fix: address PR review comments - Remove 'rule of thumb' colloquialism; replace with 'as a general estimate' - Remove em dash from Apple Silicon sentence per suggestion (use period) - Consolidate benchmark example to single --verbose command so timing stats are actually visible (critical fix from oz-for-oss review) - Replace angle-bracket placeholders with PR_NUMBER (ALL_CAPS per docs style guide) in both the code block and inline reference Co-Authored-By: Oz --- .../how-to-review-prs-like-a-senior-dev.mdx | 4 ++-- .../guides/external-tools/how-to-set-up-ollama.mdx | 12 ++++-------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/content/docs/guides/agent-workflows/how-to-review-prs-like-a-senior-dev.mdx b/src/content/docs/guides/agent-workflows/how-to-review-prs-like-a-senior-dev.mdx index fe5d7cc6d..f6c119b73 100644 --- a/src/content/docs/guides/agent-workflows/how-to-review-prs-like-a-senior-dev.mdx +++ b/src/content/docs/guides/agent-workflows/how-to-review-prs-like-a-senior-dev.mdx @@ -43,7 +43,7 @@ If the PR is on GitHub, pull the diff directly: # View the diff as text gh pr diff PR_NUMBER -# Or open the PR in your browser to copy the diff URL +# Or open the PR in your browser for full context gh pr view PR_NUMBER --web ``` @@ -69,7 +69,7 @@ cd ~/your-project Attach the diff as context so the agent can reason about the actual code. You have a few options: -- **Select terminal output** — Run `gh pr diff ` or `git diff`, then select the output block and attach it using the block action menu. +- **Select terminal output** — Run `gh pr diff PR_NUMBER` or `git diff`, then select the output block and attach it using the block action menu. - **Reference specific files** — Use `@path/to/file` in your prompt to point the agent at changed files. - **Paste inline** — For smaller diffs, paste the diff directly into the agent input. diff --git a/src/content/docs/guides/external-tools/how-to-set-up-ollama.mdx b/src/content/docs/guides/external-tools/how-to-set-up-ollama.mdx index 743ef6200..c85e90ee7 100644 --- a/src/content/docs/guides/external-tools/how-to-set-up-ollama.mdx +++ b/src/content/docs/guides/external-tools/how-to-set-up-ollama.mdx @@ -19,7 +19,7 @@ Run AI models locally — with no API costs, no data leaving your machine, and y **Hardware requirements** -You'll need enough memory to load the model weights. The rule of thumb: roughly 1GB of memory per billion parameters. +You'll need enough memory to load the model weights. As a general estimate, plan on roughly 1GB of memory per billion parameters. | Model size | Example models | Minimum RAM/VRAM | |---|---|---| @@ -106,18 +106,14 @@ Quantized models (e.g., `q4_0`, `q8_0` variants) use significantly less memory t ## 4. Compare model performance -To benchmark models side by side, Warp makes it easy to run prompts in parallel tabs and compare results. Pass a prompt directly to `ollama run` for a quick, non-interactive response: - -```bash -ollama run llama3.2 --verbose "Summarize the Rust ownership model in one paragraph" -``` - -Run the same prompt on two different models to compare output quality before committing to one. For detailed timing stats (tokens generated, throughput), add the `--verbose` flag: +To benchmark models side by side, Warp makes it easy to run prompts in parallel tabs and compare results. Pass a prompt and the `--verbose` flag to get timing stats alongside the response: ```bash ollama run --verbose llama3.2 "Summarize the Rust ownership model in one paragraph" ``` +Run the same prompt on two different models to compare output quality and throughput before committing to one. + To see which models are currently loaded and their memory usage: ```bash From 391a6a8858427777a9232b5e3005bb20c31bc08b Mon Sep 17 00:00:00 2001 From: Rachael Rose Renk <91027132+rachaelrenk@users.noreply.github.com> Date: Fri, 10 Jul 2026 16:08:17 -0600 Subject: [PATCH 7/7] fix: correct 6 factual errors found in full truthiness review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. SDK package names: ollama-python/ollama-js (GitHub repo names) -> 'pip install ollama' and 'npm i ollama' (actual package names) 2. Remove 'Quantization' from model types table — it is not a label displayed in ollama.com/library; it is a property of model tag variants (e.g. :q4_0). Update column header to 'Label' to match the actual UI. Quantized model paragraph below the table is kept. 3. Phi-3 Mini clarified as 3.8B in the 3B row (ollama library: phi3:3.8b) 4. 30-34B row corrected: Codestral is 22B, not 30-34B; Mixtral is 46.7B total params (MoE). Row label changed to 22-34B. 5. Linux systemd claim softened: the curl installer does not automatically enable a service on all distros; replaced with explicit systemctl commands to start and enable Ollama. 6. ollama ls described as showing 'last-used dates' -> 'download dates' (the MODIFIED column reflects when a model was pulled, not used) Co-Authored-By: Oz --- .../external-tools/how-to-set-up-ollama.mdx | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/content/docs/guides/external-tools/how-to-set-up-ollama.mdx b/src/content/docs/guides/external-tools/how-to-set-up-ollama.mdx index c85e90ee7..a2f48bff7 100644 --- a/src/content/docs/guides/external-tools/how-to-set-up-ollama.mdx +++ b/src/content/docs/guides/external-tools/how-to-set-up-ollama.mdx @@ -23,10 +23,10 @@ You'll need enough memory to load the model weights. As a general estimate, plan | Model size | Example models | Minimum RAM/VRAM | |---|---|---| -| 3B | Llama 3.2 3B, Phi-3 Mini | 4GB | +| 3B | Llama 3.2 3B, Phi-3 Mini (3.8B) | 4GB | | 7–8B | Mistral 7B, Llama 3.1 8B | 8GB | | 13B | Llama 2 13B | 16GB | -| 30–34B | Mixtral, Codestral | 24GB | +| 22–34B | Codestral (22B), Mixtral (46.7B total) | 24GB | | 70B | Llama 3.1 70B | 48GB | On Apple Silicon Macs, unified memory is shared between CPU and GPU. An M2 Mac with 16GB unified memory can run 7–8B models comfortably. @@ -54,7 +54,12 @@ Or download the macOS app manually from [ollama.com/download](https://ollama.com curl -fsSL https://ollama.com/install.sh | sh ``` -The installer sets up Ollama as a `systemd` service that starts automatically on boot. +On systemd-based Linux distributions, the installer typically registers Ollama as a service. To start it and enable it on boot, run: + +```bash +sudo systemctl enable ollama +sudo systemctl start ollama +``` **Windows** @@ -94,13 +99,12 @@ Use `ollama ls` to see all models you've downloaded, and `ollama ps` to see whic When browsing [ollama.com/library](https://ollama.com/library), you'll see labels on models that indicate their capabilities: -| Term | Meaning | +| Label | Meaning | |---|---| -| **Thinking** | The model "thinks" before answering; better for complex reasoning. | -| **Tools** | Models can call external functions or utilities (e.g., web search). | -| **Vision** | Can process and respond to images. | -| **Embedding** | Converts text to numeric vectors for search or RAG pipelines. | -| **Quantization** | Reduces memory use by lowering weight precision (e.g., 4-bit, 8-bit). | +| **thinking** | The model reasons step-by-step before answering; better for complex problems. | +| **tools** | The model can call external functions or utilities (e.g., web search). | +| **vision** | The model can process and respond to images. | +| **embedding** | Converts text to numeric vectors for search or RAG pipelines. | Quantized models (e.g., `q4_0`, `q8_0` variants) use significantly less memory than full-precision originals. Start with a quantized version if you're memory-constrained. @@ -166,7 +170,7 @@ const response = await client.chat.completions.create({ console.log(response.choices[0].message.content); ``` -Ollama also provides native Python and JavaScript libraries (`ollama-python`, `ollama-js`) if you prefer an SDK built specifically for Ollama rather than the OpenAI compatibility layer. See the [Ollama README](https://github.com/ollama/ollama) for details. +Ollama also provides official native libraries if you prefer an SDK built specifically for Ollama rather than the OpenAI compatibility layer: `pip install ollama` for Python and `npm i ollama` for JavaScript. See the [Ollama README](https://github.com/ollama/ollama) for details. Open your app's code in Warp and use the agent to locate the OpenAI client initialization, swap in the new values, and test the connection — all from the same terminal session. @@ -202,7 +206,7 @@ Your custom model is saved locally and available any time you run `ollama run co - **Unload to free memory** — Use `ollama stop ` to unload a model from memory before loading a larger one. - **Script with the REST API** — For quick testing without the SDK: `curl http://localhost:11434/api/chat -d '{"model": "llama3.2", "messages": [{"role": "user", "content": "Hello"}], "stream": false}'` -- **Keep a model inventory** — `ollama ls` shows all locally cached models with their sizes and last-used dates. Use `ollama rm ` to delete models you no longer need. +- **Keep a model inventory** — `ollama ls` shows all locally cached models with their sizes and download dates. Use `ollama rm ` to delete models you no longer need. - **Compare models in parallel** — Open side-by-side Warp tabs and run the same prompt against two different models to compare quality and speed before deciding which to use in your app. ## Next steps