-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodelweaver.example.yaml
More file actions
102 lines (95 loc) · 3.72 KB
/
Copy pathmodelweaver.example.yaml
File metadata and controls
102 lines (95 loc) · 3.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# ModelWeaver Configuration
# Run 'npx modelweaver init' to auto-configure this file AND
# ~/.claude/settings.json for seamless Claude Code integration.
# Hedging and timing configuration
hedging:
speculativeDelay: 1000 # ms before starting backup providers (lower = faster fallback)
cvThreshold: 0.5 # latency variance threshold for multi-copy hedging
maxHedge: 4 # max concurrent copies per request
# Smart routing: classify request complexity and route to appropriate tier
# Disabled by default. When enabled, analyzes the last user message to determine
# if a more capable (or simpler) model tier should handle the request.
# Requires routing entries named "tier1", "tier2" (and optionally "tier3").
# smartRouting:
# enabled: true
# escalationThreshold: 2 # minimum cumulative score to trigger tier override
# patterns:
# "1": # Tier 1 — best models for complex tasks
# - pattern: "architect|design system|from scratch"
# score: 3
# - pattern: "debug|troubleshoot|investigate|root cause"
# score: 2
# - pattern: "analyze.*reason|explain why|step.by.step"
# score: 2
# "2": # Tier 2 — good models for moderate tasks
# - pattern: "explain|summarize|compare"
# score: 2
# - pattern: "write.*test|refactor|review"
# score: 2
#
# When smartRouting is enabled, add these routing entries (coexist with named tiers):
# routing:
# tier1: # Smart routing tier 1 — routed for complex requests
# - provider: anthropic
# model: claude-opus-4-20250514
# tier2: # Smart routing tier 2 — routed for moderate requests
# - provider: anthropic
# model: claude-sonnet-4-20250514
# tier3: # Smart routing tier 3 — default / passthrough
# - provider: anthropic
# model: claude-haiku-4-5-20251001
server:
port: 3456
host: localhost
providers:
anthropic:
baseUrl: https://api.anthropic.com
apiKey: ${ANTHROPIC_API_KEY}
rateLimitBackoffMs: 1000 # delay (ms) before retrying after 429/503 when no Retry-After header
openrouter:
baseUrl: https://openrouter.ai/api
apiKey: ${OPENROUTER_API_KEY}
rateLimitBackoffMs: 1000 # delay (ms) before retrying after 429/503 when no Retry-After header
# Example: provider-specific transient error patterns
# some-provider:
# retryableErrorPatterns:
# - "network error"
# - "code:1234"
# - "please contact customer service"
# Exact model name routing (checked FIRST, before tier patterns)
modelRouting:
"glm-5-turbo":
- provider: anthropic
"MiniMax-M2.7":
- provider: openrouter
# Distribution example: spread traffic across providers by weight
# "claude-sonnet-4":
# - provider: anthropic
# weight: 70
# - provider: openrouter
# weight: 30
# Tier-based routing (fallback)
routing:
sonnet:
- provider: anthropic
model: claude-sonnet-4-20250514
# Context management — reduce tokens sent to provider:
# compressOldTurns: 10 # keep last 10 turns verbatim, skeleton older ones
# maxContextMessages: 60 # hard limit on total messages (runs after compression)
# toolResultLimit: 8000 # max chars per tool_result block
- provider: openrouter
model: anthropic/claude-sonnet-4
opus:
- provider: anthropic
model: claude-opus-4-20250514
- provider: openrouter
model: anthropic/claude-opus-4
haiku:
- provider: anthropic
model: claude-haiku-4-5-20251001
- provider: openrouter
model: anthropic/claude-haiku-4
tierPatterns:
sonnet: ["sonnet", "3-5-sonnet", "3.5-sonnet"]
opus: ["opus", "3-opus", "3.5-opus"]
haiku: ["haiku", "3-haiku", "3.5-haiku"]