Repository navigation
feat(llm): child tenants keep their own copy of Root-shared model prices (F005) - #2885
Merged
Merged
Conversation
A child tenant now gets a copy of Root's price when a Root provider is first shared with it (mount, share list, or a new model on a shared provider). The child admin can edit the copy. Billing, credit ratios and the price table read only the child's copy and never fall back to Root. Unsharing keeps the copy; sharing again copies only missing prices. - New table llm_model_tenant_pricing (DDL-only Alembic revision). - initialize_shared_models adds the price copy next to the default visibility at every new-receiver path. - snapshot_child_model_defaults.py also copies missing prices and lists Root models that have no price. Spec F005 §2.5 (AC-24 to AC-30), design decisions 10 to 14. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改动
F005 追加需求(spec §2.5,AC-24–AC-30):Root 共享给子租户的模型,在首次共享时按 Root 当时的价格给子租户复制一份,之后子租户管理员自己维护,与 Root 不再同步。
llm_model_tenant_pricing(Alembic 只做 DDL)。initialize_shared_models同时补默认可见范围和价格副本,只补缺失。scripts/snapshot_child_model_defaults.py增加价格步骤:给子租户补缺失的价格副本,列出 Root 本身缺价的模型。升级
alembic upgrade head后重新执行一次python scripts/snapshot_child_model_defaults.py --operator-user-id <id> --apply(见features/v3.1.0/005-tenant-model-share-snapshot/upgrade.md)。验证
相关 38 个测试文件在本分支与主检出上的失败集合相同(13 个均为已有失败),新增测试全部通过;ruff、arch-guard 通过。
🤖 Generated with Claude Code