Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
443 commits
Select commit Hold shift + click to select a range
665ed33
Merge pull request #1333 from narengogi/chore/image-edits
VisargD Sep 16, 2025
ea51b38
1.12.0
VisargD Sep 16, 2025
0142e83
Merge pull request #1346 from Portkey-AI/feat/release-1.12.0
VisargD Sep 16, 2025
a960ca5
cleaner implementation for image edits route
narengogi Sep 16, 2025
ad3b21b
remove transforms
narengogi Sep 17, 2025
55180e6
update check for isStreaming()
narengogi Sep 17, 2025
1be69cb
disable caching for imageEdits
narengogi Sep 17, 2025
69b228c
remove handler
narengogi Sep 17, 2025
c491941
support more parameters for azure foundry
narengogi Sep 17, 2025
72285a5
support anthropic beta for bedrock
narengogi Sep 17, 2025
7f5640a
cleanaup bedrock provider
narengogi Aug 9, 2025
6a2d51f
support array containing a single string
narengogi Sep 17, 2025
2bfd4af
cleanup vertex api.ts
narengogi Aug 22, 2025
36393df
cleanup vertex
narengogi Sep 17, 2025
e84af79
Merge branch 'main' into feature/add-qualifire-integration
drorIvry Sep 17, 2025
74b679e
Merge pull request #1347 from narengogi/fix/image-edits-route-cleaner…
VisargD Sep 18, 2025
a741801
1.12.1
VisargD Sep 18, 2025
f6bc63c
Merge pull request #1351 from Portkey-AI/feat/release-1.12.1
VisargD Sep 18, 2025
1bb8821
cleanup azure openai implementation
narengogi Sep 18, 2025
97ba096
remove anthropic beta mapping
narengogi Sep 18, 2025
6eacbff
anthropic beta for vertex
narengogi Sep 22, 2025
fc3a5cb
fix: tools cache_control parameter mapping for bedrock unified messag…
VisargD Sep 23, 2025
07ac41b
Merge pull request #1360 from Portkey-AI/fix/bedrock-messages-tools-c…
VisargD Sep 24, 2025
c1059a6
1.12.2
VisargD Sep 24, 2025
6eb689b
Merge pull request #1361 from Portkey-AI/feat/release-1.12.2
VisargD Sep 24, 2025
08975f7
fix: add tool use event handling in Bedrock messages transformer
VisargD Sep 24, 2025
aaff76c
chore: minor check refactoring for bedrock messages tool use stream c…
VisargD Sep 24, 2025
4e768cd
fix: handle thinking content_block_start event in bedrock messages st…
VisargD Sep 24, 2025
8017264
fix: add handling for redacted thinking content in bedrock messages s…
VisargD Sep 25, 2025
2726d31
fix: error response handling in Bedrock messages response transformation
VisargD Sep 25, 2025
a0a0dea
feat: add CometAPI provider and configurations for chat and embedding…
tensornull Sep 28, 2025
1f9d34b
fix: remove duplicate entry for Text Embedding Ada 002 in models.json
tensornull Sep 28, 2025
a65f9d7
Merge branch 'main' into feature/add-qualifire-integration
drorIvry Sep 28, 2025
93bff50
Merge pull request #1356 from narengogi/vertex/anthropic-beta
VisargD Sep 29, 2025
02e3feb
Merge branch 'main' into fix/bedrock-messages-tooluse-stream-chunk-tr…
VisargD Sep 29, 2025
b356b0b
Merge pull request #1362 from Portkey-AI/fix/bedrock-messages-tooluse…
VisargD Sep 29, 2025
84c30d1
1.12.3
VisargD Sep 29, 2025
c1c7e7d
Merge pull request #1365 from Portkey-AI/feat/release-1.12.3
VisargD Sep 29, 2025
4deee0b
Merge branch 'main' into feat/cometapi
tensornull Sep 29, 2025
d3708ad
Merge branch 'main' into feature/add-qualifire-integration
drorIvry Sep 29, 2025
4ad72f9
Merge branch 'main' into chore/bedrock-cleanup
narengogi Sep 29, 2025
b90697a
Merge branch 'main' into chore/vertex-cleanup
narengogi Sep 29, 2025
2a4eb20
formatting
narengogi Sep 29, 2025
c6881f4
formatting
narengogi Sep 29, 2025
aff87ae
fix: simplify CometAPI configuration and remove unused response trans…
tensornull Sep 30, 2025
ef99ad6
Rate limits and budgets
narengogi Sep 22, 2025
6d123db
remvoe bindings
narengogi Sep 30, 2025
d55ecf8
remove kv
narengogi Sep 30, 2025
169e7d2
Merge remote-tracking branch 'upstream/main' into feature/ratelimits-…
narengogi Sep 30, 2025
8407df1
rebase
narengogi Sep 30, 2025
1d99b8a
Apply suggestion from @matter-code-review[bot]
narengogi Oct 1, 2025
1c3d5c5
Apply suggestion from @matter-code-review[bot]
narengogi Oct 1, 2025
2b379fb
Apply suggestion from @matter-code-review[bot]
narengogi Oct 1, 2025
0bb75dd
Apply suggestion from @matter-code-review[bot]
narengogi Oct 1, 2025
05e42a3
handle settings
narengogi Oct 1, 2025
ed10b53
add input_audio parameter support for vertex
narengogi Oct 1, 2025
7d17692
add input_audio parameter support for vertex
narengogi Oct 1, 2025
bdd6737
fix: handle error from bedrock batch status check
b4s36t4 Oct 2, 2025
33d9456
Merge branch 'main' into main
abhijitjavelin Oct 3, 2025
c171d83
fix: custom host validator to protect from ssrf attack
sk-portkey Oct 7, 2025
00c00e8
handle redis rate limiter tokens rate limiting when tokens to decreme…
narengogi Oct 7, 2025
a29315e
remove cache backend changes
narengogi Oct 9, 2025
9cc932d
remove unused imports
narengogi Oct 9, 2025
2505510
update settings example
narengogi Oct 9, 2025
bc56171
update settings initializer
narengogi Oct 9, 2025
99f6262
dont hardcode id
narengogi Oct 9, 2025
d331fd8
remove unused variable
narengogi Oct 9, 2025
f4cdbe3
handle nulls
narengogi Oct 9, 2025
d2ca7ef
remove import
narengogi Oct 9, 2025
b372b2f
delete transfer encoding for node
narengogi Oct 9, 2025
73d0a4d
add cachedContentTokenCount to vertex usage metadata
miuosz Oct 10, 2025
867f3d9
add support for vertex ai gemini cachedContentTokenCount
miuosz Oct 10, 2025
142b5bb
add support for anthropic vertex-ai cache
miuosz Oct 10, 2025
91b29fa
pass cache control for string content
miuosz Oct 10, 2025
b0365a3
reomove as any type assertion
miuosz Oct 10, 2025
4bd6bc2
fix: support for multiguardrails
Oct 10, 2025
0fb9bba
Merge remote changes with local multiguardrails support
Oct 10, 2025
f0575f7
fix: build break
Oct 10, 2025
971c72a
Merge pull request #1332 from abhijitjavelin/main
VisargD Oct 10, 2025
a30cfff
extend redis client backend to support redis specific functionality
narengogi Oct 10, 2025
ec153fb
dont crash on unhandled promise rejections and other changes like ren…
narengogi Oct 10, 2025
bcc756f
handle cache tokens for google as well and handle audio tokens for bo…
narengogi Oct 13, 2025
d5cb122
handle cache tokens for google as well and handle audio tokens for bo…
narengogi Oct 13, 2025
6fe2837
handle mapping for cache creation tokens in anthropic
narengogi Oct 13, 2025
a67f561
handle streaming for transcription endpoint
narengogi Oct 13, 2025
55de222
handle multople checks of the same kind in a hook
narengogi Oct 14, 2025
894a59d
support api key for bedrock
narengogi Aug 21, 2025
1652283
support api key for bedrock
narengogi Aug 21, 2025
78efe54
add null check
narengogi Aug 21, 2025
87a4323
simplify access
narengogi Oct 15, 2025
f5b8193
use invoke model to count tokens for anthropic through bedrock
narengogi Oct 15, 2025
5f00981
fix: package.json & package-lock.json to reduce vulnerabilities
snyk-bot Oct 16, 2025
53fa6ad
use invoke model to count tokens for anthropic through bedrock
narengogi Oct 16, 2025
2536d86
Merge branch 'main' into feat/cometapi
tensornull Oct 16, 2025
05f0550
feat: support claude code max plans on Portkey
siddharthsambharia-portkey Oct 16, 2025
f7692c2
Merge pull request #1377 from narengogi/chore/handle-multiple-checks-…
VisargD Oct 16, 2025
45e1a5d
Merge pull request #1364 from TensorNull/feat/cometapi
VisargD Oct 16, 2025
8c20287
chore: handle object response from pre request validator function
VisargD Oct 16, 2025
e28d34f
chore: minor cleanup
VisargD Oct 16, 2025
117a9ab
Merge branch 'main' into chore/handle-prerequest-validator-response
VisargD Oct 16, 2025
decd2d9
chore: cleanup the model pricing config update handling
VisargD Oct 16, 2025
62d61e4
Merge pull request #1382 from Portkey-AI/chore/handle-prerequest-vali…
VisargD Oct 21, 2025
d085ab3
Merge pull request #1379 from Portkey-AI/fix/bedrock-anthropic-count-…
VisargD Oct 21, 2025
1a5d236
Merge pull request #1367 from narengogi/feature/input-audio-vertex
VisargD Oct 21, 2025
d6f35aa
Merge pull request #1374 from miuosz/feature/forward-cache-control-in…
VisargD Oct 21, 2025
451e6d2
Merge remote-tracking branch 'upstream/main' into feature/ratelimits-…
narengogi Oct 21, 2025
ba11027
fix conf.example
narengogi Oct 21, 2025
c11f33a
fix falsy check in bedrock
narengogi Oct 21, 2025
3bae20d
migrate to v2 for cohere embed and chat
narengogi Oct 22, 2025
07bf56a
Merge remote-tracking branch 'upstream/main' into chore/bedrock-cleanup
narengogi Oct 22, 2025
ae6c326
make import conditional based on environment
narengogi Oct 22, 2025
d7c8349
add mistakenly removed code
narengogi Oct 22, 2025
b5bc77e
Merge pull request #1276 from narengogi/chore/bedrock-cleanup
VisargD Oct 22, 2025
2c12cd2
Merge pull request #1383 from narengogi/fix/falsy-check-bedrock
VisargD Oct 22, 2025
21c0b62
Merge pull request #1349 from narengogi/chore/parameters
VisargD Oct 22, 2025
43ee1d1
fix check for bearer roken
narengogi Oct 22, 2025
6e34a50
merge main into prefix-guardrail
VisargD Oct 22, 2025
cf8d8bf
Merge remote-tracking branch 'upstream/main' into chore/vertex-cleanup
narengogi Oct 22, 2025
2cfa553
Merge pull request #1350 from narengogi/chore/vertex-cleanup
VisargD Oct 22, 2025
f5b03dd
fix type issue
narengogi Oct 22, 2025
8488f6f
Merge pull request #1385 from narengogi/fix/anthropic-beta-type
VisargD Oct 22, 2025
e212e83
Merge pull request #1352 from narengogi/chore/azure-openai-cleanup
VisargD Oct 22, 2025
29e8841
Merge remote-tracking branch 'upstream/main' into chore/bedrock-api-k…
narengogi Oct 23, 2025
363b800
Merge pull request #1295 from narengogi/chore/bedrock-api-key-support
VisargD Oct 23, 2025
228ef33
Merge pull request #1376 from narengogi/fix/transcription-streaming
VisargD Oct 23, 2025
00d62f3
fix: update falsy check for currentContent in addPrefix function
VisargD Oct 23, 2025
dd61692
feat: add addPrefix handler with comprehensive tests for various mess…
VisargD Oct 23, 2025
fe4c69f
Merge pull request #1258 from Portkey-AI/prefix-guardrail
VisargD Oct 23, 2025
b51a53a
fix destructuring check
narengogi Oct 23, 2025
20b13c9
Merge pull request #1386 from narengogi/fix/destructuring
VisargD Oct 23, 2025
db90179
1.13.0
VisargD Oct 23, 2025
d56830b
Merge pull request #1387 from Portkey-AI/feat/release-1.13.0
VisargD Oct 23, 2025
005a323
Merge branch 'main' into feature/add-qualifire-integration
drorIvry Oct 23, 2025
aad95cb
handle malformed guardrails and add stack trace to chat completions h…
narengogi Oct 23, 2025
2b7eaa0
Merge pull request #1388 from narengogi/fix/handle-malformed-guardrails
VisargD Oct 23, 2025
35127b4
fix: add integrationDetails and virtualKeyDetails to constructConfigF…
VisargD Oct 24, 2025
a4fc4b4
Merge pull request #1391 from Portkey-AI/fix/casing-for-integration-v…
VisargD Oct 24, 2025
06ae963
Merge remote-tracking branch 'upstream/main' into feature/ratelimits-…
narengogi Oct 24, 2025
6c76601
add matterai provider
code-crusher Oct 25, 2025
f018877
Merge branch 'main' into feature/add-qualifire-integration
drorIvry Oct 26, 2025
dd11a0c
remove embeddings in matterai
code-crusher Oct 27, 2025
914769d
Add performance monitoring (prometheus for metrics and winston for lo…
narengogi Oct 27, 2025
cc36895
fix import
narengogi Oct 27, 2025
2733675
fix import
narengogi Oct 27, 2025
c8b018f
change variable name
narengogi Oct 27, 2025
1ece8e8
change variable name
narengogi Oct 27, 2025
1eebcf2
improvement: added reasoning_effort for grok
marsianin Oct 28, 2025
ad37797
improvement: added reasoning_effort for grok
marsianin Oct 28, 2025
2684a1e
Merge pull request #1311 from qualifire-dev/feature/add-qualifire-int…
VisargD Oct 28, 2025
a2c0ad4
Merge pull request #1396 from marsianin/marsianin/reasoning_effort-grok
VisargD Oct 28, 2025
128280c
Merge pull request #1316 from indranil786/main
VisargD Oct 28, 2025
421897e
Merge remote-tracking branch 'upstream/main' into feature/ratelimits-…
narengogi Oct 28, 2025
7a21955
fix: add role 'assistant' to chat completion stream chunk
siddharthsambharia-portkey Oct 30, 2025
6c7050d
computer use for google
narengogi Oct 30, 2025
e8e2eb4
rename the log Handler that is used to push logs to the portkey opens…
narengogi Oct 30, 2025
2a73170
Merge remote-tracking branch 'upstream/main' into feature/apm
narengogi Oct 30, 2025
95b82f2
remove error handling from chatComplete
code-crusher Oct 31, 2025
604fa7b
Merge branch 'main' into add_matterai_provider
code-crusher Oct 31, 2025
8851aee
Remove timeout parameter from PANW Prisma AIRS plugin
jroberts2600 Oct 29, 2025
82fd4cb
add newer parameters to respones
narengogi Nov 1, 2025
ccdaf19
add newer parameters to respones
narengogi Nov 1, 2025
a716a13
option 1: send in headers
narengogi Nov 3, 2025
ec4663b
option 1: send in stream chunk
narengogi Nov 3, 2025
cc21802
remove header based apporach
narengogi Nov 3, 2025
dfd5b2a
remove redundant change
narengogi Nov 3, 2025
0e2aa41
feat: use Portkey trace ID as AIRS AI Session ID for multi-turn conve…
jroberts2600 Nov 3, 2025
081d373
Merge pull request #1403 from narengogi/fix/add-newer-parameters-resp…
VisargD Nov 4, 2025
be7c604
Merge branch 'main' into snyk-fix-d95c1b1fe5fd3f5bfe7cc4f6853ee742
VisargD Nov 4, 2025
3fe230b
Merge pull request #1380 from Portkey-AI/snyk-fix-d95c1b1fe5fd3f5bfe7…
VisargD Nov 4, 2025
49f99f8
chore: fixes
sk-portkey Nov 4, 2025
eda1163
Merge branch 'main' into fix/ssrf_custom_host_validator
sk-portkey Nov 4, 2025
c26e722
chore: use env for conditional env fetch
sk-portkey Nov 4, 2025
cc0f76d
chore: semantic name update
sk-portkey Nov 4, 2025
c54cc34
fix: restore role 'assistant' in chat completion stream chunk
siddharthsambharia-portkey Nov 4, 2025
caee0ef
chore: code optimisations
sk-portkey Nov 4, 2025
6bf69a2
fix
siddharthsambharia-portkey Nov 4, 2025
303e20d
Merge branch 'main' into feat/claude-code-gateway
siddharthsambharia-portkey Nov 4, 2025
6e0b90c
handle sending hook results when streaming responses
narengogi Nov 4, 2025
3cec579
Refactor headers function in AnthropicAPIConfig for improved readability
siddharthsambharia-portkey Nov 4, 2025
749794c
Merge pull request #1400 from siddharthsambharia-portkey/fix/anthropi…
VisargD Nov 4, 2025
9912a7c
chore: handle error correctly
b4s36t4 Nov 4, 2025
32ba2e4
Merge branch 'main' of github.com:Portkey-AI/gateway into fix/batches…
b4s36t4 Nov 4, 2025
8c9bd77
Merge pull request #1369 from b4s36t4/fix/batches-error-handling
VisargD Nov 4, 2025
fd36c39
Add seed parameter to generationConfig
narengogi Nov 5, 2025
ac6fb10
Merge branch 'main' into feature/ratelimits-and-budgets
narengogi Nov 6, 2025
e347ef8
Merge pull request #1366 from Portkey-AI/feature/ratelimits-and-budgets
VisargD Nov 6, 2025
594185d
Merge pull request #1384 from narengogi/fix/cohere-v2-responses
VisargD Nov 6, 2025
80c2593
Merge pull request #1401 from narengogi/google-computer-use
VisargD Nov 6, 2025
781ca24
Merge branch 'main' into feature/apm
narengogi Nov 6, 2025
7921321
Merge pull request #1393 from GravityCloudAI/add_matterai_provider
VisargD Nov 6, 2025
235dfd4
Merge pull request #1398 from jroberts2600/feature/panw-prisma-airs-e…
VisargD Nov 6, 2025
63f6b09
Merge pull request #1394 from narengogi/feature/apm
VisargD Nov 6, 2025
65ff2fe
Merge pull request #1279 from arturfromtabnine/ar/vertex-ai-tool-cont…
VisargD Nov 6, 2025
992e069
Merge branch 'main' of github.com:Portkey-AI/gateway into feat/azure-…
b4s36t4 Nov 6, 2025
2486d35
fix: apply workload identity to azure-ai, cleanup and merge with late…
b4s36t4 Nov 6, 2025
47f7152
Merge pull request #1408 from b4s36t4/feat/azure-workload-identity
VisargD Nov 7, 2025
c085626
Merge branch 'main' into feature/add-support-vertex-ai-caching
narengogi Nov 7, 2025
d4dbabb
Merge pull request #1373 from miuosz/feature/add-support-vertex-ai-ca…
VisargD Nov 7, 2025
093cf32
Merge pull request #1381 from siddharthsambharia-portkey/feat/claude-…
VisargD Nov 7, 2025
5688b5b
chore: validate custom at multiple places
sk-portkey Nov 7, 2025
82e13fd
Merge branch 'main' into fix/ssrf_custom_host_validator
sk-portkey Nov 7, 2025
c3e1171
chore: remove redundant validation from request context
sk-portkey Nov 7, 2025
b5a7825
Merge pull request #1372 from Portkey-AI/fix/ssrf_custom_host_validator
VisargD Nov 7, 2025
fb287d9
fix: return Response instead of object, typescript
b4s36t4 Nov 7, 2025
59622b7
Merge pull request #1409 from b4s36t4/fix/bedrock-types
VisargD Nov 7, 2025
c9fe94d
fix: build errors
VisargD Nov 7, 2025
5aac66c
fix: add types and checks for builds
b4s36t4 Nov 7, 2025
0e66619
Merge pull request #1411 from b4s36t4/fix/types
VisargD Nov 7, 2025
b77ae1f
Merge pull request #1410 from Portkey-AI/fix/build-errors-07-nov
VisargD Nov 7, 2025
0b63c05
revert apm changes to avoid warninglogs
narengogi Nov 7, 2025
672a33c
update package lock
narengogi Nov 7, 2025
91f9958
Merge pull request #1412 from narengogi/fix/revert-apm-changes-to-avo…
VisargD Nov 7, 2025
e1f29d4
1.14.0
VisargD Nov 7, 2025
da1a1d0
Merge pull request #1413 from Portkey-AI/feat/release-1.14.0
VisargD Nov 7, 2025
1080b58
feat: add Z_AI provider and include in VALID_PROVIDERS
siddharthsambharia-portkey Nov 11, 2025
542f1e1
Merge branch 'main' into feat/z-ai-provider-support
siddharthsambharia-portkey Nov 11, 2025
f0504d1
Feat/fix-z-ai
siddharthsambharia-portkey Nov 12, 2025
88bd40f
Feat/fix-z-ai-2
siddharthsambharia-portkey Nov 12, 2025
cd2d70c
feat: expand audio format support in OPENAI_AUDIO_FORMAT_TO_VERTEX_MI…
roh26it Nov 11, 2025
bb44fe6
Merge pull request #642 from Portkey-AI/feat/provider-modal-labs
VisargD Nov 6, 2025
da34876
simplify openai base transform for chat complete
narengogi Nov 13, 2025
1ef3003
Feat/fix-z-ai-3
siddharthsambharia-portkey Nov 13, 2025
a627e55
Merge remote-tracking branch 'upstream/main' into chore/send-hook-res…
narengogi Nov 13, 2025
dcd1a6a
handle falsy check in vertex parameter mapping
narengogi Nov 13, 2025
ffd73e6
send empty usage object in message start chunk
narengogi Nov 13, 2025
ff72d07
Merge pull request #1416 from siddharthsambharia-portkey/feat/z-ai-pr…
VisargD Nov 13, 2025
65c088a
Merge branch 'main' into feat/provider-modal-labs
VisargD Nov 14, 2025
8e74fe3
Merge pull request #1419 from Portkey-AI/feat/provider-modal-labs
VisargD Nov 14, 2025
b4af798
Merge pull request #1424 from narengogi/fix/send-empty-usage-object-i…
VisargD Nov 14, 2025
af44869
Merge pull request #1422 from narengogi/fix/falsy-check-vertex
VisargD Nov 14, 2025
a740033
Merge pull request #1418 from Portkey-AI/chore/more-audio-types-vertex
VisargD Nov 14, 2025
1c9fdd2
fix: return null for empty tools in transformToolsConfig
siddharthsambharia-portkey Nov 14, 2025
69e18a9
update check to send hook results in streaming
narengogi Nov 14, 2025
6a76ee6
Merge pull request #1407 from narengogi/chore/send-hook-results-in-st…
VisargD Nov 14, 2025
6bb44a1
Merge pull request #1429 from siddharthsambharia-portkey/fix/hanle-em…
VisargD Nov 17, 2025
ac6ec22
Merge pull request #1420 from narengogi/fix/openai-chat-complete-base…
VisargD Nov 17, 2025
7a128da
simplify pr template
narengogi Nov 17, 2025
b6a75b1
update check to send hook results in streaming
narengogi Nov 17, 2025
2901085
add type of change to template
narengogi Nov 17, 2025
aa49b75
Merge pull request #1431 from Portkey-AI/simplify-pr-template
VisargD Nov 17, 2025
5d5369d
Auto add anthropic headers
ayush-portkey Nov 17, 2025
a5d1590
Add anthropicApiKey to request headers and update API configuration i…
narengogi Nov 18, 2025
9eda341
Apply suggestion from @Copilot
narengogi Nov 18, 2025
4c6e086
add anthropic-beta header without x-portkey prefix to provider option…
narengogi Nov 18, 2025
a738edd
Merge pull request #1435 from narengogi/fix/autoForwardAnthropicHeade…
narengogi Nov 18, 2025
d4b374b
Merge pull request #1433 from Portkey-AI/fix/autoForwardAnthropicHeaders
VisargD Nov 18, 2025
dfd145a
remove region identifier prefix when making request to count tokens e…
narengogi Nov 18, 2025
9435fe7
remove unused parameter
narengogi Nov 18, 2025
b6eedd3
Merge pull request #1436 from narengogi/fix/bedrock-count-tokens-igno…
VisargD Nov 18, 2025
64c725d
chore: merge branch 'main' into patched
jpulec Nov 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 7 additions & 28 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,14 @@
## Description
<!-- Provide a brief description of the changes in this PR -->
**Description:** (required)
- Detailed change 1
- Detailed change 2

## Motivation
<!-- Provide a brief motivation of why the changes in this PR are needed -->
**Tests Run/Test cases added:** (required)
- [ ] Description of test case

## Type of Change
**Type of Change:**
<!-- Put an 'x' in the boxes that apply -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Refactoring (no functional changes)

## How Has This Been Tested?
<!-- Describe the tests you ran to verify your changes -->
- [ ] Unit Tests
- [ ] Integration Tests
- [ ] Manual Testing

## Screenshots (if applicable)
<!-- Add screenshots to help explain your changes -->

## Checklist
<!-- Put an 'x' in the boxes that apply -->
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes

## Related Issues
<!-- Link related issues below. Insert the issue link or reference -->
- [ ] Refactoring (no functional changes)
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Local configuration file
conf.json

# Logs
logs
*.log
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ COPY package*.json ./
COPY patches ./

# Upgrade system packages
RUN apk update && apk upgrade --no-cache
RUN apk upgrade --no-cache

# Upgrade npm to version 10.9.2
RUN npm install -g npm@10.9.2
Expand All @@ -29,7 +29,7 @@ RUN npm run build \
FROM node:20-alpine

# Upgrade system packages
RUN apk update && apk upgrade --no-cache
RUN apk upgrade --no-cache

# Upgrade npm to version 10.9.2
RUN npm install -g npm@10.9.2
Expand Down
48 changes: 48 additions & 0 deletions conf.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"plugins_enabled": [
"default",
"portkey",
"aporia",
"sydelabs",
"pillar",
"patronus",
"pangea",
"promptsecurity",
"panw-prisma-airs",
"walledai"
],
"credentials": {
"portkey": {
"apiKey": "..."
}
},
"cache": false,
"integrations": [
{
"provider": "anthropic",
"slug": "dev_team_anthropic",
"credentials": {
"apiKey": "sk-ant-"
},
"rate_limits": [
{
"type": "requests",
"unit": "rph",
"value": 3
},
{
"type": "tokens",
"unit": "rph",
"value": 3000
}
],
"models": [
{
"slug": "claude-3-7-sonnet-20250219",
"status": "active",
"pricing_config": null
}
]
}
]
}
1 change: 1 addition & 0 deletions conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"plugins_enabled": [
"default",
"portkey",
"qualifire",
"aporia",
"sydelabs",
"pillar",
Expand Down
Empty file removed conf_sample.json
Empty file.
76 changes: 76 additions & 0 deletions initializeSettings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
export const defaultOrganisationDetails = {
id: 'self-hosted-organisation',
name: 'Portkey self hosted',
settings: {
debug_log: 1,
is_virtual_key_limit_enabled: 1,
allowed_guardrails: ['BASIC', 'PARTNER', 'PRO'],
},
workspaceDetails: {},
defaults: {
metadata: null,
},
usageLimits: [],
rateLimits: [],
organisationDefaults: {
input_guardrails: null,
},
};

const transformIntegrations = (integrations: any) => {
return integrations.map((integration: any) => {
return {
id: integration.slug, //need to do consistent hashing for caching
ai_provider_name: integration.provider,
model_config: {
...integration.credentials,
},
...(integration.credentials?.apiKey && {
key: integration.credentials.apiKey,
}),
slug: integration.slug,
usage_limits: null,
status: 'active',
integration_id: integration.slug,
object: 'virtual-key',
integration_details: {
id: integration.slug,
slug: integration.slug,
usage_limits: integration.usage_limits,
rate_limits: integration.rate_limits,
models: integration.models,
allow_all_models: integration.allow_all_models,
},
};
});
};

export const getSettings = async () => {
try {
const isFetchSettingsFromFile =
process?.env?.FETCH_SETTINGS_FROM_FILE === 'true';
if (!isFetchSettingsFromFile) {
return undefined;
}
let settings: any = undefined;
const { readFile } = await import('fs/promises');
const settingsFile = await readFile('./conf.json', 'utf-8');
const settingsFileJson = JSON.parse(settingsFile);

if (settingsFileJson) {
settings = {};
settings.organisationDetails = defaultOrganisationDetails;
if (settingsFileJson.integrations) {
settings.integrations = transformIntegrations(
settingsFileJson.integrations
);
}
return settings;
}
} catch (error) {
console.log(
'WARNING: unable to load settings from your conf.json file',
error
);
}
};
Loading
Loading