feat: support pinned Hugging Face model declarations (#4821)

Python Function declarations can now pin Hugging Face snapshots with
`models=[HuggingFaceModel(repo=..., revision=...)]`. The native Rust
registration path carries those declarations into `CREATE FUNCTION`, and
create/get/list results retain `image.models`. Functions without
declarations preserve their existing payload shape. The API reference
includes a model-loading example that initializes once per Function
instance.

Validation:
- The real SQL mock-service regression fails on the previous native
implementation and passes after the fix. It covers immediate/deferred
execution, requests with/without models, and create/get/list responses.
- Rust Function wire tests, strict Clippy, the public-type doctest, and
formatting.
- Rebuilt Python extension and targeted registration/golden tests.

The service-side snapshot preparation and cache are delivered separately
for ENT-3483.
This commit is contained in:
Xuanwo
2026-11-04 11:26:49 +08:00
committed by GitHub
parent aeab69e86a
commit f4271b9dcb
6 changed files with 202 additions and 18 deletions
+2
View File
@@ -470,6 +470,8 @@ with BlobReader(read_range, len(payload)) as reader:
::: lancedb.functions.FunctionVersion
::: lancedb.functions.HuggingFaceModel
::: lancedb.functions.PythonRuntimeSpec
::: lancedb.GpuClass