Repository navigation
v0.7.0
·
3 commits
to release/0.7
since this release
Feature
- New
modelscope_hub.kernelspackage: load optimized compute kernels from ModelScope mirrors —get_kernel,get_kernel_variants,has_kernel,get_local_kernel,install_kernel,install_kernel_all_variants,get_locked_kernel,load_kernel, andpatch_kernels_hub. Only the kernels Hub API factory is swapped per call, so a plainimport kernelskeeps using the Hugging Face Hub. Install withpip install "modelscope-hub[kernels]"(kernels>=0.17). - Kernel publishers are allowlisted (
kernels-communityby default, extendable withMS_KERNELS_TRUSTED_PUBLISHERS); mirrors that only carrymasterresolve as kernel versionv1; a cross-hub lockfile commit hash fails with an actionable note instead of a silent mismatch. - New public cache helpers
get_cache_root()andresolve_cached_snapshot();MS_CACHE_HOMEis accepted as a legacy alias for the cache root. ms-hub cache clear --dry-runlists the targets that would be deleted.
Enhance
local_files_only=Truein the compatibilitysnapshot_download/model_file_download/dataset_file_downloadresolves purely from the local cache: no network access, no credential initialisation, no directory creation, andCacheNotFoundwhen absent. Report/recovery options are rejected when combined withlocal_files_only.- Legacy-compatible
snapshot_download()keeps<legacy model root>/<owner>/<name>linked to the directory it returns, so callers that still append a repository ID to the old root (e.g. released vLLM builds) keep working. The link is created only inside the active cache root, is skipped for offline resolution, replaces only its own links, and is skipped when symlinks are unsupported.
Fix
- Cached snapshots are reused instead of re-downloaded, and the legacy path link is treated as an alias by legacy-cache detection, scanning and cleanup rather than as a separate legacy repository.
cache clearnow validates every target before deleting anything: unsafe roots (filesystem root, home and its ancestors), empty identifiers, path traversal, out-of-root targets, symlinked containers or parents, and cache-type containers are rejected for the whole batch; only typed repository directories are removed.
Refactor
- vLLM compatibility is delivered by the legacy cache-path link instead of an in-memory adapter: modelscope-hub does not import or patch vLLM and declares no dependency on
huggingface_hub; Hugging Face semantics stay inmodelscope.utils.hf_util. HubConfigexpands~incache_dir/config_diron construction, and cache-clear target planning is shared between the SDK and the CLI (--dry-runuses the same resolution).
Docs
- README: kernel usage and constraints, cache-root/snapshot resolution guidance,
cache clear --dry-run. - AGENTS.md: new vLLM compatibility contract covering cache paths, argument/exception propagation, offline behaviour and regression expectations.
What's Changed
- Kernels subpackage and huggingface_hub patcher migration by @tastelikefeet in #79
- Kernels Package & Offline Cache Compatibility by @wangxingjun778 in #80
Full Changelog: v0.6.1...v0.7.0