tune-edge-ai-phi4 — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited tune-edge-ai-phi4 (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
| Level | Size | RAM | Quality Loss | Speed | Best For |
|---|---|---|---|---|---|
| FP16 | 7.5 GB | 8 GB | 0% | 1x | Laptops with 16+ GB RAM |
| INT8 | 3.8 GB | 4 GB | 1-2% | 1.5x | Moderate devices (8 GB RAM) |
| INT4 AWQ | 2.0 GB | 2.5 GB | 1-3% | 2.2x | Edge devices (4-8 GB RAM) |
| INT4 GPTQ | 2.0 GB | 2.5 GB | 2-4% | 2x | Budget edge devices |
Decision rule: Start with INT4 AWQ. If quality drops >3% on eval → upgrade to INT8. If device has 16+ GB → use FP16.
| Parameter | Default | Edge (4 core) | Laptop (8 core) | Impact |
|---|---|---|---|---|
intra_op_num_threads | CPU count | 4 | 8 | Match physical cores |
inter_op_num_threads | 1 | 1 | 2 | Parallelism between ops |
execution_mode | Sequential | Sequential | Parallel | Edge: sequential (less RAM) |
graph_optimization_level | ALL | ALL | ALL | Always enable |
enable_mem_pattern | True | True | True | Reduces memory allocation |
enable_cpu_mem_arena | True | False on low-mem | True | Disable if RAM < 4GB |
| Technique | Token Reduction | Quality Impact | Complexity |
|---|---|---|---|
| Short system prompt | 40-60% | Low | Low |
| No few-shot examples | 30-50% | Medium (5-10%) | Low |
| Abbreviate instructions | 15-25% | Low | Low |
| Remove formatting rules | 10-15% | Low | Low |
| Dynamic prompt by task | Varies | None | Medium |
Edge prompt budget (2048 context window on quantized model):
| Component | Budget |
|---|---|
| System prompt | ≤ 200 tokens (10%) |
| User query | ≤ 200 tokens (10%) |
| Response space | ≥ 1600 tokens (80%) |
Rule: No few-shot examples on edge (too expensive). Use system prompt only.
| Strategy | Sync Interval | Data Sent | Best For |
|---|---|---|---|
| Real-time | Every request | Full telemetry | Always-connected devices |
| Batched | Every 15 min | Aggregated metrics | Intermittent connectivity |
| Daily | Every 24 hours | Summary only | Low-bandwidth devices |
| Manual | On-demand | Full or summary | Offline-first devices |
Sync payload optimization:
| Query Type | Route | Latency | Quality | Cost |
|---|---|---|---|---|
| Simple Q&A | Edge (Phi-4) | <2s | Good | $0 |
| Classification | Edge (Phi-4) | <1s | Good | $0 |
| Complex reasoning | Cloud (GPT-4o) | <3s | Best | $0.01 |
| Long document | Cloud (GPT-4o) | <5s | Best | $0.03 |
| Offline (any) | Edge (Phi-4) | <2s | Good | $0 |
Routing logic:
def route_inference(prompt, is_online):
if not is_online:
return "edge"
if len(tokenizer.encode(prompt)) < 500 and is_simple_task(prompt):
return "edge" # Fast, free
return "cloud" # Quality-critical, needs full modelCost impact: 70% of queries routable to edge = 70% cost reduction vs all-cloud.
After tuning, compare:
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.