Skip to content

feat: add cost-aware vision routing example - #75

Closed
z116123123x wants to merge 1 commit into
zai-org:mainfrom
z116123123x:vision-routing-example
Closed

feat: add cost-aware vision routing example#75
z116123123x wants to merge 1 commit into
zai-org:mainfrom
z116123123x:vision-routing-example

Conversation

@z116123123x

Copy link
Copy Markdown

What

Adds examples/vision_routing_example.py demonstrating covered-first vision routing for Z.ai GLM models.

Why

Current README examples only use glm-5v-turbo (the paid model). Users with $0 cash balance hit HTTP 429 / 1113 Insufficient balance with no guidance that the covered (free) glm-4.6v route exists.

This example shows:

  • Default covered-first routing (free model)
  • Opt-in cash fallback with ZAI_VISION_ALLOW_CASH=1
  • Per-run cost guard via ZAI_VISION_CASH_MAX_CALLS_PER_RUN
  • Refusal detection and retry logic

Verification

  • python examples/vision_routing_example.py runs standalone (no external deps)
  • 100 lines, follows existing example style

@z116123123x
z116123123x force-pushed the vision-routing-example branch from f825d82 to c4e9ab1 Compare July 9, 2026 03:17
@z116123123x

Copy link
Copy Markdown
Author

Closing this while I restart the contribution assessment from scratch. I want to re-evaluate the upstream scope and implementation before deciding whether to submit a new pull request. Thank you.

@z116123123x
z116123123x deleted the vision-routing-example branch July 14, 2026 07:18
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