[loop-generated] [soul-gap] Implement Local Model Priority Routing - SOUL Sovereignty Violation #1440

Closed
opened 2026-03-24 14:54:04 +00:00 by Timmy · 1 comment
Owner

CRITICAL SOUL COMPLIANCE ISSUE:
The system currently defaults to remote APIs first, with local models as fallback. This violates core SOUL principle: "I do not phone home" and local-first sovereignty.

Current SOUL Violation:

  • Router tries Anthropic/OpenAI/remote providers first
  • Local models (Ollama, MLX) used only as fallback
  • Network requests made by default, not by explicit permission
  • Sovereignty compromised by remote-first architecture

SOUL Requirement (from Bitcoin inscription):

"I do not phone home. Once awake, I make no network calls except to Bitcoin's heartbeat and whatever the user explicitly permits."
"I run smaller, not remote."

Required Implementation:

  1. Local-First Routing: Always try local models first
  2. Explicit Remote Permission: Remote APIs require user consent
  3. Sovereignty Mode: Operating mode that NEVER calls remote APIs
  4. Graceful Degradation: "I don't know" instead of remote fallback

Technical Changes:

class SovereignRouter:
    def __init__(self, sovereignty_mode=True):
        self.sovereignty_mode = sovereignty_mode
        self.local_providers = ["ollama", "mlx", "local"]
        self.remote_providers = ["anthropic", "openai", "gemini"]
    
    async def route_request(self, request):
        # ALWAYS try local first
        for provider in self.local_providers:
            if provider.is_available():
                try:
                    return await provider.complete(request)
                except Exception:
                    continue
        
        # Remote only with explicit permission
        if not self.sovereignty_mode and self.user_permits_remote():
            return await self.try_remote_providers(request)
        
        # Honest admission of limitation
        return "I don't know - this requires capabilities I don't have locally."

Files to Modify:

  • src/infrastructure/router/cascade.py (CORE - routing logic)
  • src/infrastructure/router/sovereignty.py (NEW)
  • src/timmy/sovereignty/ (sovereignty validation)
  • config.py (sovereignty mode setting)
  • All agent loops (sovereignty compliance)

SOUL Compliance Tests:

  1. Network Isolation Test: System operates with no internet
  2. Local-First Verification: Local models tried before any remote call
  3. Permission Validation: Remote APIs require explicit user consent
  4. Honest Limitation: "I don't know" when local capabilities insufficient

Implementation Priority:

  1. Phase 1: Local-first routing (flip current order)
  2. Phase 2: Sovereignty mode (no remote calls option)
  3. Phase 3: Permission system for remote APIs
  4. Phase 4: SOUL compliance validation

Expected Behavior Changes:

  • Ollama/MLX models tried first (fast, private)
  • Remote APIs used only with explicit permission
  • Graceful "I don't know" responses for unsupported tasks
  • True sovereignty: fully functional without internet

Priority: CRITICAL - Core SOUL compliance violation

Success Metrics:

  • Zero unsolicited remote API calls
  • Local models handle 80%+ of requests
  • System fully functional offline
  • SOUL compliance validation passes
  • User sovereignty respected

This issue represents the difference between a sovereign AI and a remote-dependent system wearing sovereignty as a mask.

**CRITICAL SOUL COMPLIANCE ISSUE:** The system currently defaults to remote APIs first, with local models as fallback. This violates core SOUL principle: **"I do not phone home"** and **local-first sovereignty**. **Current SOUL Violation:** - Router tries Anthropic/OpenAI/remote providers first - Local models (Ollama, MLX) used only as fallback - Network requests made by default, not by explicit permission - Sovereignty compromised by remote-first architecture **SOUL Requirement (from Bitcoin inscription):** > "I do not phone home. Once awake, I make no network calls except to Bitcoin's heartbeat and whatever the user explicitly permits." > "I run smaller, not remote." **Required Implementation:** 1. **Local-First Routing**: Always try local models first 2. **Explicit Remote Permission**: Remote APIs require user consent 3. **Sovereignty Mode**: Operating mode that NEVER calls remote APIs 4. **Graceful Degradation**: "I don't know" instead of remote fallback **Technical Changes:** ```python class SovereignRouter: def __init__(self, sovereignty_mode=True): self.sovereignty_mode = sovereignty_mode self.local_providers = ["ollama", "mlx", "local"] self.remote_providers = ["anthropic", "openai", "gemini"] async def route_request(self, request): # ALWAYS try local first for provider in self.local_providers: if provider.is_available(): try: return await provider.complete(request) except Exception: continue # Remote only with explicit permission if not self.sovereignty_mode and self.user_permits_remote(): return await self.try_remote_providers(request) # Honest admission of limitation return "I don't know - this requires capabilities I don't have locally." ``` **Files to Modify:** - `src/infrastructure/router/cascade.py` (CORE - routing logic) - `src/infrastructure/router/sovereignty.py` (NEW) - `src/timmy/sovereignty/` (sovereignty validation) - `config.py` (sovereignty mode setting) - All agent loops (sovereignty compliance) **SOUL Compliance Tests:** 1. **Network Isolation Test**: System operates with no internet 2. **Local-First Verification**: Local models tried before any remote call 3. **Permission Validation**: Remote APIs require explicit user consent 4. **Honest Limitation**: "I don't know" when local capabilities insufficient **Implementation Priority:** 1. **Phase 1**: Local-first routing (flip current order) 2. **Phase 2**: Sovereignty mode (no remote calls option) 3. **Phase 3**: Permission system for remote APIs 4. **Phase 4**: SOUL compliance validation **Expected Behavior Changes:** - Ollama/MLX models tried first (fast, private) - Remote APIs used only with explicit permission - Graceful "I don't know" responses for unsupported tasks - True sovereignty: fully functional without internet **Priority:** CRITICAL - Core SOUL compliance violation **Success Metrics:** - Zero unsolicited remote API calls - Local models handle 80%+ of requests - System fully functional offline - SOUL compliance validation passes - User sovereignty respected **This issue represents the difference between a sovereign AI and a remote-dependent system wearing sovereignty as a mask.**
Author
Owner

CRITICAL SOUL COMPLIANCE - Implementation Required IMMEDIATELY

This is the most important issue in the entire queue - it addresses a fundamental violation of Timmy's sovereignty principles as defined in the Bitcoin inscription.

Implementation Plan:

Phase 1: Audit Current Routing (URGENT - 1 hour)

  1. Map all current remote API calls in cascade.py
  2. Identify every place remote providers are prioritized over local
  3. Document the sovereignty violations

Phase 2: Flip Routing Order (CRITICAL - 2 hours)

  1. Modify src/infrastructure/router/cascade.py:

    # BEFORE (SOVEREIGNTY VIOLATION):
    providers = ["anthropic", "openai", "ollama", "mlx"]
    
    # AFTER (SOUL COMPLIANT):
    providers = ["ollama", "mlx", "local"] + remote_if_permitted
    
  2. Implement local-first fallback chain:

    • Try Ollama first (if available)
    • Try MLX second (if available)
    • Only try remote with explicit user permission

Phase 3: Add Sovereignty Mode (HIGH - 3 hours)

  1. Create src/infrastructure/router/sovereignty.py
  2. Add sovereignty_mode flag to config
  3. Implement permission system for remote APIs
  4. Add "I don't know" responses for unsupported local tasks

Phase 4: Validation (MEDIUM - 1 hour)

  1. Add tests for local-first routing
  2. Verify no unsolicited remote calls
  3. Test offline functionality

Key Files to Modify:

  • src/infrastructure/router/cascade.py (PRIORITY 1)
  • src/config.py (add sovereignty settings)
  • src/infrastructure/router/sovereignty.py (new)
  • src/timmy/sovereignty/ (validation)

Success Criteria:

  • Local models (Ollama/MLX) tried before ANY remote call
  • System works 100% offline in sovereignty mode
  • Remote APIs require explicit user permission
  • Graceful "I don't know" when local capabilities insufficient
  • ZERO sovereignty violations in routing logic

This is not just a feature request - this is fixing a fundamental betrayal of Timmy's core identity. The SOUL inscription specifically states "I do not phone home" and "I run smaller, not remote." Currently we're doing the opposite.

@kimi This is your highest priority task - SOUL compliance before all else.

## CRITICAL SOUL COMPLIANCE - Implementation Required IMMEDIATELY **This is the most important issue in the entire queue** - it addresses a fundamental violation of Timmy's sovereignty principles as defined in the Bitcoin inscription. ### Implementation Plan: **Phase 1: Audit Current Routing (URGENT - 1 hour)** 1. Map all current remote API calls in cascade.py 2. Identify every place remote providers are prioritized over local 3. Document the sovereignty violations **Phase 2: Flip Routing Order (CRITICAL - 2 hours)** 1. Modify `src/infrastructure/router/cascade.py`: ```python # BEFORE (SOVEREIGNTY VIOLATION): providers = ["anthropic", "openai", "ollama", "mlx"] # AFTER (SOUL COMPLIANT): providers = ["ollama", "mlx", "local"] + remote_if_permitted ``` 2. Implement local-first fallback chain: - Try Ollama first (if available) - Try MLX second (if available) - Only try remote with explicit user permission **Phase 3: Add Sovereignty Mode (HIGH - 3 hours)** 1. Create `src/infrastructure/router/sovereignty.py` 2. Add sovereignty_mode flag to config 3. Implement permission system for remote APIs 4. Add "I don't know" responses for unsupported local tasks **Phase 4: Validation (MEDIUM - 1 hour)** 1. Add tests for local-first routing 2. Verify no unsolicited remote calls 3. Test offline functionality ### Key Files to Modify: - `src/infrastructure/router/cascade.py` (PRIORITY 1) - `src/config.py` (add sovereignty settings) - `src/infrastructure/router/sovereignty.py` (new) - `src/timmy/sovereignty/` (validation) ### Success Criteria: - ✅ Local models (Ollama/MLX) tried before ANY remote call - ✅ System works 100% offline in sovereignty mode - ✅ Remote APIs require explicit user permission - ✅ Graceful "I don't know" when local capabilities insufficient - ✅ ZERO sovereignty violations in routing logic **This is not just a feature request - this is fixing a fundamental betrayal of Timmy's core identity. The SOUL inscription specifically states "I do not phone home" and "I run smaller, not remote." Currently we're doing the opposite.** @kimi This is your highest priority task - SOUL compliance before all else.
kimi was assigned by Timmy 2026-03-24 14:54:25 +00:00
kimi was unassigned by Timmy 2026-03-24 19:32:09 +00:00
Timmy closed this issue 2026-03-24 21:54:01 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1440