localgpu

Index repositories with Ollama embeddings and search code semantically on a local GPU.

2|Updated Jul 28, 2026
One-click install
npx skills add https://github.com/mbadali25/useful-claude-add-ons --skill localgpu-mbadali25
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: localgpu
Source: https://github.com/mbadali25/useful-claude-add-ons/tree/main/plugin/localgpu/skills/localgpu
Command: npx skills add https://github.com/mbadali25/useful-claude-add-ons --skill localgpu-mbadali25

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It keeps code search and Q&A entirely on your own machine, so repository content and tokens never leave for a hosted API while still giving you semantic search over the codebase. ## Core Features & Use Cases - Semantic code search: Builds a local vector index with nomic-embed-text and answers queries via three MCP tools (search_code, index_status, index_refresh) that return file:line hits with short excerpts. - Local chat sidecar: Runs qwen2.5-coder through Ollama for cheap questions, plus a localgpu shell command that launches a separate Claude Code session against a local Anthropic-to-Ollama proxy. - VRAM discipline: Manages an 8 GB GPU with OLLAMA_MAX_LOADED_MODELS=1 and tuned keep-alive values so the embed and chat models never fight for memory. - Use Case: Ask "where is retry logic handled" without knowing the symbol name, get ranked file:line hits from the local index, then Read only the ranges you need. ## Quick Start Ask the assistant to index this repository with localgpu and then search the local index for how authentication is implemented.

Frequently Asked Questions about localgpu

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I search my codebase semantically without a hosted API?

Run a local Ollama instance with nomic-embed-text, index the repository into an on-disk vector store, and call the search_code MCP tool with a natural-language query. It returns ranked file:line hits with excerpts of at most three lines, all over 127.0.0.1.

How do I run a Claude Code session on a local Ollama model?

Use the localgpu shell command, which starts a proxy translating Anthropic Messages API calls into Ollama's /api/chat and launches a separate claude process with ANTHROPIC_BASE_URL pointed at it. The current session's model is never changed.

Why does local semantic search return no results for a file?

Check index_status first: the root may not be indexed, the index may be stale relative to recent edits, or an ignore glob like dist/ or build/ may exclude the file. Also note embedding search finds ideas, so exact symbol names are better handled with Grep.

What happens if I change the embedding model after indexing?

The index is invalidated because vectors from different embedding models are not comparable. The manifest records the embed model name and every search_code or index_refresh call raises an error on mismatch until you rebuild with a full index refresh.

Why does indexing slow down or hit out-of-memory errors on an 8 GB GPU?

Two models are resident at once, fighting for VRAM alongside the desktop. Set OLLAMA_MAX_LOADED_MODELS=1 and a short keep_alive on embedding requests so Ollama evicts one model before loading the other; /api/ps confirms what is loaded.

Can a local 7B model handle tool calls through the proxy?

Yes, with a caveat: the shipped qwen2.5-coder model writes tool calls as JSON text, and the proxy promotes them to real tool_use blocks only for tools the request offered. Images, thinking blocks, and prompt caching are not carried across the translation.