Skip to content
Closed

Dev #38

Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
package-lock.json
.DS_Store
27 changes: 27 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh

# Get staged JSON files in pricing/ and general/
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '^(pricing|general)/.*\.json$')

if [ -z "$STAGED_FILES" ]; then
exit 0
fi

echo "Checking JSON files with Prettier..."

# Check if prettier is available
if ! command -v npx &> /dev/null; then
echo "❌ npx not found. Please run 'npm install' first."
exit 1
fi

# Run prettier check on staged files
echo "$STAGED_FILES" | xargs npx prettier --check

if [ $? -ne 0 ]; then
echo ""
echo "❌ Prettier found formatting issues. Run 'npm run lint:fix' to fix them."
exit 1
fi

echo "✓ All JSON files are properly formatted."
10 changes: 10 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"semi": true,
"tabWidth": 2,
"printWidth": 80,
"endOfLine": "lf",
"singleQuote": true,
"arrowParens": "always",
"bracketSpacing": true,
"trailingComma": "es5"
}
21 changes: 19 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,27 @@ Thank you for your interest in contributing to the Portkey Models repository! Th

1. **Fork** this repository
2. **Clone** your fork locally
3. Make your changes
4. **Test** your changes (validate JSON)
3. **Install dependencies** — this automatically sets up pre-commit hooks
```bash
npm install
```
4. Make your changes
5. **Submit** a pull request

### Pre-commit Hook

Running `npm install` automatically sets up a pre-commit hook that validates JSON files in `pricing/` and `general/` directories using Prettier.

If the hook finds formatting issues, fix them with:
```bash
npm run lint:fix
```

To manually check formatting:
```bash
npm run lint
```

## Types of Contributions

| Contribution | Directory | Description |
Expand Down
35 changes: 30 additions & 5 deletions general/ai21.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,39 @@
"description": "ai21 labs",
"default": {
"params": [
{ "key": "max_tokens", "defaultValue": 256, "minValue": 1, "maxValue": 8192 },
{ "key": "temperature", "defaultValue": 0.7, "minValue": 0, "maxValue": 1 },
{ "key": "stop", "defaultValue": null, "type": "array-of-strings", "skipValues": [null, []] },
{
"key": "max_tokens",
"defaultValue": 256,
"minValue": 1,
"maxValue": 8192
},
{
"key": "temperature",
"defaultValue": 0.7,
"minValue": 0,
"maxValue": 1
},
{
"key": "stop",
"defaultValue": null,
"type": "array-of-strings",
"skipValues": [null, []]
},
{ "key": "top_p", "defaultValue": 1, "minValue": 0, "maxValue": 1 },
{ "key": "top_k", "defaultValue": 1, "minValue": 0, "maxValue": 1 },
{ "key": "n", "defaultValue": 1, "minValue": 1, "maxValue": 10 },
{ "key": "frequency_penalty", "defaultValue": 0, "minValue": 0, "maxValue": 500 },
{ "key": "presence_penalty", "defaultValue": 0, "minValue": 0, "maxValue": 5 },
{
"key": "frequency_penalty",
"defaultValue": 0,
"minValue": 0,
"maxValue": 500
},
{
"key": "presence_penalty",
"defaultValue": 0,
"minValue": 0,
"maxValue": 5
},
{ "key": "stream", "defaultValue": true, "type": "boolean" }
],
"messages": { "options": ["system", "user", "assistant"] },
Expand Down
56 changes: 25 additions & 31 deletions general/anthropic.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,26 @@
"description": "",
"default": {
"params": [
{ "key": "max_tokens", "defaultValue": 256, "minValue": 1, "maxValue": 4096 },
{ "key": "temperature", "defaultValue": 0.7, "minValue": 0, "maxValue": 1 },
{
"key": "max_tokens",
"defaultValue": 256,
"minValue": 1,
"maxValue": 4096
},
{
"key": "temperature",
"defaultValue": 0.7,
"minValue": 0,
"maxValue": 1
},
{ "key": "top_p", "defaultValue": 1, "minValue": 0, "maxValue": 1 },
{ "key": "top_k", "defaultValue": 0, "minValue": 0, "maxValue": 100 },
{ "key": "stop", "defaultValue": null, "type": "array-of-strings", "skipValues": [null, []] },
{
"key": "stop",
"defaultValue": null,
"type": "array-of-strings",
"skipValues": [null, []]
},
{ "key": "stream", "defaultValue": true, "type": "boolean" },
{
"key": "tool_choice",
Expand Down Expand Up @@ -287,10 +302,7 @@
}
],
"type": { "primary": "chat", "supported": ["image", "tools"] },
"removeParams": [
"temperature",
"top_p"
]
"removeParams": ["temperature", "top_p"]
},
"claude-opus-4-1": {
"params": [
Expand All @@ -314,10 +326,7 @@
}
],
"type": { "primary": "chat", "supported": ["image", "tools"] },
"removeParams": [
"temperature",
"top_p"
]
"removeParams": ["temperature", "top_p"]
},
"claude-sonnet-4-5-20250929": {
"params": [
Expand Down Expand Up @@ -389,10 +398,7 @@
}
],
"type": { "primary": "chat", "supported": ["image", "tools"] },
"removeParams": [
"temperature",
"top_p"
]
"removeParams": ["temperature", "top_p"]
},
"claude-opus-4-5-20251101": {
"params": [
Expand All @@ -416,10 +422,7 @@
}
],
"type": { "primary": "chat", "supported": ["image", "tools"] },
"removeParams": [
"temperature",
"top_p"
]
"removeParams": ["temperature", "top_p"]
},
"claude-3-opus-latest": {
"params": [
Expand All @@ -443,10 +446,7 @@
}
],
"type": { "primary": "chat", "supported": ["image", "tools"] },
"removeParams": [
"temperature",
"top_p"
]
"removeParams": ["temperature", "top_p"]
},
"claude-4-opus-20250514": {
"params": [
Expand All @@ -470,10 +470,7 @@
}
],
"type": { "primary": "chat", "supported": ["image", "tools"] },
"removeParams": [
"temperature",
"top_p"
]
"removeParams": ["temperature", "top_p"]
},
"claude-sonnet-4-5": {
"params": [
Expand All @@ -497,9 +494,6 @@
}
],
"type": { "primary": "chat", "supported": ["image", "tools"] },
"removeParams": [
"temperature",
"top_p"
]
"removeParams": ["temperature", "top_p"]
}
}
21 changes: 18 additions & 3 deletions general/anyscale.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,26 @@
"description": "",
"default": {
"params": [
{ "key": "max_tokens", "defaultValue": 256, "minValue": 1, "maxValue": 4096 },
{ "key": "temperature", "defaultValue": 0.7, "minValue": 0, "maxValue": 2 },
{
"key": "max_tokens",
"defaultValue": 256,
"minValue": 1,
"maxValue": 4096
},
{
"key": "temperature",
"defaultValue": 0.7,
"minValue": 0,
"maxValue": 2
},
{ "key": "top_p", "defaultValue": 1, "minValue": 0, "maxValue": 1 },
{ "key": "n", "defaultValue": 1, "minValue": 1, "maxValue": 10 },
{ "key": "stop", "defaultValue": null, "type": "array-of-strings", "skipValues": [null, []] },
{
"key": "stop",
"defaultValue": null,
"type": "array-of-strings",
"skipValues": [null, []]
},
{ "key": "stream", "defaultValue": true, "type": "boolean" },
{
"key": "tool_choice",
Expand Down
Loading
Loading