Repository navigation
feat(models): add GLM-4.7 model support via OpenRouter #580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
4f5d802
15a38fa
3238df8
8cf0c6b
527e8b3
be5391e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -142,8 +142,8 @@ | |||||
| "maxTokens": 8192 | ||||||
| }, | ||||||
| { | ||||||
| "id": "z-ai/glm-4.7", | ||||||
| "name": "GLM-4.7 (Z-AI)", | ||||||
| "id": "z-ai/glm-4-7", | ||||||
| "name": "glm-4-7 (Z-AI)", | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For consistency with other model names in this file (e.g.,
Suggested change
|
||||||
| "reasoning": false, | ||||||
| "input": [ | ||||||
| "text" | ||||||
|
|
@@ -174,6 +174,29 @@ | |||||
| "maxTokens": 16384 | ||||||
| } | ||||||
| ] | ||||||
| }, | ||||||
| "openrouter-preset": { | ||||||
| "baseUrl": "https://openrouter.ai/api/v1", | ||||||
| "apiKey": "OPENROUTER_API_KEY", | ||||||
| "api": "openai-completions", | ||||||
| "models": [ | ||||||
| { | ||||||
| "id": "@preset/glm-4-7", | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The model ID uses the Prompt for Agent |
||||||
| "name": "GLM-4.7 (Z-AI)", | ||||||
| "reasoning": false, | ||||||
| "input": [ | ||||||
| "text" | ||||||
| ], | ||||||
| "cost": { | ||||||
| "input": 0, | ||||||
| "output": 0, | ||||||
| "cacheRead": 0, | ||||||
| "cacheWrite": 0 | ||||||
| }, | ||||||
| "contextWindow": 131072, | ||||||
| "maxTokens": 16384 | ||||||
| } | ||||||
| ] | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -88,6 +88,8 @@ | |||||
| kyberm = "_kyberm_function"; | ||||||
| ocxe = "_ocxe_function"; | ||||||
| ocxeh = "_ocxeh_function"; | ||||||
| pixe = "_pixe_function"; | ||||||
| pixeh = "_pixeh_function"; | ||||||
| sag = "_ssh_add_github"; | ||||||
| shortcuts = "_fish_shortcuts"; | ||||||
| zdo = "_zdo_function"; | ||||||
|
|
@@ -149,6 +151,10 @@ | |||||
| "_dev_function" | ||||||
| "_ocxe_function" | ||||||
| "_ocxeh_function" | ||||||
| "_pilxe_function" | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These function references ( Prompt for Agent
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: xdg.configFile installs Fish functions Prompt for AI agents |
||||||
| "_pilxeh_function" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||
| "_pilxe_function" | |
| "_pilxeh_function" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| function _pixe_function --description "Run Pi agent with GLM-4.7 via OpenRouter" | ||
| # Run Pi agent with a free-form prompt (spaces allowed) using GLM-4.7 | ||
| # Usage: pixe [<prompt words...>] | ||
|
|
||
| if test (count $argv) -eq 0 | ||
| pi-agent -m 'openrouter-preset/@preset/glm-4-7' | ||
|
||
| else | ||
| set -l prompt (string join " " -- $argv) | ||
| pi-agent "$prompt" -m 'openrouter-preset/@preset/glm-4-7' | ||
|
||
| end | ||
|
Comment on lines
+5
to
+10
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To improve maintainability and avoid duplicating the model identifier string, it's a good practice to define it as a local variable. This makes it easier to update in the future if needed. |
||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| function _pixeh_function --description "Run Pi agent headlessly with GLM-4.7" | ||
| # Prompt for input and run Pi agent | ||
| # Usage: pixeh | ||
|
|
||
| read -P "Prompt: " prompt | ||
| if test -z "$prompt" | ||
| echo "No prompt provided, aborting." >&2 | ||
| return 1 | ||
| end | ||
|
|
||
| pi-agent "$prompt" -m 'openrouter-preset/@preset/glm-4-7' | ||
|
Comment on lines
+10
to
+11
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| end | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This model ID change from
z-ai/glm-4.7toz-ai/glm-4-7(dot to hyphen) should be carefully verified. If this is correcting a typo to match OpenRouter's actual model identifier, that's fine. However, if existing configurations or scripts reference the old IDz-ai/glm-4.7, they will break. Consider checking for any hardcoded references to the old model ID.Agent: 🏛 Architecture •
• 
Prompt for Agent