-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathconfig.schema.json
More file actions
80 lines (80 loc) · 2.72 KB
/
Copy pathconfig.schema.json
File metadata and controls
80 lines (80 loc) · 2.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
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/tetratelabs/built-on-envoy/extensions/composer/llm-proxy/config.schema.json",
"title": "LLM Proxy Configuration",
"description": "Configuration for the LLM Proxy extension. Routes LLM API requests by model name and monitors token usage via Envoy metadata.",
"type": "object",
"additionalProperties": false,
"properties": {
"llm_configs": {
"type": "array",
"description": "Path-matcher rules mapping request paths to LLM API kinds. If empty, default rules for OpenAI and Anthropic are auto-configured.",
"items": {
"type": "object",
"required": ["matcher", "kind"],
"additionalProperties": false,
"properties": {
"matcher": {
"$ref": "#/$defs/StringMatcher",
"description": "Path matcher for this rule."
},
"kind": {
"type": "string",
"description": "LLM API kind for matched requests.",
"enum": ["openai", "anthropic", "custom"]
}
}
}
},
"metadata_namespace": {
"type": "string",
"description": "Filter metadata namespace for LLM proxy data. Defaults to \"io.builtonenvoy.llm-proxy\"."
},
"llm_model_header": {
"type": "string",
"description": "Request header to set with the extracted model name."
},
"use_default_attributes": {
"type": "boolean",
"description": "Emit the full built-in structured log payload."
},
"use_default_response_attributes": {
"type": "boolean",
"description": "Emit the lightweight built-in structured log payload."
},
"session_id_header": {
"type": "string",
"description": "Optional request header used to extract a session or conversation ID."
},
"clear_route_cache": {
"type": "boolean",
"description": "Clear Envoy route cache after setting metadata, enabling route re-selection. Defaults to false."
}
},
"$defs": {
"StringMatcher": {
"type": "object",
"description": "Matches a string by prefix, suffix, or regex. Exactly one must be set.",
"additionalProperties": false,
"properties": {
"prefix": {
"type": "string",
"description": "Match strings starting with this value."
},
"suffix": {
"type": "string",
"description": "Match strings ending with this value."
},
"regex": {
"type": "string",
"description": "Match strings satisfying this regular expression."
}
},
"oneOf": [
{ "required": ["prefix"] },
{ "required": ["suffix"] },
{ "required": ["regex"] }
]
}
}
}