Skip to content

Instantly share code, notes, and snippets.

@aliou
Last active April 3, 2026 21:42
Show Gist options
  • Select an option

  • Save aliou/4ff85c404a61f05db3cad5f1f17bc475 to your computer and use it in GitHub Desktop.

Select an option

Save aliou/4ff85c404a61f05db3cad5f1f17bc475 to your computer and use it in GitHub Desktop.
Synthetic examples for using custom models in Pi
{
"providers": {
"synthetic": {
"baseUrl": "https://api.synthetic.new/openai/v1",
"apiKey": "SYNTHETIC_API_KEY",
"api": "openai-completions",
"compat": {
"supportsDeveloperRole": false,
"supportsReasoningEffort": true,
"reasoningEffortMap": {
"minimal": "low",
"low": "low",
"medium": "medium",
"high": "high",
"xhigh": "high"
}
},
"models": [
{
"id": "hf:zai-org/GLM-5",
"reasoning": true,
"maxTokens": 65536
},
{
"id": "hf:moonshotai/Kimi-K2.5",
"reasoning": true,
"input": ["text", "image"],
"maxTokens": 65536
},
{
"id": "hf:nvidia/Kimi-K2.5-NVFP4",
"reasoning": true,
"input": ["text", "image"],
"maxTokens": 65536
},
{
"id": "hf:MiniMaxAI/MiniMax-M2.5",
"reasoning": true,
"maxTokens": 65536
},
{
"id": "hf:zai-org/GLM-4.7-Flash",
"reasoning": true,
"maxTokens": 65536
},
{
"id": "hf:nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-NVFP4",
"reasoning": true,
"maxTokens": 65536
},
{
"id": "hf:zai-org/GLM-4.7",
"reasoning": true,
"maxTokens": 65536
}
]
}
}
}
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
// [!code fold:start] reasoning effort map
const REASONING_EFFORT_MAP = {
minimal: "low",
low: "low",
medium: "medium",
high: "high",
xhigh: "high",
} as const;
// [!code fold:end]
export default function (pi: ExtensionAPI) {
pi.registerProvider("synthetic", {
baseUrl: "https://api.synthetic.new/openai/v1",
apiKey: "SYNTHETIC_API_KEY",
api: "openai-completions",
// [!code fold:start] model definitions
models: [
{
id: "hf:zai-org/GLM-5",
name: "zai-org/GLM-5",
reasoning: true,
input: ["text"],
cost: {
input: 1,
output: 6,
cacheRead: 1,
cacheWrite: 0,
},
contextWindow: 196608,
maxTokens: 65536,
compat: {
supportsDeveloperRole: false,
supportsReasoningEffort: true,
reasoningEffortMap: REASONING_EFFORT_MAP,
},
},
{
id: "hf:moonshotai/Kimi-K2.5",
name: "moonshotai/Kimi-K2.5",
reasoning: true,
input: ["text", "image"],
cost: {
input: 0.45,
output: 3.4,
cacheRead: 0.45,
cacheWrite: 0,
},
contextWindow: 262144,
maxTokens: 65536,
compat: {
supportsDeveloperRole: false,
supportsReasoningEffort: true,
reasoningEffortMap: REASONING_EFFORT_MAP,
},
},
{
id: "hf:nvidia/Kimi-K2.5-NVFP4",
name: "nvidia/Kimi-K2.5-NVFP4",
reasoning: true,
input: ["text", "image"],
cost: {
input: 0.45,
output: 3.4,
cacheRead: 0.45,
cacheWrite: 0,
},
contextWindow: 262144,
maxTokens: 65536,
compat: {
supportsDeveloperRole: false,
supportsReasoningEffort: true,
reasoningEffortMap: REASONING_EFFORT_MAP,
},
},
{
id: "hf:MiniMaxAI/MiniMax-M2.5",
name: "MiniMaxAI/MiniMax-M2.5",
reasoning: true,
input: ["text"],
cost: {
input: 0.4,
output: 2,
cacheRead: 0.4,
cacheWrite: 0,
},
contextWindow: 191488,
maxTokens: 65536,
compat: {
supportsDeveloperRole: false,
supportsReasoningEffort: true,
reasoningEffortMap: REASONING_EFFORT_MAP,
},
},
{
id: "hf:zai-org/GLM-4.7-Flash",
name: "zai-org/GLM-4.7-Flash",
reasoning: true,
input: ["text"],
cost: {
input: 0.1,
output: 0.5,
cacheRead: 0.1,
cacheWrite: 0,
},
contextWindow: 196608,
maxTokens: 65536,
compat: {
supportsDeveloperRole: false,
supportsReasoningEffort: true,
reasoningEffortMap: REASONING_EFFORT_MAP,
},
},
{
id: "hf:nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-NVFP4",
name: "nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-NVFP4",
reasoning: true,
input: ["text"],
cost: {
input: 0.3,
output: 1,
cacheRead: 0.3,
cacheWrite: 0,
},
contextWindow: 262144,
maxTokens: 65536,
compat: {
supportsDeveloperRole: false,
supportsReasoningEffort: true,
reasoningEffortMap: REASONING_EFFORT_MAP,
},
},
{
id: "hf:zai-org/GLM-4.7",
name: "zai-org/GLM-4.7",
reasoning: true,
input: ["text"],
cost: {
input: 0.45,
output: 2.19,
cacheRead: 0.45,
cacheWrite: 0,
},
contextWindow: 202752,
maxTokens: 65536,
compat: {
supportsDeveloperRole: false,
supportsReasoningEffort: true,
reasoningEffortMap: REASONING_EFFORT_MAP,
},
},
],
// [!code fold:end]
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment