zuplo 7.6.5 → 7.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/ai-gateway/custom-policies.mdx +8 -4
- package/docs/ai-gateway/getting-started.mdx +52 -66
- package/docs/ai-gateway/overview.mdx +8 -7
- package/docs/ai-gateway/policy-chains.mdx +21 -2
- package/docs/ai-gateway/source-control.mdx +37 -20
- package/docs/concepts/ai-gateway.mdx +6 -6
- package/docs/dev-portal/zudoku/configuration/api-reference.md +1 -1
- package/docs/dev-portal/zudoku/configuration/llms.md +0 -4
- package/docs/policies/ai-gateway-configuration-executor-v2-inbound/doc.md +35 -9
- package/package.json +5 -5
|
@@ -171,8 +171,9 @@ options exactly.
|
|
|
171
171
|
|
|
172
172
|
## Configure credentials
|
|
173
173
|
|
|
174
|
-
If a policy needs a credential—say it calls an external moderation API—
|
|
175
|
-
|
|
174
|
+
If a policy needs a credential—say it calls an external moderation API—store it
|
|
175
|
+
as an [environment variable](../articles/environment-variables.mdx) and
|
|
176
|
+
reference it with `$env(...)` in the declaration's options:
|
|
176
177
|
|
|
177
178
|
```json title="config/policies.json"
|
|
178
179
|
{
|
|
@@ -182,14 +183,17 @@ the declaration's options, and let chain entries inherit it:
|
|
|
182
183
|
"export": "default",
|
|
183
184
|
"module": "$import(./modules/my-moderation-policy)",
|
|
184
185
|
"options": {
|
|
185
|
-
"apiKey": "
|
|
186
|
+
"apiKey": "$env(MODERATION_API_KEY)"
|
|
186
187
|
}
|
|
187
188
|
}
|
|
188
189
|
}
|
|
189
190
|
```
|
|
190
191
|
|
|
191
192
|
Leave the chain entry's options out so it inherits the declaration's values—an
|
|
192
|
-
entry that sets its own options replaces them completely.
|
|
193
|
+
entry that sets its own options replaces them completely. An entry that does set
|
|
194
|
+
its own options can use `$env(...)` references too, so one declared policy can
|
|
195
|
+
read a different credential or setting per app. See
|
|
196
|
+
[Options and secrets](./policy-chains.mdx#options-and-secrets).
|
|
193
197
|
|
|
194
198
|
## Beyond filtering
|
|
195
199
|
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
title: Zuplo AI Gateway Getting Started
|
|
3
3
|
sidebar_label: Getting Started
|
|
4
4
|
description:
|
|
5
|
-
Set up your first AI Gateway project.
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
Set up your first AI Gateway project. Configure an AI provider, create a team
|
|
6
|
+
and an app, review the app's policy chain, and make your first LLM request
|
|
7
|
+
through Zuplo.
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
This guide walks you through setting up your first AI Gateway project, from
|
|
11
|
-
|
|
11
|
+
creating the project to making your first LLM request through Zuplo.
|
|
12
12
|
|
|
13
13
|
A Zuplo account contains your members and one or more projects. The AI Gateway
|
|
14
14
|
you create in this guide is a Zuplo project; its providers, teams, and apps all
|
|
@@ -19,7 +19,6 @@ account, Zuplo project, and AI Gateway team roles control access.
|
|
|
19
19
|
## Prerequisites
|
|
20
20
|
|
|
21
21
|
- A Zuplo account (sign up free at [zuplo.com](https://zuplo.com))
|
|
22
|
-
- A Git provider account that can create repositories (this guide uses GitHub)
|
|
23
22
|
- An API key for at least one LLM provider (OpenAI, Anthropic, Google, Mistral,
|
|
24
23
|
xAI, etc.)—or none at all, if you start with the free
|
|
25
24
|
[Zuplo Demo provider](./providers.mdx#zuplo-demo)
|
|
@@ -28,52 +27,32 @@ account, Zuplo project, and AI Gateway team roles control access.
|
|
|
28
27
|
|
|
29
28
|
1. **Create an AI Gateway project**
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
**Projects**, and click **New Project**. Choose **
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
Sign in to the [Zuplo Portal](https://portal.zuplo.com), navigate to
|
|
31
|
+
**Projects**, and click **New Project**. Choose **AI Gateway**, give your
|
|
32
|
+
project a name (for example, "MyCompany AI Gateway"), and click **Create
|
|
33
|
+
Project**.
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
the
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
Zuplo supports GitHub, GitLab, Bitbucket, and Azure DevOps. This guide uses
|
|
43
|
-
GitHub, which is the only provider with automatic deployments—see
|
|
44
|
-
[Source Control and Deployment](../concepts/source-control-and-deployment.mdx)
|
|
45
|
-
for the other providers, which deploy through the Zuplo CLI in your own CI/CD
|
|
46
|
-
pipeline.
|
|
47
|
-
|
|
48
|
-
With GitHub, click **Create New Repo** to open GitHub with the repository
|
|
49
|
-
name prefilled, create the repository, then return to the Zuplo Portal and
|
|
50
|
-
select the repository to connect it. Zuplo adds the gateway's source to the
|
|
51
|
-
repository and deploys it. After that, pushes to your default branch deploy
|
|
52
|
-
to production.
|
|
53
|
-
|
|
54
|
-
To work with the gateway's source later—for example, to add
|
|
55
|
-
[custom policies](./custom-policies.mdx)—clone the repository:
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
git clone https://github.com/your-org/your-gateway-repo.git
|
|
59
|
-
```
|
|
35
|
+
The portal shows **Setting up your gateway…** while it provisions the
|
|
36
|
+
project. When that's done, the project homepage opens with a setup checklist
|
|
37
|
+
for a provider, a team, and an app—the same path as this guide. Follow these
|
|
38
|
+
steps; you can tick the checklist as you go or ignore it. The gateway is
|
|
39
|
+
already deployed, so you can continue with this guide.
|
|
60
40
|
|
|
61
41
|
:::note
|
|
62
42
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
43
|
+
Connect a repository later if you want to write
|
|
44
|
+
[custom policies](./custom-policies.mdx) or manage the gateway's source in
|
|
45
|
+
Git. Open
|
|
46
|
+
[**Settings → Source Control**](https://portal.zuplo.com/+/account/project/ai/settings/source-control).
|
|
47
|
+
See [Source Control](./source-control.mdx).
|
|
66
48
|
|
|
67
49
|
:::
|
|
68
50
|
|
|
69
|
-
|
|
70
|
-
and how deployments work.
|
|
71
|
-
|
|
72
|
-
3. **Configure a provider**
|
|
51
|
+
2. **Configure a provider**
|
|
73
52
|
|
|
74
|
-
Providers are the LLM services (
|
|
75
|
-
You configure these once as an administrator, and your team members use
|
|
76
|
-
without needing direct access to provider API keys.
|
|
53
|
+
Providers are the LLM services (such as OpenAI or Anthropic) that your apps
|
|
54
|
+
use. You configure these once as an administrator, and your team members use
|
|
55
|
+
them without needing direct access to provider API keys.
|
|
77
56
|
|
|
78
57
|
Open
|
|
79
58
|
[**Settings → AI Providers**](https://portal.zuplo.com/+/account/project/ai/settings/data-models)
|
|
@@ -96,7 +75,7 @@ account, Zuplo project, and AI Gateway team roles control access.
|
|
|
96
75
|
full list of supported providers, including OpenAI-compatible custom
|
|
97
76
|
providers.
|
|
98
77
|
|
|
99
|
-
|
|
78
|
+
3. **Create a team**
|
|
100
79
|
|
|
101
80
|
Teams organize users and carry their own budget rules and policy templates.
|
|
102
81
|
Even if you're starting solo, you need at least one team.
|
|
@@ -104,13 +83,15 @@ account, Zuplo project, and AI Gateway team roles control access.
|
|
|
104
83
|
Open the **Apps & Teams** tab and click **New Team**. Name your team (for
|
|
105
84
|
example, "Root" or your company name), choose an icon, and click **Create
|
|
106
85
|
Team**. This is your first team, so there's no parent picker yet—it appears
|
|
107
|
-
on later teams, letting you nest them.
|
|
108
|
-
across this Zuplo project, open the gateway's **Settings → Usage Limits**.
|
|
109
|
-
Team budgets—shared and per-expression—are set on the team's **Usage &
|
|
110
|
-
Limits** tab. See [Usage Limits](./usage-limits.mdx). Gateway and team limits
|
|
111
|
-
apply to every app regardless of its policy chain.
|
|
86
|
+
on later teams, letting you nest them.
|
|
112
87
|
|
|
113
|
-
|
|
88
|
+
To set gateway-wide spending limits across this Zuplo project, open the
|
|
89
|
+
gateway's **Settings → Usage Limits**. Team budgets—shared and
|
|
90
|
+
per-expression—are set on the team's **Usage & Limits** tab. See
|
|
91
|
+
[Usage Limits](./usage-limits.mdx). Gateway and team limits apply to every
|
|
92
|
+
app regardless of its policy chain.
|
|
93
|
+
|
|
94
|
+
4. **Create an app**
|
|
114
95
|
|
|
115
96
|
Apps represent individual software applications or services that call the AI
|
|
116
97
|
Gateway. Each app gets its own unique URL and API key.
|
|
@@ -129,7 +110,7 @@ account, Zuplo project, and AI Gateway team roles control access.
|
|
|
129
110
|
|
|
130
111
|
:::
|
|
131
112
|
|
|
132
|
-
|
|
113
|
+
5. **Review the app's policy chain**
|
|
133
114
|
|
|
134
115
|
The portal opens the app's **Policies** tab, which shows the app's policy
|
|
135
116
|
chain—the ordered list of policies that run on each request. No policy is
|
|
@@ -137,15 +118,17 @@ account, Zuplo project, and AI Gateway team roles control access.
|
|
|
137
118
|
picks its own model as `providerName/model`, from any model your providers
|
|
138
119
|
expose.
|
|
139
120
|
|
|
140
|
-
To restrict that,
|
|
141
|
-
list
|
|
142
|
-
|
|
121
|
+
To restrict that, click **Add policy**, select **Model Filtering**, and give
|
|
122
|
+
it an allow list of models you enabled in the provider step—for example
|
|
123
|
+
`openai/gpt-5-mini` if you added OpenAI, or `zuplodemo/pirate` if you are
|
|
124
|
+
using only Zuplo Demo. Requests may then use only listed models, and the
|
|
125
|
+
first entry becomes the default when a request omits `model`.
|
|
143
126
|
|
|
144
127
|
:::caution{title="An unrestricted app can reach every model you configured"}
|
|
145
128
|
|
|
146
129
|
Without Model Filtering, an app may call any model available through the
|
|
147
130
|
providers configured for this Zuplo project, including expensive ones. Add
|
|
148
|
-
Model Filtering for any app that
|
|
131
|
+
Model Filtering for any app that you want limited to a specific set.
|
|
149
132
|
|
|
150
133
|
:::
|
|
151
134
|
|
|
@@ -153,7 +136,7 @@ account, Zuplo project, and AI Gateway team roles control access.
|
|
|
153
136
|
guardrails, and any custom policies. Changes to the chain apply within about
|
|
154
137
|
a minute—no redeploy needed. See [Policy Chains](./policy-chains.mdx).
|
|
155
138
|
|
|
156
|
-
|
|
139
|
+
6. **Get the app's URL and API key**
|
|
157
140
|
|
|
158
141
|
The app's **API URL** is shown in full at the top of the app page, and its
|
|
159
142
|
key lives on the app's **API Key** tab. The API URL is the gateway's hostname
|
|
@@ -190,12 +173,12 @@ account, Zuplo project, and AI Gateway team roles control access.
|
|
|
190
173
|
export ZUPLO_APP_API_KEY="<the API key from the app page>"
|
|
191
174
|
```
|
|
192
175
|
|
|
193
|
-
|
|
176
|
+
7. **Send your first request from the Playground**
|
|
194
177
|
|
|
195
178
|
Click **Playground** in the app's header to open it. It chats with the app's
|
|
196
179
|
own gateway URL and API key, so it exercises the same policy chain your code
|
|
197
|
-
|
|
198
|
-
|
|
180
|
+
hits—without wiring up a client first. The button sits on every app tab, so
|
|
181
|
+
you can try a request while editing policies without losing your place.
|
|
199
182
|
|
|
200
183
|
Pick a model from the selector, optionally set a system prompt, and send a
|
|
201
184
|
message. The playground shows the cURL for the next request, and **Copy
|
|
@@ -205,6 +188,9 @@ account, Zuplo project, and AI Gateway team roles control access.
|
|
|
205
188
|
|
|
206
189
|
</Stepper>
|
|
207
190
|
|
|
191
|
+
You now have a working AI Gateway: a provider, a team, an app, and a chat
|
|
192
|
+
completion through the app's URL.
|
|
193
|
+
|
|
208
194
|
## Integrate with your own code
|
|
209
195
|
|
|
210
196
|
Once the Playground works, configure your own code with the same URL and key.
|
|
@@ -221,7 +207,7 @@ for the [OpenAI SDK](./integrations/openai.mdx),
|
|
|
221
207
|
```javascript
|
|
222
208
|
import OpenAI from "openai";
|
|
223
209
|
|
|
224
|
-
//
|
|
210
|
+
// Direct OpenAI
|
|
225
211
|
const openai = new OpenAI({
|
|
226
212
|
apiKey: process.env.OPENAI_API_KEY,
|
|
227
213
|
});
|
|
@@ -239,11 +225,10 @@ console.log(completion.choices[0].message.content);
|
|
|
239
225
|
```javascript
|
|
240
226
|
import OpenAI from "openai";
|
|
241
227
|
|
|
242
|
-
//
|
|
228
|
+
// Through the AI Gateway
|
|
243
229
|
const openai = new OpenAI({
|
|
244
230
|
apiKey: process.env.ZUPLO_APP_API_KEY,
|
|
245
|
-
baseURL:
|
|
246
|
-
"https://my-gateway-main-2e18f50.zuplo.app/config_fe0a04972d2848e0a94ae4b8bcd1497e/v1",
|
|
231
|
+
baseURL: process.env.ZUPLO_APP_BASE_URL,
|
|
247
232
|
});
|
|
248
233
|
|
|
249
234
|
const completion = await openai.chat.completions.create({
|
|
@@ -256,7 +241,7 @@ console.log(completion.choices[0].message.content);
|
|
|
256
241
|
|
|
257
242
|
Run the example with `node sample.mjs`.
|
|
258
243
|
|
|
259
|
-
###
|
|
244
|
+
### Changes to make
|
|
260
245
|
|
|
261
246
|
1. **URL**: Replace your provider's URL with your app's gateway URL from the app
|
|
262
247
|
page
|
|
@@ -296,8 +281,7 @@ curl https://my-gateway-main-2e18f50.zuplo.app/config_fe0a04972d2848e0a94ae4b8bc
|
|
|
296
281
|
4. Click **View in Analytics** on the Metrics frame for the full request-level
|
|
297
282
|
breakdown, already filtered to this app.
|
|
298
283
|
|
|
299
|
-
|
|
300
|
-
metrics.
|
|
284
|
+
Your test request appears with token usage and performance metrics.
|
|
301
285
|
|
|
302
286
|
## Next steps
|
|
303
287
|
|
|
@@ -305,6 +289,8 @@ metrics.
|
|
|
305
289
|
caching, and guardrails to your app's chain
|
|
306
290
|
- [Custom Policies](./custom-policies.mdx): write your own policy and add it to
|
|
307
291
|
an app's chain
|
|
292
|
+
- [Source Control](./source-control.mdx): connect a Git repository when you want
|
|
293
|
+
to edit the gateway's source or write custom policies
|
|
308
294
|
- [Policy Templates](./policy-templates.mdx): give every new app in a team a
|
|
309
295
|
consistent starting chain
|
|
310
296
|
- [Usage Limits](./usage-limits.mdx): set spending limits for the gateway,
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
title: AI Gateway overview
|
|
3
3
|
sidebar_label: Overview
|
|
4
4
|
description:
|
|
5
|
-
The Zuplo AI Gateway is a proxy between your apps and LLM providers,
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
The Zuplo AI Gateway is a proxy between your apps and LLM providers, with
|
|
6
|
+
per-app policy pipelines for cost control, model access, guardrails, and
|
|
7
|
+
observability.
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
Zuplo's AI Gateway acts as an intelligent proxy layer that sits between your
|
|
@@ -84,10 +84,11 @@ capabilities. Apps reference models as `providerName/model`—for example
|
|
|
84
84
|
|
|
85
85
|
### Source-Controlled Gateway
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
A new AI Gateway project deploys without a Git repository, so you can configure
|
|
88
|
+
providers, teams, and apps right away. Connect a
|
|
89
|
+
[Git repository](./source-control.mdx) when you want to write custom policies or
|
|
90
|
+
review gateway changes in Git. After you connect, the default branch is what
|
|
91
|
+
production runs.
|
|
91
92
|
|
|
92
93
|
### Per-App Policy Chains
|
|
93
94
|
|
|
@@ -90,8 +90,27 @@ an entry with empty options replaces the declared options with an empty object,
|
|
|
90
90
|
which breaks a policy that has required settings. Omit options entirely to
|
|
91
91
|
inherit.
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
Entry options may reference
|
|
94
|
+
[environment variables](../articles/environment-variables.mdx) with
|
|
95
|
+
`$env(VAR_NAME)`, exactly as in `policies.json`. The gateway resolves each
|
|
96
|
+
reference when the chain runs, so a per-app entry can carry its own
|
|
97
|
+
environment-backed value:
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
{
|
|
101
|
+
"name": "my-moderation-policy",
|
|
102
|
+
"options": {
|
|
103
|
+
"apiKey": "$env(MODERATION_API_KEY)",
|
|
104
|
+
"threshold": 0.8
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
A reference to an unset variable fails the request with a configuration error
|
|
110
|
+
naming the variable—it never silently resolves to an empty string.
|
|
111
|
+
|
|
112
|
+
Alternatively, keep credentials in the declaration's options and let entries
|
|
113
|
+
inherit them, so the gateway's repository—not app configuration—holds them. See
|
|
95
114
|
[Configure credentials](./custom-policies.mdx#configure-credentials).
|
|
96
115
|
|
|
97
116
|
## Recommended order
|
|
@@ -2,25 +2,28 @@
|
|
|
2
2
|
title: AI Gateway Source Control
|
|
3
3
|
sidebar_label: Source Control
|
|
4
4
|
description:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
changes require a deploy versus applying live.
|
|
5
|
+
A new AI Gateway project deploys without Git. Connect a repository to write
|
|
6
|
+
custom policies, review gateway source, and deploy from your default branch.
|
|
8
7
|
---
|
|
9
8
|
|
|
10
|
-
An AI Gateway is a Zuplo project configured for AI traffic.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
An AI Gateway is a Zuplo project configured for AI traffic. A new project
|
|
10
|
+
deploys automatically, so you can configure providers, teams, and apps without
|
|
11
|
+
connecting a Git repository. Connect one when you want to write
|
|
12
|
+
[custom policies](./custom-policies.mdx), review gateway changes in Git, or
|
|
13
|
+
deploy from your own CI/CD.
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
The repository contains the gateway's routes and policy declarations. Custom
|
|
16
|
+
policies are plain TypeScript files you commit alongside them.
|
|
17
|
+
|
|
18
|
+
## Connect a repository
|
|
17
19
|
|
|
18
|
-
A new AI Gateway project must be connected to a repository before it can deploy.
|
|
19
20
|
Zuplo supports GitHub, GitLab, Bitbucket, and Azure DevOps—see
|
|
20
21
|
[Source Control and Deployment](../concepts/source-control-and-deployment.mdx)
|
|
21
22
|
for what each provider supports.
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
Open
|
|
25
|
+
[**Settings → Source Control**](https://portal.zuplo.com/+/account/project/ai/settings/source-control)
|
|
26
|
+
and choose one of the following:
|
|
24
27
|
|
|
25
28
|
- **Create New Repo** starts a new repository with the name prefilled. With
|
|
26
29
|
GitHub, this opens GitHub directly; create the repository, then return to the
|
|
@@ -28,14 +31,28 @@ The project shows a **Let's Get You Deployed** screen with two options:
|
|
|
28
31
|
- Connect an existing repository. Use an empty one so the gateway's source has
|
|
29
32
|
the repository to itself.
|
|
30
33
|
|
|
31
|
-
When you connect, Zuplo adds the gateway's source to the repository
|
|
32
|
-
|
|
34
|
+
When you connect, Zuplo adds the gateway's source to the repository and pushes
|
|
35
|
+
it. The first push rebuilds production from that source. After that, with
|
|
36
|
+
GitHub, pushes to your default branch deploy to production.
|
|
37
|
+
|
|
38
|
+
Until you connect a repository, production runs the gateway template Zuplo
|
|
39
|
+
deploys at project creation. Connecting a repository doesn't replace that
|
|
40
|
+
production URL; the first source deploy reuses it.
|
|
41
|
+
|
|
42
|
+
To work with the source locally, clone the repository:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
git clone https://github.com/GITHUB_ORG/REPO_NAME.git
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Replace `GITHUB_ORG` with your GitHub organization or user, and `REPO_NAME` with
|
|
49
|
+
the repository name.
|
|
33
50
|
|
|
34
51
|
:::note
|
|
35
52
|
|
|
36
53
|
If your default branch requires pull requests, Zuplo pushes the gateway source
|
|
37
|
-
to a setup branch and surfaces a pull request for you to merge. The
|
|
38
|
-
|
|
54
|
+
to a setup branch and surfaces a pull request for you to merge. The project
|
|
55
|
+
finishes connecting once the pull request lands on the default branch.
|
|
39
56
|
|
|
40
57
|
:::
|
|
41
58
|
|
|
@@ -56,13 +73,13 @@ Add custom policy modules under `modules/` and declare them in
|
|
|
56
73
|
|
|
57
74
|
## How deployments work
|
|
58
75
|
|
|
59
|
-
|
|
60
|
-
to it deploys automatically. With GitLab, Bitbucket, and
|
|
61
|
-
CI/CD pipeline deploys by calling `zuplo deploy`—see
|
|
76
|
+
After you connect a repository, its default branch is what production runs. With
|
|
77
|
+
GitHub, every push to it deploys automatically. With GitLab, Bitbucket, and
|
|
78
|
+
Azure DevOps, your own CI/CD pipeline deploys by calling `zuplo deploy`—see
|
|
62
79
|
[Source Control and Deployment](../concepts/source-control-and-deployment.mdx).
|
|
63
80
|
|
|
64
|
-
|
|
65
|
-
|
|
81
|
+
After you connect, the **Code** tab opens the gateway's source. You can also
|
|
82
|
+
clone the repository and edit it with your normal tools.
|
|
66
83
|
|
|
67
84
|
Three categories of changes take effect differently:
|
|
68
85
|
|
|
@@ -55,12 +55,12 @@ code change.
|
|
|
55
55
|
|
|
56
56
|
## How it fits into Zuplo
|
|
57
57
|
|
|
58
|
-
An AI Gateway is a type of Zuplo project.
|
|
59
|
-
|
|
60
|
-
go through the same review workflow as the rest of your
|
|
61
|
-
|
|
62
|
-
platform primitives — deployment model, environments, analytics —
|
|
63
|
-
ones described in [How Zuplo Works](./how-zuplo-works.mdx).
|
|
58
|
+
An AI Gateway is a type of Zuplo project. A new project deploys without a Git
|
|
59
|
+
repository; you can [connect a repository](../ai-gateway/source-control.mdx)
|
|
60
|
+
later so gateway changes go through the same review workflow as the rest of your
|
|
61
|
+
Zuplo configuration. The providers, teams, and apps you configure belong to that
|
|
62
|
+
project. The platform primitives — deployment model, environments, analytics —
|
|
63
|
+
are the same ones described in [How Zuplo Works](./how-zuplo-works.mdx).
|
|
64
64
|
|
|
65
65
|
## Next steps
|
|
66
66
|
|
|
@@ -276,7 +276,7 @@ Available options:
|
|
|
276
276
|
schemes section on the info page, and the Authorize dialog in the playground). Disabled by default
|
|
277
277
|
(`true`). Set to `false` to enable security scheme support
|
|
278
278
|
- `disableMcpAuthInstructions`: Hide the authentication instructions on
|
|
279
|
-
[MCP server](
|
|
279
|
+
[MCP server](/docs/dev-portal/documenting-mcp-servers) endpoints. The MCP card normally derives a credential
|
|
280
280
|
header from the operation's security scheme and shows it in every install snippet. Set to `true`
|
|
281
281
|
to render the server as unauthenticated instead — no header snippets and no "replace
|
|
282
282
|
`YOUR_API_KEY`" steps
|
|
@@ -112,10 +112,6 @@ dist/
|
|
|
112
112
|
└── ...
|
|
113
113
|
```
|
|
114
114
|
|
|
115
|
-
On Vercel builds, this tree is written beneath `.vercel/output/static/` instead of `dist/`. The
|
|
116
|
-
deployed public URLs remain the same. See the [Vercel deployment guide](/dev-portal/zudoku/deploy/vercel) for the
|
|
117
|
-
generated routing and Markdown content-negotiation behavior.
|
|
118
|
-
|
|
119
115
|
**Important:** Individual `.md` files are only kept in the final build if `publishMarkdown: true`.
|
|
120
116
|
If only `llmsTxt` or `llmsTxtFull` is enabled, the `.md` files are generated temporarily during the
|
|
121
117
|
build but deleted after the `llms.txt` files are created.
|
|
@@ -535,9 +535,33 @@ From a chain policy you can:
|
|
|
535
535
|
|
|
536
536
|
## Store secrets safely
|
|
537
537
|
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
538
|
+
Application chain options can reference project environment variables. Use a
|
|
539
|
+
standalone reference when the complete option value comes from one variable, or
|
|
540
|
+
embed one or more references in a larger string:
|
|
541
|
+
|
|
542
|
+
```json
|
|
543
|
+
{
|
|
544
|
+
"inboundPolicyChain": [
|
|
545
|
+
{
|
|
546
|
+
"name": "my-ai-guardrail",
|
|
547
|
+
"options": {
|
|
548
|
+
"apiKey": "$env(MY_GUARDRAIL_API_KEY)",
|
|
549
|
+
"authorization": "Bearer $env(MY_GUARDRAIL_API_KEY)"
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
]
|
|
553
|
+
}
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
The executor resolves `$env(NAME)` references when it instantiates an enabled
|
|
557
|
+
chain entry. Resolution visits string values recursively through nested objects
|
|
558
|
+
and arrays. Object keys remain literal. If a referenced variable is missing or
|
|
559
|
+
restricted, the executor rejects the configuration with an error that identifies
|
|
560
|
+
the variable and the chain entry; it never substitutes an empty string.
|
|
561
|
+
|
|
562
|
+
To share the same environment-backed options across applications, keep them in
|
|
563
|
+
the pre-declared policy's `handler.options`, then omit `options` from the
|
|
564
|
+
application chain entry to inherit them:
|
|
541
565
|
|
|
542
566
|
```json
|
|
543
567
|
{
|
|
@@ -563,9 +587,9 @@ to inherit them:
|
|
|
563
587
|
}
|
|
564
588
|
```
|
|
565
589
|
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
590
|
+
Declared `handler.options` use the normal build-time environment resolution.
|
|
591
|
+
Application entry options are resolved at runtime and replace the declaration's
|
|
592
|
+
complete options object; the two objects are not merged.
|
|
569
593
|
|
|
570
594
|
## Chain entry reference
|
|
571
595
|
|
|
@@ -578,8 +602,8 @@ Every chain entry supports:
|
|
|
578
602
|
without running it. Omitted or `true` entries run normally.
|
|
579
603
|
|
|
580
604
|
Disabled entries are still validated. They must be well-formed, name a declared
|
|
581
|
-
policy,
|
|
582
|
-
|
|
605
|
+
policy, and cannot select the configuration loader or executor. Their options
|
|
606
|
+
are not instantiated, so their environment references are not resolved.
|
|
583
607
|
|
|
584
608
|
The executor permits repeated entries and cannot infer the behavior of custom or
|
|
585
609
|
wrapper policies. Configuration authors are responsible for avoiding repeated
|
|
@@ -606,7 +630,9 @@ Before deploying:
|
|
|
606
630
|
1. Declare every selectable policy in `config/policies.json`.
|
|
607
631
|
2. Configure application and team policy templates with the policies each app
|
|
608
632
|
may edit or remove.
|
|
609
|
-
3. Put environment-backed values in declared policy options
|
|
633
|
+
3. Put shared environment-backed values in declared policy options, or use
|
|
634
|
+
`$env(...)` in application entry option values when each application needs
|
|
635
|
+
its own complete options object.
|
|
610
636
|
4. Place the configuration loader before the executor on every AI Gateway route
|
|
611
637
|
(or the executor alone when you prefer the combined path). Add AI Gateway
|
|
612
638
|
Authentication to an application's chain for that app only, or before the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zuplo",
|
|
3
|
-
"version": "7.6.
|
|
3
|
+
"version": "7.6.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The official Zuplo CLI for local development and platform management",
|
|
6
6
|
"homepage": "https://zuplo.com/docs/cli/overview",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"zuplo": "zuplo.js"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@zuplo/cli": "7.6.
|
|
36
|
-
"@zuplo/core": "7.6.
|
|
37
|
-
"@zuplo/runtime": "7.6.
|
|
38
|
-
"@zuplo/test": "7.6.
|
|
35
|
+
"@zuplo/cli": "7.6.7",
|
|
36
|
+
"@zuplo/core": "7.6.7",
|
|
37
|
+
"@zuplo/runtime": "7.6.7",
|
|
38
|
+
"@zuplo/test": "7.6.7"
|
|
39
39
|
}
|
|
40
40
|
}
|