Repository navigation
Expand file tree
/
Copy pathUPSTREAM.json
More file actions
213 lines (213 loc) · 12.3 KB
/
Copy pathUPSTREAM.json
File metadata and controls
213 lines (213 loc) · 12.3 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
{
"purpose": "Pinned provenance for the extracted Rust core and OAuth ports. The standalone router is an integration, not a complete line-for-line port of LiteLLM.",
"sources": {
"litellm": {
"repository": "https://github.com/BerriAI/litellm",
"revision": "98465fe2ba4fc26ab9e6ab366c7f90f8e4d9c685",
"license": "MIT"
}
},
"ports": [
{
"source": "litellm:litellm/llms/chatgpt/authenticator.py",
"functions": [
"Authenticator._refresh_tokens",
"_build_auth_record",
"_is_token_expired",
"_extract_account_id"
],
"target": [
"src/oauth/tokens.rs"
],
"retained": "Current access-token-only protocol: merchant-managed authorization and renewal; Router retains access authentication, official model discovery, native parameter-preserving forwarding and proxy-bound requests. Refresh/discovery-of-token-endpoint/form-refresh code was removed. Legacy upstream references document provenance only.",
"adaptations": "Current access-token-only protocol: merchant-managed authorization and renewal; Router retains access authentication, official model discovery, native parameter-preserving forwarding and proxy-bound requests. Refresh/discovery-of-token-endpoint/form-refresh code was removed. Legacy upstream references document provenance only."
},
{
"source": "litellm:litellm/llms/chatgpt/responses/transformation.py and litellm/llms/chatgpt/common_utils.py",
"functions": [
"_extract_completed_response_from_sse",
"_build_completed_response_from_chunk",
"get_complete_url"
],
"target": [
"src/oauth/chatgpt.rs",
"src/client.rs"
],
"retained": "Codex base URL, merchant account authentication, and response recovery from terminal item/text events.",
"adaptations": "Native Agent request fields are preserved. Removed instruction injection, forced stream/store/include, field allowlist, service-tier mapping, generated session IDs and Chat-to-Responses conversion. Inbound business headers and query are forwarded after credential and hop-by-hop isolation."
},
{
"source": "litellm:litellm/llms/xai/oauth.py",
"functions": [
"get_access_token",
"_discover",
"_validate_xai_endpoint",
"_build_auth_record",
"_refresh_tokens"
],
"target": [
"src/oauth/tokens.rs",
"src/client.rs"
],
"retained": "Current access-token-only protocol: merchant-managed authorization and renewal; Router retains access authentication, official model discovery, native parameter-preserving forwarding and proxy-bound requests. Refresh/discovery-of-token-endpoint/form-refresh code was removed. Legacy upstream references document provenance only.",
"adaptations": "Current access-token-only protocol: merchant-managed authorization and renewal; Router retains access authentication, official model discovery, native parameter-preserving forwarding and proxy-bound requests. Refresh/discovery-of-token-endpoint/form-refresh code was removed. Legacy upstream references document provenance only."
},
{
"source": "litellm:litellm-rust/crates/llms/src/anthropic/common_utils.rs",
"functions": [
"OauthToken::parse_key",
"with_oauth_companions",
"merge_beta_headers"
],
"target": [
"src/oauth/claude.rs",
"src/client.rs"
],
"retained": "Raw sk-ant-oat token or one exact Bearer prefix, Authorization instead of x-api-key, sorted deduplicated oauth-2025-04-20 beta and dangerous-direct-browser-access companion.",
"adaptations": "Current access-token-only protocol: merchant-managed authorization and renewal; Router retains access authentication, official model discovery, native parameter-preserving forwarding and proxy-bound requests. Refresh/discovery-of-token-endpoint/form-refresh code was removed. Legacy upstream references document provenance only."
},
{
"source": "litellm:litellm/completion_extras/litellm_responses_transformation/transformation.py",
"functions": [
"LiteLLMResponsesTransformationHandler._convert_chat_completion_messages_to_responses_input",
"_normalize_tool_choice_for_responses_api",
"_convert_response_output_to_choices"
],
"retained": "None; Chat-to-Responses conversion was removed. Native Responses is required for Codex OAuth accounts.",
"adaptations": "Historical provenance only; no request conversion path remains in the Router server.",
"removed_targets": [
"src/oauth/responses_bridge.rs",
"src/oauth/bridge.rs"
]
},
{
"source": "litellm:litellm-rust/crates/{framer,llms,core-utils}",
"target": [
"src/sse.rs",
"src/client.rs"
],
"details": "SSE framing and transport provenance retained. Former Claude request/response and chat stream transformations removed; all model traffic uses native forwarding.",
"adaptations": "No Chat-to-Claude conversion, field remapping, forced store/stream, or legacy conversion SDK entry points.",
"removed_targets": [
"src/anthropic.rs",
"src/stream.rs"
]
}
],
"validation": {
"upstream_test_references": [
"litellm:tests/unit/llms/chatgpt/test_chatgpt_authenticator.py",
"litellm:tests/unit/llms/xai/test_xai_oauth.py",
"litellm:litellm-rust/crates/llms/src/anthropic/common_utils.rs tests"
],
"rust_tests": [
"src/oauth/claude.rs",
"src/oauth/token_tests.rs",
"tests/router/oauth.rs",
"tests/router/discovery.rs",
"tests/router/operations.rs",
"tests/router/compatibility.rs",
"tests/router.rs",
"tests/native_client.rs",
"tests/router/faithful.rs"
],
"scope": "Current access-token-only protocol: merchant-managed authorization and renewal; Router retains access authentication, official model discovery, native parameter-preserving forwarding and proxy-bound requests. Refresh/discovery-of-token-endpoint/form-refresh code was removed. Legacy upstream references document provenance only."
},
"proxy_adaptation": {
"implementation": "New Rust network/storage integration; upstream OAuth algorithms retained.",
"behavior": "Current access-token-only protocol: merchant-managed authorization and renewal; Router retains access authentication, official model discovery, native parameter-preserving forwarding and proxy-bound requests. Refresh/discovery-of-token-endpoint/form-refresh code was removed. Legacy upstream references document provenance only."
},
"discovery_adaptation": {
"implementation": "New Rust catalog refresh, cache and dynamic routing integration, using upstream/provider wire formats; no hardcoded model IDs.",
"files": [
"src/discovery.rs",
"src/discovery/fetch.rs",
"tests/router/discovery.rs",
"src/discovery/capabilities.rs",
"src/discovery/capabilities_tests.rs",
"tests/router/catalog_policy.rs"
],
"references": {
"chatgpt": "https://github.com/openai/codex/blob/e45069d770c6d0b8984c58a6e7cbaf221ad37599/codex-rs/codex-api/src/endpoint/models.rs",
"codex_default_catalog_version": "https://github.com/openai/codex/releases/tag/rust-v0.162.0",
"claude": "litellm:litellm/llms/anthropic/common_utils.py (_list_models, _oauth_bearer_header); https://platform.claude.com/docs/en/api/models/list",
"grok": "https://docs.x.ai/developers/rest-api-reference/inference/models",
"openai_api": "litellm:litellm/llms/openai/chat/gpt_transformation.py (get_models)",
"chatgpt_capabilities": "https://github.com/openai/codex/blob/main/codex-rs/protocol/src/openai_models.rs",
"claude_capabilities": "https://platform.claude.com/docs/en/api/http/models"
},
"behavior": "Shared official provider catalogs with per-account authorization, proxy and capability checks. Exact model IDs and explicit reasoning values must have fresh authenticated evidence. No generation parameter rewrites or static model allowlist.",
"limitations": "Official metadata may lack required capability detail; explicit unsupported controls fail closed. Catalogs do not prove account-level generation availability. Pricing import is implemented separately in src/pricing/source.rs; fixtures are not live vendor validation."
},
"storage_adaptation": {
"implementation": "Memory business configuration with optional TEE-sealed SQLite accounting journal.",
"files": [
"src/vault.rs",
"src/cli.rs",
"src/ledger.rs",
"src/vault/journal.rs"
],
"behavior": "Business state in memory; optional authenticated SQLite accounting journal. Root checkpoints contain public recovery state; merchant secrets enter through the owner-authenticated account channel.",
"key_management": "TLS and receipt keys are generated per process. Journal keys derive from the local TEE interface; no external journal key is accepted."
},
"operations_adaptation": {
"implementation": "New Rust integration; not claimed as an upstream port.",
"files": [
"src/runtime.rs",
"src/server/admin.rs",
"src/router/operations.rs",
"src/router/affinity.rs",
"src/vault/operations.rs",
"src/compatibility.rs",
"src/resources.rs",
"tests/router/operations.rs"
],
"behavior": "Validated configuration generations, bounded sessions, account health and limits. Root checkpoints exclude merchant credentials. Native consumption billing, atomic settlement and the optional sealed journal are implemented in Router.",
"compatibility": "Current access-token-only protocol: merchant-managed authorization and renewal; Router retains access authentication, official model discovery, native parameter-preserving forwarding and proxy-bound requests. Refresh/discovery-of-token-endpoint/form-refresh code was removed. Legacy upstream references document provenance only.",
"excluded": "Current access-token-only protocol: merchant-managed authorization and renewal; Router retains access authentication, official model discovery, native parameter-preserving forwarding and proxy-bound requests. Refresh/discovery-of-token-endpoint/form-refresh code was removed. Legacy upstream references document provenance only."
},
"official_passthrough_adaptation": {
"implementation": "New teellm Rust code; not copied from LiteLLM.",
"files": [
"src/official.rs",
"src/client.rs",
"tests/router/trust.rs",
"tests/router/faithful.rs"
],
"behavior": "Only official OpenAI, Anthropic and xAI HTTPS hosts are permitted, with redirects disabled. Raw model and effort values are preserved.",
"removed_targets": [
"src/reasoning.rs"
]
},
"wire_configuration_adaptation": {
"implementation": "New teellm Rust code; no added runtime dependencies or script engine.",
"files": [
"src/compatibility/wire.rs",
"src/compatibility/wire/tests.rs",
"tests/router/compatibility.rs",
"protocol-update.example.json"
],
"validation": "All nonempty body edit rules are rejected at configuration activation and runtime. Generation header/query edits are rejected; only discovery metadata is configurable. Native requests preserve Agent parameters."
},
"administrator_restrictions": {
"implementation": "New Rust deny-only policy, independent of immutable authenticated official catalog evidence.",
"files": [
"src/policy.rs",
"src/policy_tests.rs",
"tests/router/restrictions.rs",
"restrictions-update.example.json"
],
"behavior": "Deny-only provider/model blocks and thinking/effort restrictions subtract from authenticated catalog evidence without modifying it. The router does not require callers to supply a token budget."
},
"refusal_audit": {
"implementation": "Explicit native upstream signal observation; LockLLM configuration and historical scanner type hierarchy removed.",
"files": [
"src/refusal.rs",
"src/refusal/tests.rs",
"tests/router/refusals.rs",
"src/refusal/queue.rs"
],
"behavior": "Relay records retain refusal type, not original text. Merchant counters persist independently. Standalone refusal HTTP APIs are removed. Bounded historical queue decoding remains for state recovery; nonempty retired scanner history requires prior archival.",
"validation": "Local JSON/SSE fixtures for retained providers; no live vendor policy-trigger tests."
}
}