# Send Local-First LLM to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "local-first-llm",
    "name": "Local-First LLM",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/joelnishanth/local-first-llm",
    "canonicalUrl": "https://clawhub.ai/joelnishanth/local-first-llm",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/local-first-llm",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=local-first-llm",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "references/local-providers.md",
      "references/routing-logic.md",
      "references/token-estimation.md",
      "scripts/check_local.py",
      "scripts/dashboard.py"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "local-first-llm",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-05T03:24:29.952Z",
      "expiresAt": "2026-05-12T03:24:29.952Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=local-first-llm",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=local-first-llm",
        "contentDisposition": "attachment; filename=\"local-first-llm-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "local-first-llm"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/local-first-llm"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/local-first-llm",
    "downloadUrl": "https://openagent3.xyz/downloads/local-first-llm",
    "agentUrl": "https://openagent3.xyz/skills/local-first-llm/agent",
    "manifestUrl": "https://openagent3.xyz/skills/local-first-llm/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/local-first-llm/agent.md"
  }
}
```
## Documentation

### Local-First LLM

Route requests to a local LLM first; fall back to cloud only when necessary. Track every decision to show real token and cost savings.

### 1. Check if a local LLM is running

python3 skills/local-first-llm/scripts/check_local.py

Returns JSON: { "any_available": true, "best": { "provider": "ollama", "models": [...] } }

### 2. Route a request

python3 skills/local-first-llm/scripts/route_request.py \\
  --prompt "Summarize this meeting transcript" \\
  --tokens 800 \\
  --local-available \\
  --local-provider ollama

Returns: { "decision": "local", "reason": "...", "complexity_score": -1 }

### 3. Log the outcome

After executing the request, record it:

python3 skills/local-first-llm/scripts/track_savings.py log \\
  --tokens 800 \\
  --model gpt-4o \\
  --routed-to local

### 4. Show the dashboard

python3 skills/local-first-llm/scripts/dashboard.py

### Full Routing Workflow

┌─────────────────────────────────────────────────────┐
│  1. check_local.py  →  is a local provider running? │
│                                                      │
│  2. route_request.py  →  local or cloud?             │
│     - sensitivity check  (private data → local)      │
│     - complexity score   (high score → cloud)        │
│     - availability gate  (no local → cloud)          │
│                                                      │
│  3. Execute with the chosen provider                 │
│                                                      │
│  4. track_savings.py log  →  record the outcome      │
│                                                      │
│  5. dashboard.py  →  show cumulative savings         │
└─────────────────────────────────────────────────────┘

### Routing Rules (Summary)

ConditionRouteNo local provider available☁️ CloudPrompt contains sensitive data (password, secret, api key, ssn, etc.)🏠 LocalComplexity score ≥ 3☁️ CloudComplexity score < 3🏠 Local

For full scoring details, see references/routing-logic.md.

### Executing with a Local Provider

Once route_request.py returns "decision": "local", send the request:

### Ollama

curl http://localhost:11434/api/generate \\
  -d '{"model": "llama3.2", "prompt": "YOUR_PROMPT", "stream": false}'

### LM Studio / llamafile (OpenAI-compatible)

curl http://localhost:1234/v1/chat/completions \\
  -H "Content-Type: application/json" \\
  -d '{"model": "local-model", "messages": [{"role": "user", "content": "YOUR_PROMPT"}]}'

### Dashboard

The dashboard reads from ~/.openclaw/local-first-llm/savings.json (auto-created).

┌─────────────────────────────────────────┐
│    🧠  Local-First LLM — Dashboard      │
├─────────────────────────────────────────┤
│  Local LLM:  ✅  ollama (llama3.2...)   │
├─────────────────────────────────────────┤
│  Total requests:         42             │
│  Routed locally:         31  (73.8%)    │
│  Routed to cloud:        11             │
├─────────────────────────────────────────┤
│  Tokens saved:       84,200             │
│  Cost saved:           $0.4210          │
└─────────────────────────────────────────┘

Reset savings data:

python3 skills/local-first-llm/scripts/track_savings.py reset

### Additional References

Routing scoring details: references/routing-logic.md
Local provider setup (Ollama, LM Studio, llamafile): references/local-providers.md
Token estimation & cloud cost table: references/token-estimation.md
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: joelnishanth
- Version: 1.0.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-05T03:24:29.952Z
- Expires at: 2026-05-12T03:24:29.952Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/local-first-llm)
- [Send to Agent page](https://openagent3.xyz/skills/local-first-llm/agent)
- [JSON manifest](https://openagent3.xyz/skills/local-first-llm/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/local-first-llm/agent.md)
- [Download page](https://openagent3.xyz/downloads/local-first-llm)