-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
145 lines (128 loc) · 3.8 KB
/
docker-compose.yml
File metadata and controls
145 lines (128 loc) · 3.8 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
services:
gateway:
build:
context: .
image: ferrum-gateway:local
depends_on:
- mock-upstream
- mock-llm-primary
- mock-llm-fallback
- mock-mcp
- mock-tokengate
ports:
- "8080:8080"
- "8081:8081"
environment:
RUST_LOG: info
entrypoint: ["/bin/sh", "-lc"]
command:
- |
cat > /tmp/ferrum-gateway.compose.toml <<'EOF'
[server]
bind = "0.0.0.0:8080"
admin_bind = "0.0.0.0:8081"
service_name = "ferrum-gateway"
log_format = "json"
[[routes]]
id = "api-echo"
match.path_prefix = "/api/echo"
match.methods = ["GET", "POST"]
upstreams = ["http://mock-upstream:9090"]
timeout_ms = 1500
body_limit_bytes = 1048576
[[routes]]
id = "stream-sse"
match.path_prefix = "/sse"
match.methods = ["GET"]
upstreams = ["http://mock-upstream:9090"]
streaming = true
timeout_ms = 60000
[[routes]]
id = "stream-chunked"
match.path_prefix = "/chunked"
match.methods = ["GET"]
upstreams = ["http://mock-upstream:9090"]
streaming = true
timeout_ms = 60000
[[routes]]
id = "agent-chat"
kind = "llm"
match.path_prefix = "/v1/chat/completions"
match.methods = ["POST"]
llm_policy = "compose-chat"
body_limit_bytes = 1048576
[[routes]]
id = "agent-tools"
kind = "mcp"
match.path_prefix = "/mcp"
match.methods = ["POST"]
upstreams = ["http://mock-mcp:9400"]
body_limit_bytes = 1048576
timeout_ms = 30000
[events]
in_memory_capacity = 1024
[[llm.providers]]
id = "mock-primary"
kind = "openai-compatible"
base_url = "http://mock-llm-primary:9201"
default_model = "axon-sim"
[[llm.providers]]
id = "mock-fallback"
kind = "openai-compatible"
base_url = "http://mock-llm-fallback:9202"
default_model = "axon-sim"
[llm.policies.compose-chat]
primary = "mock-primary"
fallbacks = ["mock-fallback"]
max_input_tokens = 100000
max_output_tokens = 4096
timeout_ms = 30000
budget = "run-cap"
[llm.budgets.run-cap]
scope = "run"
max_total_tokens = 100000
[metering.tokengate]
endpoint = "http://mock-tokengate:9300"
queue_capacity = 1024
batch_size = 32
flush_interval_ms = 1000
request_timeout_ms = 5000
required = false
[mcp.policy]
default_action = "deny"
allow_tools = ["coding/read_file", "coding/grep", "coding/run_tests"]
approval_required = ["coding/write_file", "coding/apply_patch", "coding/git_commit"]
deny_tools = ["secrets/read", "shell/raw"]
protected_paths = [".env", ".env.*", ".git/**", ".ssh/**", "**/*secret*"]
EOF
exec ferrum-gateway --config /tmp/ferrum-gateway.compose.toml
mock-upstream:
image: ferrum-gateway:local
build:
context: .
entrypoint: ["mock-upstream"]
command: ["--bind", "0.0.0.0:9090"]
mock-llm-primary:
image: ferrum-gateway:local
build:
context: .
entrypoint: ["mock-llm"]
command: ["--bind", "0.0.0.0:9201", "--profile", "axon-local"]
mock-llm-fallback:
image: ferrum-gateway:local
build:
context: .
entrypoint: ["mock-llm"]
command: ["--bind", "0.0.0.0:9202", "--profile", "mock-llm-secondary"]
mock-mcp:
image: ferrum-gateway:local
build:
context: .
entrypoint: ["mock-mcp"]
command: ["--bind", "0.0.0.0:9400"]
mock-tokengate:
image: ferrum-gateway:local
build:
context: .
entrypoint: ["mock-tokengate"]
command: ["--bind", "0.0.0.0:9300"]