> ## Documentation Index
> Fetch the complete documentation index at: https://docs.moxycode.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Offline Mode

> Run MoxyCode fully locally with Ollama — your code never leaves your machine.

<iframe width="100%" height="400" src="https://www.youtube.com/embed/YOUR_VIDEO_ID" title="MoxyCode Offline Mode" frameBorder="0" allowFullScreen />

Offline Mode runs MoxyCode entirely on your machine using [Ollama](https://ollama.com) — a local AI runtime. No code is sent to any external service. This makes it ideal for restricted environments, air-gapped networks, or developers who require complete data sovereignty.

<Note>
  Offline Mode requires a **Pro** plan. Running `MoxyCode: Set Up Offline Mode` on a Free plan will show an upgrade prompt.
</Note>

## Requirements

|                |                                                      |
| -------------- | ---------------------------------------------------- |
| **Plan**       | Pro                                                  |
| **RAM**        | 4GB minimum (8GB recommended, 16GB for best quality) |
| **Disk space** | 1GB minimum (up to 9GB depending on model chosen)    |
| **OS**         | macOS or Windows                                     |

## Setup

Run the guided setup from the Command Palette:

MoxyCode: Set Up Offline Mode

The setup wizard opens and checks your system automatically.

### Step 1 — System check

MoxyCode scans your machine and shows your available RAM, free disk space, and Ollama status. The wizard handles three scenarios automatically:

**Ollama not installed:**
Ollama will be installed automatically during setup. Choose the AI model that best matches your hardware.

**Ollama installed, compatible model found:**
MoxyCode detects your existing model and proceeds directly to configuration. Click **Configure MoxyCode** to continue.

**Ollama installed, no compatible model:**
MoxyCode detects Ollama but no suitable model. Choose a model to download and click **Set Up Offline Mode**.

When choosing a model, select based on your available RAM:

| Model                   | Quality     | Download size | RAM required |
| ----------------------- | ----------- | ------------- | ------------ |
| **Qwen 2.5 Coder 14B**  | Best        | 9GB           | 16GB         |
| **Qwen 2.5 Coder 7B**   | Great       | 4.7GB         | 8GB          |
| **Qwen 2.5 Coder 1.5B** | Lightweight | 1GB           | 4GB          |

MoxyCode automatically selects the recommended model based on your available RAM.

<Tip>
  Any Ollama model works with MoxyCode — the options above are our recommendations for Salesforce development. To use a different model, install it via terminal first with `ollama pull <your-model-name>`, then run the setup wizard.
</Tip>

<Frame>
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/moxycode/images/offline-setup-step1-fresh.png" alt="MoxyCode Offline Mode setup — fresh install system check" />
</Frame>

<Frame>
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/moxycode/images/offline-setup-step1-existing.png" alt="MoxyCode Offline Mode setup — existing Ollama detected" />
</Frame>

### Step 2 — Installation and download

MoxyCode handles everything automatically with a live progress screen:

* **Installing Ollama** — installs the local AI runtime (skipped if already installed)
* **Downloading AI model** — downloads your selected model with a live progress percentage
* **Configuring MoxyCode** — connects MoxyCode to the local model

<Frame>
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/moxycode/images/offline-setup-progress.png" alt="MoxyCode Offline Mode setup — progress screen" />
</Frame>

<Note>
  The 14B model is \~9GB and may take several minutes to over 30 minutes to download depending on your internet speed. Keep VS Code open during the download.
</Note>

### Step 3 — Complete

Once setup is complete, MoxyCode shows **Offline Mode Ready!**

* Click **Switch to Offline Mode** to start using offline AI immediately
* Click **Stay Online** to keep using online mode and switch later

<Frame>
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/moxycode/images/offline-setup-complete.png" alt="MoxyCode Offline Mode Ready screen" />
</Frame>

<Note>
  Once setup is complete, Ollama starts automatically on login. You don't need to do anything to keep it running.
</Note>

<Note>
  The local setup (Ollama and the AI model) stays on your machine even if you uninstall MoxyCode. Use `MoxyCode: Clean Up Offline Files` to remove it when no longer needed.
</Note>

## Switching between Online and Offline

Once Offline Mode is set up, switch between modes instantly from the Command Palette:

MoxyCode: Toggle Online / Offline Mode

* **Switching to Offline** shows: *"MoxyCode: Switched to Offline Mode — using local Ollama model"*
* **Switching to Online** shows: *"MoxyCode: Switched to Online Mode — using cloud AI"*

The mode persists across sessions — MoxyCode remembers your last setting.

Alternatively, switch via VS Code Settings (`Cmd+,` / `Ctrl+,`) — search for `moxycode` and change the **MoxyCode: Mode** dropdown between `online` and `offline`.

<Frame>
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/moxycode/images/offline-mode-toggle-notification.png" alt="MoxyCode switched to Offline Mode notification" />
</Frame>

## Removing Offline Mode

Run the cleanup command from the Command Palette:

MoxyCode: Clean Up Offline Files

A confirmation dialog appears asking what you want to remove.

### Remove model only

Removes the AI model (\~9GB freed) but keeps Ollama on your machine. Choose this if you use Ollama for other tools or projects.

**Result:**

* ✅ AI model removed (freed \~9 GB)
* Ollama kept — still available for other tools

### Remove model + Ollama

Removes both the AI model and Ollama from your machine completely.

1. **First confirmation** — lists the AI model to be removed and warns that other applications using Ollama will be affected. Click **Remove model + Ollama** to continue.
2. **Second confirmation** — confirms Ollama removal specifically. You may be prompted for your system password — this is expected when uninstalling system applications.
3. **Cleanup complete** — AI model removed and Ollama removed.

**Result:**

* ✅ AI model removed (freed \~9 GB)
* ✅ Ollama removed

<Warning>
  Only remove Ollama if you no longer need local AI on this machine. Removing Ollama will disable offline AI features for MoxyCode and any other applications that use it.
</Warning>

<Frame>
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/moxycode/images/offline-cleanup-dialog.png" alt="MoxyCode Clean Up Offline Files confirmation dialog" />
</Frame>

## Common issues

<AccordionGroup>
  <Accordion title="MoxyCode: Set Up Offline Mode shows an upgrade prompt">
    Offline Mode requires a Pro plan. Upgrade at [moxycode.com](https://moxycode.com) to access Offline Mode.
  </Accordion>

  <Accordion title="Not enough disk space for the model">
    The recommended 14B model requires \~9GB of free disk space. If you don't have enough space:

    * Choose the **7B model** (4.7GB) or **1.5B Lite model** (1GB) during setup
    * Free up disk space and run `MoxyCode: Set Up Offline Mode` again
  </Accordion>

  <Accordion title="Not enough RAM for the recommended model">
    MoxyCode automatically selects the best model for your available RAM:

    * **16GB RAM or more** — Qwen 2.5 Coder 14B (best quality)
    * **8GB RAM** — Qwen 2.5 Coder 7B (great quality)
    * **4GB RAM** — Qwen 2.5 Coder 1.5B Lite (lightweight)
  </Accordion>

  <Accordion title="Model download stopped or is taking too long">
    The model download requires a stable internet connection. If the download stalls:

    1. Keep VS Code open and wait — the download resumes automatically in most cases
    2. If it appears stuck for more than 10 minutes, close VS Code and run `MoxyCode: Set Up Offline Mode` again — the wizard will detect the partial download and resume
  </Accordion>

  <Accordion title="Ollama is installed but showing as not detected">
    Run `MoxyCode: Set Up Offline Mode` again — Ollama may not have been running when the wizard first scanned. The wizard will detect it on the next scan.
  </Accordion>

  <Accordion title="Offline mode not working after setup">
    1. Check that **MoxyCode: Mode** is set to `offline` in VS Code Settings (`Cmd+,` / `Ctrl+,`)
    2. Run **Developer: Reload Window** from the Command Palette and try again
    3. If the issue persists, run `MoxyCode: Clean Up Offline Files` and set up again
  </Accordion>

  <Accordion title="System password prompt appeared during cleanup — is this normal?">
    Yes — removing Ollama requires system-level permissions. The password prompt is expected when uninstalling system applications. Enter your login password to proceed.
  </Accordion>

  <Accordion title="I uninstalled MoxyCode but Ollama is still running on my machine">
    The local setup (Ollama and the AI model) persists after uninstalling MoxyCode, and Ollama will continue to auto-start on login. To remove it completely:

    1. Reinstall MoxyCode from the VS Code Marketplace
    2. Run `MoxyCode: Clean Up Offline Files` and choose **Remove model + Ollama**
    3. Uninstall MoxyCode again
  </Accordion>

  <Accordion title="MoxyCode: Clean Up Offline Files not working — remove manually via terminal">
    If the cleanup wizard fails, you can remove the model and Ollama manually via terminal.

    **List all installed models first:**

    ```bash theme={null}
      ollama list
    ```

    **Remove your model** (replace `<model-name>` with the name from the list above):

    ```bash theme={null}
      ollama rm <model-name>
    ```

    **Uninstall Ollama on Mac:**

    ```bash theme={null}
      # Stop Ollama
      killall ollama

      # Remove the application
      rm -rf /Applications/Ollama.app

      # Remove models and data
      rm -rf ~/.ollama
    ```

    **Uninstall Ollama on Windows:**

    ```bash theme={null}
      # Uninstall via Windows Settings → Apps → Ollama
      # Then remove model data
      rmdir /s /q %USERPROFILE%\.ollama
    ```
  </Accordion>
</AccordionGroup>

<CardGroup cols={2}>
  <Card title="Safe Mode" icon="shield" href="/configuration/safe-mode">
    Control when fixes are applied to your code
  </Card>

  <Card title="Privacy & FAQ" icon="shield-check" href="/help/privacy-and-faq">
    How MoxyCode handles your code and data in offline mode
  </Card>
</CardGroup>
