3.3 KiB
3.3 KiB
Claude Code PowerShell Python App
A sophisticated PowerShell wrapper application that provides coding assistance in the style of Claude Code, using Qwen3-Coder models with support for both LM Studio server and direct model loading.
Files Created
lm_studio_client.py- Enhanced Python client script with Qwen3-Coder featureslm_studio.ps1- PowerShell wrapper scriptREADME.md- This documentation
Prerequisites
- Python 3.7+ installed and in PATH
- For LM Studio: LM Studio running with server enabled on http://127.0.0.1:1234
- For Qwen direct: transformers and torch libraries
- Python requests library (auto-installed by script)
- Optional: Flask for web interface
Usage
PowerShell Commands:
List available models (LM Studio only):
.\lm_studio.ps1 -ListModels
Single prompt:
.\lm_studio.ps1 -Prompt "Write a Python function to sort a list"
Interactive chat mode:
.\lm_studio.ps1 -Interactive
With specific language focus:
.\lm_studio.ps1 -Interactive -Language python
Using Qwen direct model:
.\lm_studio.ps1 -Client qwen -Prompt "Hello"
Fill-in-the-middle code completion:
.\lm_studio.ps1 -Client qwen -FimPrefix "def sort_list(arr):" -FimSuffix "return sorted_arr"
Start web interface:
.\lm_studio.ps1 -Web -Port 8080
Start terminal user interface:
.\lm_studio.ps1 -Tui
Direct Python Usage:
python lm_studio_client.py --help
python lm_studio_client.py --client qwen --prompt "Create a REST API"
python lm_studio_client.py --interactive
python lm_studio_client.py --client qwen --fim-prefix "def hello():" --fim-suffix "print('world')"
python lm_studio_client.py --web --port 5000
python lm_studio_client.py --tui
Features
- Dual Client Support: LM Studio server or direct Qwen3-Coder model loading
- Interactive Chat: Real-time conversation with the AI coding assistant
- Terminal User Interface: Curses-based TUI for interactive chat
- Fill-in-the-Middle: Advanced code completion for partial code snippets
- Language-Specific Assistance: Focus on specific programming languages
- Web Interface: Modern web UI with tabs for different features
- Model Selection: Choose from available models
- Auto-Dependency Installation: Automatically installs required Python packages
- Error Handling: Robust error handling and validation
Qwen3-Coder Features
- Agentic Coding: Advanced coding capabilities with tool use
- Long Context: Support for up to 256K tokens
- 358 Programming Languages: Comprehensive language support
- Fill-in-the-Middle: Specialized code completion
- Function Calling: Tool integration capabilities
Setup
- For LM Studio: Ensure LM Studio is running with server enabled
- For Qwen direct: Install transformers:
pip install transformers torch - For web interface: Install Flask:
pip install flask - Run the PowerShell script from the same directory
- The script will auto-install required Python dependencies
Web Interface
The web interface provides three main tabs:
- Chat: Interactive conversation with the AI
- Fill-in-the-Middle: Code completion for partial snippets
- Code Assistant: Generate code from descriptions
Access at http://localhost:5000 (or custom port)