Feat/pi local qwen wrappers - #1079
Conversation
…ations Entire-Checkpoint: 2a5de31827fd
Entire-Checkpoint: 02ec3d483251
…model Entire-Checkpoint: be2b1fb66e85
…ions Entire-Checkpoint: 427cf695a047
…ngs configurations Entire-Checkpoint: 5b4f227bc05a
|
You do not have enough credits to review this pull request. Please purchase more credits to continue. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (24)
Disabled knowledge base sources:
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis pull request renames the "cli-proxy-api" provider to "cliproxyapi", updates GLM-4.7 preset identifiers, adds a new "lmstudio" provider for local Qwen 3.5 models, and introduces new Fish shell functions to access the local Qwen model alongside updates to existing model-related functions and comprehensive test coverage. Changes
Sequence DiagramsequenceDiagram
participant User
participant ShellFunction as Shell Function<br/>(_pixe / _pixel)
participant PiTool as Pi Tool
participant Providers as Providers
User->>ShellFunction: Invoke command with optional prompt
ShellFunction->>ShellFunction: Parse arguments
alt Existing Flow (OpenRouter)
ShellFunction->>PiTool: pi --model 'cliproxyapi/glm-4.7' [prompt]
PiTool->>Providers: Route to cliproxyapi provider
Providers-->>PiTool: GLM-4.7 response
else New Flow (Local Qwen)
ShellFunction->>PiTool: pi --model 'lmstudio/qwen/qwen3.5-9b' [prompt]
PiTool->>Providers: Route to lmstudio provider
Providers-->>PiTool: Qwen response
end
PiTool-->>ShellFunction: Output
ShellFunction-->>User: Display result
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Mesa DescriptionTL;DRAdded local wrappers for Qwen, likely for Raspberry Pi integration. What changed?File summaries were not provided, so a detailed list of changes by file cannot be given. Description generated by Mesa. Update settings |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the system's capability by integrating local Qwen models through LM Studio, providing users with more flexible and private AI interaction options. It also refactors existing command-line interfaces for improved consistency and maintainability, ensuring a smoother user experience with both local and remote models. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds support for a local Qwen model via LM Studio, introducing new pixel and pixelh fish commands. The changes include configuration updates, new wrapper scripts, and corresponding tests. The PR also refactors existing pi wrappers to use the cliproxyapi provider and switches from pi-agent to the pi command. The changes are applied consistently. My review includes one suggestion to address code duplication in the fish wrapper functions to improve long-term maintainability.
| function _pixel_function --description "Run Pi with a free-form prompt using the local Qwen model" | ||
| # Run Pi with a free-form prompt (spaces allowed) using the local Qwen model | ||
| # Usage: pixel [<prompt words...>] | ||
|
|
||
| if test (count $argv) -eq 0 | ||
| pi --model 'lmstudio/qwen/qwen3.5-9b' | ||
| else | ||
| set -l prompt (string join " " -- $argv) | ||
| pi --model 'lmstudio/qwen/qwen3.5-9b' "$prompt" | ||
| end | ||
| end |
There was a problem hiding this comment.
This function is almost identical to _pixe_function, with the only difference being the model string. Similarly, the new _pixelh_function is very similar to _pixeh_function. This introduces code duplication. To improve maintainability, consider creating helper functions.
For example, you could have a helper for interactive prompts:
# in a new helper function, e.g. _pi_interactive_wrapper.fish
function _pi_interactive_wrapper
set -l model $argv[1]
set -l prompt_args $argv[2..-1]
if test (count $prompt_args) -eq 0
pi --model "$model"
else
set -l prompt (string join " " -- $prompt_args)
pi --model "$model" "$prompt"
end
endThen _pixel_function could be simplified to:
function _pixel_function --description "Run Pi with a free-form prompt using the local Qwen model"
_pi_interactive_wrapper 'lmstudio/qwen/qwen3.5-9b' $argv
endA similar helper could be created for the headless (-h) functions. This would make the code DRYer and easier to manage when adding more model wrappers in the future.
There was a problem hiding this comment.
Pull request overview
This PR extends the repo’s LLM tooling/templates to support a local LM Studio Qwen model in Pi, and updates fish wrappers/config templates to use the pi CLI with cliproxyapi models instead of the older pi-agent/OpenRouter preset flow.
Changes:
- Add
pixel/pixelhfish wrapper functions (template + generated) targetinglmstudioQwen, plus fishtape coverage. - Update existing
pixe/pixehwrappers (template + generated) to callpi --model cliproxyapi/...(and print mode for headless). - Update Pi/OpenCode config templates to use
cliproxyapinaming, addlmstudioprovider/models, and switch to placeholder-based preset IDs.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| spec/llm_update_spec.sh | Updates llm-update mapping coverage assertions for fish templates. |
| scripts/llm-update.sh | Adds template→output mappings for new pixel/pixelh fish functions. |
| home-manager/programs/fish/default.nix | Registers pixel/pixelh abbreviations and includes new functions in the managed set. |
| home-manager/programs/fish/functions/_pixel_function.tpl.fish | New template function to run Pi using the local LM Studio Qwen model. |
| home-manager/programs/fish/functions/_pixel_function.fish | Generated concrete pixel function using lmstudio/qwen/qwen3.5-9b. |
| home-manager/programs/fish/functions/_pixelh_function.tpl.fish | New template headless Pi function using the local LM Studio Qwen model. |
| home-manager/programs/fish/functions/_pixelh_function.fish | Generated concrete pixelh function using lmstudio/qwen/qwen3.5-9b with print mode. |
| home-manager/programs/fish/functions/_pixe_function.tpl.fish | Migrates pixe template from pi-agent preset to pi --model cliproxyapi/__GLM__. |
| home-manager/programs/fish/functions/_pixe_function.fish | Generated concrete pixe function using cliproxyapi/glm-4.7. |
| home-manager/programs/fish/functions/_pixeh_function.tpl.fish | Migrates pixeh template to pi --model cliproxyapi/__GLM__ -p. |
| home-manager/programs/fish/functions/_pixeh_function.fish | Generated concrete pixeh function using cliproxyapi/glm-4.7 with print mode. |
| spec/fish/_pixel_function.tpl_test.fish | New fishtape tests for pixel template behavior and placeholder usage. |
| spec/fish/_pixel_function_test.fish | New fishtape tests for generated pixel behavior. |
| spec/fish/_pixelh_function.tpl_test.fish | New fishtape tests for pixelh template behavior and placeholder usage. |
| spec/fish/_pixelh_function_test.fish | New fishtape tests for generated pixelh behavior. |
| spec/fish/_pixe_function.tpl_test.fish | Updates pixe template test to stub pi and assert cliproxyapi/__GLM__. |
| spec/fish/_pixe_function_test.fish | Updates pixe generated test to stub pi and assert cliproxyapi/glm-4.7. |
| spec/fish/_pixeh_function.tpl_test.fish | Extends pixeh template tests to assert prompt forwarding/model/print mode. |
| spec/fish/_pixeh_function_test.fish | Extends pixeh generated tests similarly. |
| config/pi/settings.tpl.json | Switches default provider to cliproxyapi and enables lmstudio/* + *qwen*. |
| config/pi/settings.json | Generated settings reflecting the new provider and enabled model patterns. |
| config/pi/models.tpl.json | Renames provider key to cliproxyapi, uses __GLM_NONDOT__, and adds an lmstudio provider/model placeholder. |
| config/pi/models.json | Generated models reflecting the renamed provider and new lmstudio model. |
| config/opencode/opencode.tpl.jsonc | Uses @preset/__GLM_NONDOT__ for the OpenRouter preset model id. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| When run bash -c "grep '_ocxe_function.tpl.fish' '$SCRIPT' && grep '_pixe_function.tpl.fish' '$SCRIPT' && grep '_pixel_function.tpl.fish' '$SCRIPT'" | ||
| The output should include '_ocxe_function.tpl.fish' | ||
| The output should include '_pixe_function.tpl.fish' | ||
| The output should include '_pixel_function.tpl.fish' |
| }, | ||
| "lmstudio": { | ||
| "baseUrl": "http://127.0.0.1:1234/v1", | ||
| "apiKey": "LM_API_TOKEN", |
Summary by cubic
Adds local Qwen 3.5 9B support via LM Studio and new fish commands pixel/pixelh for Pi. Also switches Pi wrappers to the
cliproxyapiprovider and updates configs and tests.New Features
lmstudioprovider (OpenAI-compatible at 127.0.0.1:1234) with Qwen 3.5 9B.pixel(interactive) andpixelh(print mode) to run Pi on the local Qwen model.Refactors
cli-proxy-apitocliproxyapi; set as default and enabledlmstudio/*and*qwen*in settings.pi-agentwithpiand switched models from presets tocliproxyapi/glm-4.7(templated__GLM__).@preset/__GLM_NONDOT__.scripts/llm-update.sh.Written for commit d98f8c1. Summary will update on new commits.