AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

Configuring Local LLMs in Pieces for Air-Gapped Code Search and Explanation

Zosha Barry · 365Finds Editorial
Indexed 88,650 Wiki articles

Put 365 Wiki to work with your AI

Copy the prompt below, paste it into the AI you already use, then ask your question.

Download full Skill

Try it with the prompt first. If you use 365 Wiki often, install the full 365Wiki Skill so you do not have to paste it again. No regular AI? Gemini or Microsoft Copilot on the web will work.

365Wiki Skill

Air-gapped development environments—whether in defense research, core banking systems, or sensitive industrial R&D—are notoriously harsh on modern AI tools. Developers still want the speed of semantic snippet retrieval and instant code explanation, but security teams will immediately block any tool attempting outbound HTTPS handshakes to external cloud endpoints. This is where Pieces stands apart from standard cloud-tethered copilots. Built on top of a local background daemon known as Pieces OS, the platform was architected from the ground up around on-device data processing.

At 365Finds, we appreciate tools that take local execution seriously instead of treating offline support as an afterthought. However, setting up Pieces with local Large Language Models (LLMs) inside a strictly disconnected network is not simply a matter of clicking a download button. In an air-gapped enclave, there is no internet connection to pull model weights or verify licenses on the fly. Getting a seamless snippet search and explanation workflow running requires disciplined staging, offline model provisioning, and a clear understanding of Pieces' internal context grounding.

The Architecture: Why Pieces Can Function Air-Gapped

To configure Pieces without an active connection, you have to understand how its pieces fit together:

Because Pieces OS owns both the retrieval index and the model execution layer locally, your saved code snippets, project context, and natural language prompts never leave the isolated host.

Phase 1: Staging Outside the Air Gap

The most common failure point when deploying to an air-gapped machine is forgetting a dependency. Because your target workstation has zero network access, every binary, package, and model weight file must be staged beforehand on an internet-connected build machine.

  1. Download Core Installers: Retrieve the standalone installers for Pieces OS and Pieces Desktop matching your target operating system (Windows, macOS, or Linux).
  2. Package IDE Extensions: Do not rely on extension marketplace lookups. Download the packaged .vsix file for Visual Studio Code or the offline .zip plugin package for JetBrains IDEs.
  3. Pre-Fetch Local Model Weights: If you plan to use an external local runtime like Ollama alongside Pieces, install Ollama on the staging machine and pull the required models:
    ollama pull mistral:7b-instruct
    ollama pull llama3:8b
    
    Locate the model cache directory (~/.ollama/models on Linux/macOS or %USERPROFILE%\.ollama\models on Windows) and copy the entire blob repository to an encrypted transfer medium.
  4. Security Auditing: Calculate SHA256 checksums for all binaries and model weights to pass your enterprise air-gap data transfer review.

Phase 2: Installing and Verifying Inside the Isolated Enclave

Once your audited transfer medium is mounted inside the air-gapped environment, transfer the files and proceed with the local deployment.

  1. Install Pieces OS First: Run the Pieces OS installer. Ensure the daemon starts and confirms its local socket listener. On Windows and macOS, you should see the Pieces OS icon in your system tray or menu bar.
  2. Install Pieces Desktop & IDE Plugins: Install the Pieces Desktop application. In your IDE, install the extension manually from disk:
    • For VS Code: Run code --install-extension pieces.pieces-vscode.vsix or select Install from VSIX... in the Extensions view.
    • For JetBrains: Go to Settings > Plugins > Install Plugin from Disk... and select the pre-staged ZIP archive.
  3. Deploy the Local Model Store: Install your local model runtime (such as Ollama) on the target machine and restore the pre-fetched model directory. Start the runtime daemon:
    ollama serve
    
    Run ollama list in a terminal to confirm that Mistral or Llama is recognized locally without triggering network lookups.

Phase 3: Copilot Model Selection and Telemetry Lockdown

With the infrastructure running locally, configure Pieces to point strictly to on-device compute.

  1. Switch Active Copilot Model:
    • Open Pieces Desktop or the Pieces Copilot panel in your IDE.
    • Look at the bottom-left corner of the Copilot interface to find the Active Model indicator.
    • Click Change Model to open the model selector modal.
    • Switch from cloud-based models (such as GPT-4o or Claude) to your installed local model (e.g., Mistral 7B or Llama 3 8B, indicated by a desktop/local icon).
  2. Disable Cloud Sync and Telemetry:
    • Navigate to Pieces Desktop Settings > Account / Cloud.
    • Ensure Pieces Cloud sync and automatic cloud backup are switched off.
    • Disable optional crash analytics and telemetry. In an air-gapped system, outgoing telemetry requests will simply timeout, but disabling them cleanly eliminates unnecessary network retries from system logs.

Phase 4: Grounding Context for Offline Code Snippet Search

One of Pieces' strongest technical design choices is its Local RAG (Retrieval-Augmented Generation) pipeline. In an air-gapped environment, you do not just want generic code explanations; you want answers grounded in your team's proprietary code snippets.

  1. Populate the Local Repository: Save relevant code blocks, reusable algorithms, and configuration snippets into Pieces Desktop or directly from your editor using the Pieces context menu.
  2. Local Vector Indexing: Pieces OS automatically extracts metadata, tags, detected languages, and vector embeddings on-device using its internal Workstream Pattern Engine. This index resides in a local database on your hard drive.
  3. Configure Copilot Grounding:
    • In your IDE's Pieces Copilot chat, click Manage Context or the + (Add Context) icon.
    • Select Saved Snippets / Pieces Drive to allow the model to consult your entire offline snippet library.
    • You can also bind specific local repository folders to give the Copilot immediate awareness of surrounding files.
  4. Execute Conversational Search:
    • Type queries directly into Copilot: "Find our custom retry logic for database deadlocks" or "Locate the cryptographic hash validation snippet".
    • Pieces OS performs semantic vector matching locally, surfaces the exact snippet, and references its metadata without contacting any external index.

Phase 5: Air-Gapped Code Explanation Workflow

Once context is linked, developers can trigger deep code explanations directly within their coding flow.

  1. Selection-Based Explanation: Highlight a complex block of code inside your IDE. Right-click and choose Pieces: Explain with Copilot (or Ask Copilot About Selection).
  2. On-Device Inference: Pieces extracts the highlighted code along with surrounding file context, pairs it with any relevant saved snippets in the local index, and feeds the prompt to your local model.
  3. Reviewing the Output: The explanation appears in the Copilot chat window. You can ask follow-up questions—such as "Rewrite this loop without recursion" or "Identify potential memory leaks in this snippet"—knowing that every single token was evaluated within your local CPU and GPU memory space.

365Finds Take: Hardware Reality and Software Caveats

We at 365Finds find Pieces' local-first posture refreshing in an industry obsessed with cloud lock-in. But if you are planning to deploy this across an engineering organization, keep two realities in mind.

First is the hardware footprint. Running a 7B or 8B parameter model alongside heavy IDEs, compile chains, and local database services is demanding. While Pieces OS itself is relatively lightweight, running local inference smoothly requires at least 16 GB of unified RAM or a dedicated GPU with 8 GB of VRAM. If your air-gapped workstations rely on older CPU-only setups, expect token generation speeds to feel noticeably sluggish.

Second is version volatility. Pieces iterates rapidly, and recent architectural changes to its Copilot pipeline (transitioning toward agentic workflows) have led to shifts in how managed local models are exposed across different desktop builds. For air-gapped enterprise rollouts, do not treat Pieces as an auto-updating convenience tool. Lock down a verified version of Pieces OS, your chosen IDE extension, and your local runtime, and test the entire offline loop thoroughly in a staging lab before rolling it out across your air-gapped developers.

References