-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.example.lua
More file actions
279 lines (251 loc) · 10.9 KB
/
Copy pathconfig.example.lua
File metadata and controls
279 lines (251 loc) · 10.9 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
-- config.example.lua
-- Example configuration for unhardcoded-engine. Copy to `config.lua` and edit.
-- See docs/POLICY_DESIGN.md §4 (the candidate object) for the schema.
return {
-- ============================================================
-- Providers
-- ============================================================
providers = {
comput3 = {
discovery = "static",
base_url = "https://api.comput3.ai/v1",
api_kind = "openai_compatible",
auth_env = "COMPUT3_API_KEY",
tier = "partner",
notes = "GenLayer partner — Hermes, DeepSeek, Qwen on H200",
},
io_net = {
discovery = "static",
base_url = "https://api.intelligence.io.solutions/api/v1",
api_kind = "openai_compatible",
auth_env = "IONET_API_KEY",
tier = "partner",
},
heurist = {
discovery = "static",
base_url = "https://llm-gateway.heurist.xyz",
api_kind = "openai_compatible",
auth_env = "HEURIST_API_KEY",
tier = "partner",
notes = "Free credits via referral code 'genlayer'",
},
morpheus = {
discovery = "static",
base_url = "https://api.mor.org/api/v1",
api_kind = "openai_compatible",
auth_env = "MORPHEUS_API_KEY",
tier = "partner",
},
chutes = {
discovery = "static",
base_url = "https://llm.chutes.ai/v1",
api_kind = "openai_compatible",
auth_env = "CHUTES_API_KEY",
tier = "partner",
},
atoma = {
discovery = "static",
base_url = "https://api.atoma.network/v1",
api_kind = "openai_compatible",
auth_env = "ATOMA_API_KEY",
tier = "partner",
has_tee = true,
no_log = true,
},
antseed = {
discovery = "marketplace",
discovery_id = "antseed_buyer_node",
api_kind = "openai_compatible",
auth_env = "ANTSEED_API_KEY", -- may be unset for permissionless mode
tier = "marketplace",
notes = "Dynamic pricing via buyer node (antseed.com)",
},
-- non-partner fallbacks; commented out by default
-- openrouter = {
-- discovery = "static",
-- base_url = "https://openrouter.ai/api/v1",
-- api_kind = "openai_compatible",
-- auth_env = "OPENROUTER_API_KEY",
-- tier = "fallback",
-- },
-- groq = {
-- discovery = "static",
-- base_url = "https://api.groq.com/openai/v1",
-- api_kind = "openai_compatible",
-- auth_env = "GROQ_API_KEY",
-- tier = "fallback",
-- notes = "Fast, low rate limits",
-- },
},
-- ============================================================
-- Models
-- ============================================================
models = {
["hermes-3-405b"] = {
family = "hermes-3-405b",
served_by = {
{ provider = "comput3", provider_model_id = "Hermes-3-Llama-3.1-405B" },
},
capabilities = {
context = 128000,
supports_tools = true,
supports_json_mode = true,
supports_seed = true,
},
static_quality_hint = 0.78,
},
["deepseek-v3"] = {
family = "deepseek-v3",
served_by = {
{ provider = "comput3", provider_model_id = "deepseek-chat" },
{ provider = "morpheus", provider_model_id = "deepseek-chat" },
{ provider = "chutes", provider_model_id = "deepseek-ai/DeepSeek-V3" },
{ provider = "atoma", provider_model_id = "deepseek-chat" },
},
capabilities = {
context = 64000,
supports_tools = true,
supports_json_mode = true,
supports_seed = true,
},
static_quality_hint = 0.82,
},
["qwen-3-235b"] = {
family = "qwen-3-235b",
served_by = {
{ provider = "comput3" },
{ provider = "io_net" },
},
capabilities = {
context = 128000,
supports_tools = true,
},
static_quality_hint = 0.76,
},
["qwen-2.5-vl-72b"] = {
family = "qwen-2.5-vl-72b",
served_by = {
{ provider = "io_net" },
},
capabilities = {
context = 32000,
supports_vision = true,
},
static_quality_hint = 0.70,
},
["llama-3.3-70b"] = {
family = "llama-3.3-70b",
served_by = {
{ provider = "io_net" },
{ provider = "morpheus" },
},
capabilities = {
context = 128000,
supports_tools = true,
supports_json_mode = true,
supports_seed = true,
},
static_quality_hint = 0.72,
},
},
-- ============================================================
-- Profiles
-- ============================================================
-- These are TEMPLATES. Edit the scorer and constraints to taste; the library
-- ships no built-in defaults. Two operators starting from the same template
-- are encouraged to diverge — diversity is a feature (see docs/GENVM-LLM-POLICY.md).
--
-- (sigma-pol/v2) The composite scorer atoms (quality/speed/cost/partner/
-- free_credit) were removed: a profile now carries an explicit `scorer` —
-- a raw Σ_pol Scorer term over the RAW fields (field/normalize/neg/scale/
-- add). `neg(normalize(field("price_in")))` means "cheaper scores higher".
-- Tier preference is a filter concern now (min_tier), not a scorer atom.
profiles = {
default = {
scorer = { "add",
{ "scale", 0.40, { "field", "context" } },
{ "scale", 0.25, { "neg", { "normalize", { "field", "latency_ms" } } } },
{ "scale", 0.35, { "neg", { "normalize", { "field", "price_in" } } } },
},
retry_policy = "balanced",
},
cheap_explore = {
extends = "default",
scorer = { "add",
{ "scale", 0.15, { "field", "context" } },
{ "scale", 0.15, { "neg", { "normalize", { "field", "latency_ms" } } } },
{ "scale", 0.55, { "neg", { "normalize", { "field", "price_in" } } } },
{ "scale", 0.15, { "normalize", { "field", "credits" } } },
},
},
tee_only = {
extends = "default",
hard_constraints = { privacy = "tee_required" },
scorer = { "add",
{ "scale", 0.50, { "field", "context" } },
{ "scale", 0.20, { "neg", { "normalize", { "field", "latency_ms" } } } },
{ "scale", 0.30, { "neg", { "normalize", { "field", "price_in" } } } },
},
},
agent_tool_use = {
extends = "default",
-- Note: `needs` here is a hard constraint that the profile adds on top of
-- what the contract declares. Future work: per-profile capability filters
-- (the current schema folds these into the contract instead).
scorer = { "add",
{ "scale", 0.50, { "field", "context" } },
{ "scale", 0.20, { "neg", { "normalize", { "field", "latency_ms" } } } },
{ "scale", 0.30, { "neg", { "normalize", { "field", "price_in" } } } },
},
},
},
-- ============================================================
-- Retry policies (named tables, referenced from profiles)
-- ============================================================
retry_policies = {
balanced = {
-- success needs no entry: the engine returns on response.ok; only
-- error kinds are classified, over the closed sequence.ACTIONS set.
rate_limit = { action = "next_candidate", open_breaker_ms = 30000 },
timeout = { action = "next_candidate" },
server_error = { action = "retry_same", attempts = 1, backoff_ms = 500, then_action = "next_candidate" },
auth_error = { action = "disable_provider" },
bad_request = { action = "abort" },
content_filter = { action = "next_candidate" },
model_unavailable = { action = "next_provider_same_model", mark_unavailable_ms = 300000 },
context_overflow = { action = "abort" },
network_error = { action = "retry_same", attempts = 2, backoff_ms = { 200, 600 }, then_action = "next_candidate" },
payment_required = { action = "next_candidate", open_breaker_ms = 300000 },
unknown = { action = "next_candidate" },
},
},
-- ============================================================
-- Σ_pol IR knobs (optional; see docs/SIGMA-POL.md)
-- ============================================================
-- Observation-vocabulary extensions: extra candidate fields that IR
-- policies may observe via cmp/is/field. Sort Num|Bool; the default is
-- mandatory (determinism when the field is absent). Reads cand[name]
-- unless a getter is provided.
-- fields = {
-- region_score = { sort = "Num", default = 0 },
-- },
-- Host envelope: a Pred term ∧-ed onto every per-call `policy_ir`, so
-- callers can narrow these invariants but never widen them.
-- policy_envelope = { "and", { "min_tier", "marketplace" },
-- { "cmp", "price_out", "le", 50 } },
-- Host-blessed named Xforms, referenced from terms as { "custom", "name" }.
-- customs = { my_xform = function(req, cand, ctx) ... return req end },
-- A profile may also pin a full IR policy directly:
-- profiles.pinned = { policy_ir = { "policy", ... } }
-- ============================================================
-- Defaults overrides (optional)
-- ============================================================
defaults = {
-- circuit_breaker_threshold = 3,
-- circuit_breaker_rate_limit_ms = 30000,
-- circuit_breaker_failure_ms = 300000,
-- discovery_cache_ttl_ms = 60000,
-- ema_alpha = 0.2,
-- free_credit_threshold_usd = 1.0,
},
}