@@ -14,14 +14,18 @@ Check out the [API docs](https://portkey.ai/docs/welcome/make-your-first-request
14
14
15
15
## Local Deployment
16
16
17
- 1 . Run through [ NPX ] ( #node ) or [ BunX ] ( #bun ) Install
17
+ 1 . Do [ NPM ] ( #node ) or [ Bun ] ( #bun ) Install
18
18
2 . Run a [ Node.js Server] ( #nodejs-server )
19
- 3 . Deploy using [ Docker ] ( #docker )
20
- 4 . Deploy using [ Docker Compose ] ( #docker-compose )
21
- 5 . Deploy on [ Cloudflare Workers ] ( #cloudflare-workers )
22
- 6 . Deploy on [ App Stack ] ( #deploy-to-app-stack )
19
+ 3 . Deploy on [ App Stack ] ( #deploy-to-app-stack )
20
+ 4 . Deploy on [ Cloudflare Workers ] ( #cloudflare-workers )
21
+ 5 . Deploy using [ Docker ] ( #docker )
22
+ 6 . Deploy using [ Docker Compose ] ( #docker-compose )
23
23
7 . Deploy on [ Replit] ( #replit )
24
24
8 . Deploy on [ Zeabur] ( #zeabur )
25
+ 9 . Deploy with [ Supabase Functions] ( #supabase-functions )
26
+ 10 . Deploy using [ Fastly] ( #fastly )
27
+
28
+ ---
25
29
26
30
### Node
27
31
@@ -39,7 +43,37 @@ $ bunx @portkey-ai/gateway
39
43
40
44
<br >
41
45
42
- ### Deploy to App Stack
46
+
47
+ ---
48
+
49
+ ### NodeJS Server
50
+
51
+ 1 . Clone the Repository
52
+
53
+ ``` sh
54
+ git clone https://github.com/portkey-ai/gateway
55
+ ```
56
+
57
+ 2 . Install the NPM Dependencies
58
+
59
+ ``` sh
60
+ cd gateway
61
+ npm i
62
+ npm run build
63
+ ```
64
+
65
+ 3 . Run the Server
66
+
67
+ ``` sh
68
+ node build/start-server.js
69
+ ```
70
+
71
+ <br >
72
+
73
+ ---
74
+
75
+ ### Deploy to App Stack
76
+
43
77
F5 Distributed Cloud
44
78
1 . [ Create an App Stack Site] ( https://docs.cloud.f5.com/docs/how-to/site-management/create-voltstack-site )
45
79
@@ -94,7 +128,8 @@ curl --request POST \
94
128
--data ' {"metadata": {"name": "$DISTRIBUTED_CLOUD_SERVICE_NAME","namespace": "$DISTRIBUTED_CLOUD_NAMESPACE","labels": {},"annotations": {},"description": "","disable": false},"spec": {"origin_servers": [{"k8s_service": {"service_name": "$DISTRIBUTED_CLOUD_SERVICE_NAME.$DISTRIBUTED_CLOUD_APP_STACK_NAMESPACE","site_locator": {"site": {"tenant": "$DISTRIBUTED_CLOUD_TENANT_ID","namespace": "system","name": "$DISTRIBUTED_CLOUD_APP_STACK_SITE"}},"inside_network": {}},"labels": {}}],"no_tls": {},"port": 8787,"same_as_endpoint_port": {},"healthcheck": [],"loadbalancer_algorithm": "LB_OVERRIDE","endpoint_selection": "LOCAL_PREFERRED","advanced_options": null}}'
95
129
```
96
130
or [ use the UI] ( https://docs.cloud.f5.com/docs/how-to/app-networking/origin-pools )
97
- 5 . Create an HTTP Load Balancer, including header injection of Portkey provider and credentials
131
+
132
+ 6 . Create an HTTP Load Balancer, including header injection of Portkey provider and credentials
98
133
``` shell
99
134
curl --request POST \
100
135
--url https://$DISTRIBUTED_CLOUD_TENANT .console.ves.volterra.io/api/config/namespaces/$DISTRIBUTED_CLOUD_NAMESPACE /http_loadbalancers \
@@ -103,7 +138,8 @@ curl --request POST \
103
138
--data '{"metadata": {"name": "$DISTRIBUTED_CLOUD_SERVICE_NAME","namespace": "$DISTRIBUTED_CLOUD_NAMESPACE","labels": {},"annotations": {},"description": "","disable": false},"spec": {"domains": ["$PORTKEY_GATEWAY_FQDN"],"https_auto_cert": {"http_redirect": true,"add_hsts": false,"tls_config": {"default_security": {}},"no_mtls": {},"default_header": {},"enable_path_normalize": {},"port": 443,"non_default_loadbalancer": {},"header_transformation_type": {"default_header_transformation": {}},"connection_idle_timeout": 120000,"http_protocol_options": {"http_protocol_enable_v1_v2": {}}},"advertise_on_public_default_vip": {},"default_route_pools": [{"pool": {"tenant": "$DISTRIBUTED_CLOUD_TENANT_ID","namespace": "$DISTRIBUTED_CLOUD_NAMESPACE","name": "$DISTRIBUTED_CLOUD_SERVICE_NAME"},"weight": 1,"priority": 1,"endpoint_subsets": {}}],"origin_server_subset_rule_list": null,"routes": [],"cors_policy": null,"disable_waf": {},"add_location": true,"no_challenge": {},"more_option": {"request_headers_to_add": [{"name": "x-portkey-provider","value": "$PORTKEY_PROVIDER","append": false},{"name": "Authorization","value": "Bearer $PORTKEY_PROVIDER_AUTH_TOKEN","append": false}],"request_headers_to_remove": [],"response_headers_to_add": [],"response_headers_to_remove": [],"max_request_header_size": 60,"buffer_policy": null,"compression_params": null,"custom_errors": {},"javascript_info": null,"jwt": [],"idle_timeout": 30000,"disable_default_error_pages": false,"cookies_to_modify": []},"user_id_client_ip": {},"disable_rate_limit": {},"malicious_user_mitigation": null,"waf_exclusion_rules": [],"data_guard_rules": [],"blocked_clients": [],"trusted_clients": [],"api_protection_rules": null,"ddos_mitigation_rules": [],"service_policies_from_namespace": {},"round_robin": {},"disable_trust_client_ip_headers": {},"disable_ddos_detection": {},"disable_malicious_user_detection": {},"disable_api_discovery": {},"disable_bot_defense": {},"disable_api_definition": {},"disable_ip_reputation": {},"disable_client_side_defense": {},"csrf_policy": null,"graphql_rules": [],"protected_cookies": [],"host_name": "","dns_info": [],"internet_vip_info": [],"system_default_timeouts": {},"jwt_validation": null,"disable_threat_intelligence": {},"l7_ddos_action_default": {},}}'
104
139
```
105
140
or [ use the UI] ( https://docs.cloud.f5.com/docs/how-to/app-networking/http-load-balancer )
106
- 6 . Test the service
141
+
142
+ 7 . Test the service
107
143
``` shell
108
144
curl --request POST \
109
145
--url https://$PORTKEY_GATEWAY_FQDN /v1/chat/completions \
@@ -137,6 +173,7 @@ in addition to the response headers, you should get a response body like
137
173
}
138
174
```
139
175
176
+ ---
140
177
141
178
### Cloudflare Workers
142
179
@@ -159,33 +196,10 @@ npm install
159
196
npm run deploy
160
197
```
161
198
199
+ For more details, refer to [ Cloudflare Workers official] ( https://developers.cloudflare.com/workers/ ) .
162
200
<br >
163
201
164
- ### NodeJS Server
165
-
166
- 1 . Clone the Repository
167
-
168
- ``` sh
169
- git clone https://github.com/portkey-ai/gateway
170
- ```
171
-
172
- 2 . Install the NPM Dependencies
173
-
174
- ``` sh
175
- cd gateway
176
- npm i
177
- npm run build
178
- ```
179
-
180
- <br >
181
-
182
- 3 . Run the Server
183
-
184
- ``` sh
185
- node build/start-server.js
186
- ```
187
-
188
- <br >
202
+ ---
189
203
190
204
### Docker
191
205
@@ -199,6 +213,8 @@ For more information on the Docker image, check [here](https://hub.docker.com/r/
199
213
200
214
<br >
201
215
216
+ ---
217
+
202
218
### Docker Compose
203
219
204
220
1 . Download Compose File from the Repository:
@@ -214,8 +230,10 @@ docker compose up -d
214
230
```
215
231
> The service is now running and listening on port 8787
216
232
233
+ For more details, refer to [ Docker Compose official] ( https://docs.docker.com/compose/ ) .
217
234
<br >
218
235
236
+
219
237
### AWS EC2
220
238
1 . Copy the AWS CloudFormation template from below:
221
239
``` yaml
@@ -336,48 +354,123 @@ Outputs:
336
354
337
355
5. Once the stack is created, you can access the Portkey Gateway URL from the Outputs section.
338
356
357
+ ---
358
+
359
+
339
360
### Replit
340
361
341
362
[](https://replit.com/@portkey/AI-Gateway?v=1)
342
363
343
- <br>
364
+ ---
344
365
345
366
### Zeabur
346
367
347
368
[](https://zeabur.com/templates/RU38E3)
348
369
349
- <br>
370
+ ---
350
371
351
- ### Vercel
372
+ ### Supabase Functions
373
+
374
+ 1. Clone the Repository:
375
+
376
+ ` ` ` sh
377
+ git clone https://github.com/portkey-ai/gateway
378
+ ```
352
379
353
- Docs to be written, please help!
380
+ 2 . Set up a Supabase Account and create a new project (in browser).
381
+ 3 . Install the Supabase CLI, login using `supabase login
382
+ ` and Initialize, follow [ guides] ( https://supabase.com/docs/guides/local-development )
383
+ 4 . Write Your Supabase Function in:
384
+ ``` sh
385
+ supabase/functions/your-function-file/index.ts
386
+ ```
387
+ 5 . Deploy the Function (for windows add ` npx ` in start):
388
+ ``` sh
389
+ supabase functions deploy your-function-file
390
+ ```
391
+ 6 . Now, its ready to Test, Monitor and Manage Functions (Using url from supabase dashboard):
392
+ - Similar to ` https://your-project-id.supabase.co/functions/v1/your-function-file `
393
+
394
+ Refer to [ Supabase's official documentation] ( https://supabase.com/docs ) for more details.
354
395
355
396
<br >
356
397
398
+ ---
399
+
357
400
### Fastly
358
401
359
- Docs to be written, please help!
402
+ 1 . Create / login to your fastly account (in browser).
403
+
404
+ 2 . Clone the Gateway Repository:
405
+
406
+ ``` sh
407
+ git clone https://github.com/portkey-ai/gateway
408
+ ```
409
+
410
+ 3 . Install Fastly’s CLI:
411
+
412
+ ``` sh
413
+ npm install fastly-cli
414
+ ```
415
+
416
+ 4 . Log in to Fastly:
417
+ ``` sh
418
+ fastly login
419
+ ```
420
+
421
+ 5 . Create a New Fastly Service:
422
+ ``` sh
423
+ fastly compute init
424
+ ```
425
+
426
+ 6 . Write Your Edge Function Code in ` src/main.rs ` or ` src/index.js `
427
+
428
+ 7 . Set up the token locally (token is located on ` Account > User(left bottom most) > API Token ` )
429
+ ``` sh
430
+ fastly profile create
431
+ ```
432
+ Then follow the steps there to add token.
433
+
434
+ 8 . Deploy to Fastly
435
+ ``` sh
436
+ fastly compute publish
437
+ ```
438
+ 9 . Now, its ready to Test, Monitor and Manage Functions (Using url from fastly dashboard):
439
+ - Similar to ` your-new-project.edgecompute.app `
440
+
441
+ For more details, refer to [ Fastly’s official] ( https://www.fastly.com/products/edge-compute ) .
360
442
361
443
<br >
362
444
363
- ### AWS Lambda
445
+ ---
364
446
365
- Docs to be written, please help!
447
+ ### Vercel
448
+
449
+ - Docs to be written, please help!
450
+ - Make sure you've deployed and tested the same.
366
451
367
452
<br >
368
453
369
- ### Lambda@edge
454
+ ---
455
+
456
+ ### AWS Lambda
370
457
371
- Docs to be written, please help!
458
+ - Docs to be written, please help!
459
+ - Make sure you've deployed and tested the same.
372
460
373
461
<br >
374
462
375
- ### Supabase Functions
463
+ ---
464
+
465
+ ### Lambda edge
376
466
377
- Docs to be written, please help!
467
+ - Docs to be written, please help!
468
+ - Make sure you've deployed and tested the same.
378
469
379
470
<br >
380
471
472
+ ---
473
+
381
474
## Enterprise Deployment
382
475
Make your AI app more <ins >reliable</ins > and <ins >forward compatible</ins >, while ensuring complete <ins >data security</ins > and <ins >privacy</ins >.
383
476
0 commit comments