Skip to content

feat(sync): alibaba intl provider sync script#3081

Open
nathannli wants to merge 3 commits into
anomalyco:devfrom
nathannli:feat/alibaba-sync-clean
Open

feat(sync): alibaba intl provider sync script#3081
nathannli wants to merge 3 commits into
anomalyco:devfrom
nathannli:feat/alibaba-sync-clean

Conversation

@nathannli

@nathannli nathannli commented Jul 7, 2026

Copy link
Copy Markdown

#2121

Summary

  • add Alibaba sync script for international endpoint
  • goal is to only add the international sync script in this PR to keep changes small and easy to read
    • remaining sync scripts:
      1. china
      2. global
    • remaining additions for another PR to complete the international sync additions:
      • new base models

Sources

@nathannli nathannli changed the title feat(sync): alibaba provider sync script feat(sync): alibaba intl provider sync script Jul 8, 2026
@nathannli
nathannli force-pushed the feat/alibaba-sync-clean branch from edb96b1 to c19bb0f Compare July 10, 2026 16:36
@github-actions

Copy link
Copy Markdown
Contributor

No actionable findings.

@nathannli
nathannli force-pushed the feat/alibaba-sync-clean branch from c19bb0f to f7e465e Compare July 12, 2026 19:58
@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [medium] [possible mistake] packages/core/src/sync/providers/alibaba.ts:481 - Check: The cost() function never preserves existing cost.tiers from hand-authored TOMLs (const tiers = apiTiers.length > 0 ? apiTiers : undefined). Why: providers/alibaba/models/qwen3.6-plus.toml and qwen3.7-plus.toml currently carry hand-curated [[cost.tiers]] at size = 256_000. When the sync runs, if the DashScope international API returns only a single "Default" price range for these models (no "256k < Input" range), apiTiers is empty, tiers becomes undefined, and the hand-curated tier is silently deleted. The code comment asserts the API is the source of truth for tiers, but that claim depends on the API actually exposing tiered ranges for every model that has them. Action: Verify the DashScope international API (https://dashscope-intl.aliyuncs.com/api/v1/models) returns a tiered price range for qwen3.6-plus and qwen3.7-plus that maps to a 256K lower bound, or fall back to existing?.cost?.tiers when the API returns only a single range.

  • [low] [possible mistake] packages/core/src/sync/providers/alibaba.ts:454 - Check: The tier-building logic in cost() (parsing tierLowerBound, sorting ranges, emitting [[cost.tiers]] with size = lowerBound) has no test coverage. Why: The two added tests only exercise single-range (no-tier) pricing. Other sync providers (DigitalOcean, EmpirioLabs, Vercel) all include tests that assert cost.tiers output. Existing alibaba models have tiers that this sync will manage, so an incorrect tier transformation is a concrete regression risk that validation alone may not catch (e.g., wrong size, wrong base-vs-tier split). Action: Add a test that supplies a multi-range prices payload (e.g., a "Default" range plus a "256k < Input" range) and asserts the resulting cost.tiers structure.

@nathannli

nathannli commented Jul 12, 2026

Copy link
Copy Markdown
Author

[medium] [possible mistake] -> sync script removes the hand curated price tiers and replaces with the updated price tiers from the api. for cases where hand-curated tiers are will be deleted if the api returns a single range, i think the current api returned pricing should be the price authority rather than historical curated tiers.

@github-actions

Copy link
Copy Markdown
Contributor

No actionable findings.

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