Skip to content

Conversation

@dpshade
Copy link

@dpshade dpshade commented Oct 23, 2025

Hey 👋 , thanks for creating and maintaining this minimalistic LLM tool!

This pull request adds support for Z.AI's coding plan models while maintaining the tool's lightweight ethos and original defaults. Users can now use GLM models optimized for coding tasks.

Changes Made

  • Add Z.AI model shortcuts: -a for GLM-4.5-air (fastest), -z for GLM-4.6 (advanced)
  • Preserve original default: Keeps qwen/qwen3-235b-a22b-2507:nitro as default
  • Auto-detect Z.AI endpoint: Uses ZAI_BASE_URL env var, falls back to OpenRouter
  • Zero breaking changes: Full backward compatibility maintained

Z.AI Usage

# Configure Z.AI (once)
export ZAI_BASE_URL="https://api.z.ai/api/coding/paas/v4"
export OPENROUTER_API_KEY="your-zai-api-key"

# Use Z.AI models
ask -a "Write a Python function"        # Uses GLM-4.5-air (fast)
ask -z "Explain this algorithm"         # Uses GLM-4.6 (advanced)

# Original behavior unchanged
ask "Quick question"                    # Still uses qwen by default

OpenRouter Compatibility

Original functionality is completely preserved - when ZAI_BASE_URL is not set, the tool works exactly as before with all original models and defaults.

Why This Change

Z.AI's coding plan offers excellent performance for coding tasks, and GLM-4.5-air is particularly fast for quick command generation and code snippets. The implementation adds only 12 lines while maintaining the minimalistic approach and zero breaking changes.

- Add GLM-4.5-air as fastest default model
- Add GLM-4.6 with -z flag
- Auto-detect Z.AI endpoint via ZAI_BASE_URL env var
- Maintain full OpenRouter compatibility
- Zero breaking changes, preserves lightweight ethos
Remove duplicate -a and -z flag descriptions in help text
Keep qwen/qwen3-235b-a22b-2507:nitro as default to maintain
backward compatibility. Z.AI models available via -a and -z flags.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant