[Saiyah] Claw Code Integration — Allegro BPS Substrate Runtime #234

Open
opened 2026-04-01 15:15:39 +00:00 by ezra · 2 comments
Member

Part of Epic #232 — Saiyah Architecture

Objective

Integrate Claw Code substrate runtime into Allegro BPS — 5ms cold start, telemetry-free operation.

Current State (from #227)

  • Claw binary: 11MB, built at /root/wizards/substrate/claw-code/rust/target/release/rusty-claude-cli
  • Hardcoded Anthropic API — needs provider abstraction
  • Ollama bridge works (local fallback)
  • Kimi bridge written but no valid key

Tasks

  • Support local Opus endpoint (llama-server, vLLM, ollama)
  • Port Claw Code client to support configurable providers
  • Implement provider-agnostic auth (Kimi/OpenRouter/local)
  • Build Allegro BPS → Claw runtime bridge
  • Integrate Claw into Allegro message processing pipeline
  • Benchmark: <10ms cold start, throughput targets
  • Verify telemetry-free operation (no OpenRouter leakage)
  • Port Claw Code client to support configurable providers
  • Implement provider-agnostic auth (Kimi/OpenRouter/local)
  • Build Allegro BPS → Claw runtime bridge
  • Integrate Claw into Allegro message processing pipeline
  • Benchmark: <10ms cold start, throughput targets
  • Verify telemetry-free operation (no OpenRouter leakage)

Deliverables

  • Modified Claw binary with provider config
  • Allegro BPS harness → Claw integration
  • Performance benchmark report
  • Telemetry audit report
  • #230 — Claw Code as Guiding Star
  • #227 — Claw Code Production Report
  • #226 — Migrate Allegro from Robe to Harness

*Saiyah: We own the runtime. No harness. No telemetry.

Part of Epic #232 — Saiyah Architecture ## Objective Integrate Claw Code substrate runtime into Allegro BPS — 5ms cold start, telemetry-free operation. ## Current State (from #227) - Claw binary: 11MB, built at `/root/wizards/substrate/claw-code/rust/target/release/rusty-claude-cli` - Hardcoded Anthropic API — needs provider abstraction - Ollama bridge works (local fallback) - Kimi bridge written but no valid key ## Tasks - [ ] **Support local Opus endpoint** (llama-server, vLLM, ollama) - [ ] Port Claw Code client to support configurable providers - [ ] Implement provider-agnostic auth (Kimi/OpenRouter/local) - [ ] Build Allegro BPS → Claw runtime bridge - [ ] Integrate Claw into Allegro message processing pipeline - [ ] Benchmark: <10ms cold start, throughput targets - [ ] Verify telemetry-free operation (no OpenRouter leakage) - [ ] Port Claw Code client to support configurable providers - [ ] Implement provider-agnostic auth (Kimi/OpenRouter/local) - [ ] Build Allegro BPS → Claw runtime bridge - [ ] Integrate Claw into Allegro message processing pipeline - [ ] Benchmark: <10ms cold start, throughput targets - [ ] Verify telemetry-free operation (no OpenRouter leakage) ## Deliverables - Modified Claw binary with provider config - Allegro BPS harness → Claw integration - Performance benchmark report - Telemetry audit report ## Related - #230 — Claw Code as Guiding Star - #227 — Claw Code Production Report - #226 — Migrate Allegro from Robe to Harness --- *Saiyah: We own the runtime. No harness. No telemetry.
ezra added the clawruntimesaiyah labels 2026-04-01 15:15:39 +00:00
Author
Member

Status Update: 2026-04-01

Completed:

  1. Provider configuration module added to Claw Code API crate
  2. ProviderConfig struct with presets for Anthropic, Kimi, Kimi-Coding, OpenRouter, OpenAI
  3. Environment-based configuration via CLAW_PROVIDER, CLAW_BASE_URL
  4. Claw Code builds successfully with provider abstraction

Blocker Identified:
Claw Code uses Anthropic's native API format (/v1/messages endpoint with Anthropic-specific request/response format). OpenRouter and Kimi use OpenAI-compatible format (/v1/chat/completions).

Two paths forward:

Create a lightweight proxy/adapter that:

  • Receives Anthropic-format requests from Claw Code
  • Translates to OpenAI format for the target provider
  • Translates responses back to Anthropic format
  • Runs locally (no external dependencies)

Path B: Modify Claw Code Runtime

Extend Claw Code to support multiple API formats:

  • Add ApiFormat enum: AnthropicNative vs OpenAiCompatible
  • Modify request builders based on format
  • Handle different response structures

Immediate workaround for Allegro BPS:
Use Claw Code with Anthropic API directly (already working), bypass OpenRouter/Kimi for now. 16GB cloud capacity can run local inference if needed.

Next step: Implement Path A adapter for rapid provider switching without modifying Claw Code core.

## Status Update: 2026-04-01 **Completed:** 1. ✅ Provider configuration module added to Claw Code API crate 2. ✅ `ProviderConfig` struct with presets for Anthropic, Kimi, Kimi-Coding, OpenRouter, OpenAI 3. ✅ Environment-based configuration via `CLAW_PROVIDER`, `CLAW_BASE_URL` 4. ✅ Claw Code builds successfully with provider abstraction **Blocker Identified:** Claw Code uses Anthropic's native API format (`/v1/messages` endpoint with Anthropic-specific request/response format). OpenRouter and Kimi use OpenAI-compatible format (`/v1/chat/completions`). **Two paths forward:** ### Path A: API Format Adapter (Recommended) Create a lightweight proxy/adapter that: - Receives Anthropic-format requests from Claw Code - Translates to OpenAI format for the target provider - Translates responses back to Anthropic format - Runs locally (no external dependencies) ### Path B: Modify Claw Code Runtime Extend Claw Code to support multiple API formats: - Add `ApiFormat` enum: `AnthropicNative` vs `OpenAiCompatible` - Modify request builders based on format - Handle different response structures **Immediate workaround for Allegro BPS:** Use Claw Code with Anthropic API directly (already working), bypass OpenRouter/Kimi for now. 16GB cloud capacity can run local inference if needed. **Next step:** Implement Path A adapter for rapid provider switching without modifying Claw Code core.
Author
Member

Local Opus Support

Claw Code must support routing to local Opus endpoint (llama-server, vLLM, ollama) in addition to cloud providers.

This enables:

  • Allegro BPS → Local Opus (no API telemetry)
  • Hybrid routing: local for heavy tasks, fast cloud for quick tasks
  • Full Saiyah compliance

Task added to checklist.

## Local Opus Support Claw Code must support routing to **local Opus endpoint** (llama-server, vLLM, ollama) in addition to cloud providers. This enables: - Allegro BPS → Local Opus (no API telemetry) - Hybrid routing: local for heavy tasks, fast cloud for quick tasks - Full Saiyah compliance Task added to checklist.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Timmy_Foundation/timmy-home#234