Intrinsic generation path drops a caller's explicit adapter_types

Đang mở
#1,750 4 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

@ajbozarth đang làm issue này rồi.

Từ ngày 19/10/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

area/adapter-functions area/backends

On the LocalHF Intrinsic generation path, an explicit Intrinsic.adapter_types is silently ignored — a caller who asks for (ALORA,) is served whatever the resolution walk registered, with no error and no warning. Before #1654 that path filtered by the caller's types and raised when unsatisfiable. Should the Intrinsic path honor a caller's explicit adapter_types again, and if so how?

Today (on the #1654 branch)

  • _generate_from_intrinsic looks the adapter up by name only: _find_adapter(action.intrinsic_name, None) (huggingface.py), with a comment that None is deliberate so a weightless prompt winner (type "prompt", never in a caller's tuple) isn't filtered out.
  • Registration is name-only too: resolve_adapter(name) runs the walk and registers one winner, never seeing the caller's types.
  • So the caller's adapter_types reaches neither resolution nor generation on this path. On main the same path filtered by action.adapter_types and raised backend has no adapter for processing intrinsic when unsatisfiable (OpenAI/Ollama still do this).

Why this happens (and why it's not a localized bug)

The path drops the type filter on purpose to keep the prompt winner reachable; losing the caller's restriction is the side effect. It is not merge drift and was not an articulated decision — #1654's PR body documents only the aLoRA-auto-select behavior change, not this one.

How reachable is it today

Narrow, which bears on urgency:

  • call_intrinsic (the core.* / rag.* helpers) does not expose adapter_types at all — it hardcodes (ALORA, LORA), which is itself vestigial on HF.
  • A direct Intrinsic(name, adapter_types=...) via act() does not auto-resolve; it requires prior registration via a separate name-only resolve_adapter/add_adapter, which already ignores the types.
  • The reroute path (ALoraRequirement) does honor explicit types (_find_adapter(name, search_types)), so the real "I want a specific type" use case has a working channel there.

So the regression is a silent drop on a path where the capability is barely expressible, not a loudly-broken common path.

The decision

  1. Should an explicit caller adapter_types be honored on the Intrinsic path? If yes, it means teaching resolution (not just the generation lookup) about the caller's types — threading allowed_types through resolve_adapter and the walk (so the winner is chosen within the allowed set), and exposing adapter_types on call_intrinsic and the public helpers. Filtering only at the generation lookup does not work: the walk has already committed to a winner by its own order, so a conflicting restriction would raise a false "no adapter" even when a satisfying adapter exists on the Hub.
  2. If not honored, at minimum make it non-silent — warn when a direct Intrinsic carries an explicit adapter_types the resolved winner doesn't satisfy.
  3. How does the prompt realization fit a caller restriction — append-prompt as a universal fallback, or strict "these types or fail"?

Relationship to the sibling issue

This is one of two places where the pre-prompt, adapter_type-keyed selection model struggles with the typeless prompt realization. This issue is the generation-path side: it doesn't filter (passes None) so the prompt stays reachable, at the cost of the caller's restriction. The sibling (#1749) is the gate side: it filters (("alora",)), so it loses the prompt. Same root incompatibility, opposite symptom. They are independent fixes but share the underlying design question (how a typeless realization participates in type-keyed selection), so they may be worth resolving together in one PR.

Scope

LocalHF. OpenAI/Ollama currently honor caller types (pre-#1654 model) and are a separate follow-up (#1748); the model chosen here is what they'd be aligned to.

Related

  • #1654 — introduces the behavior.
  • #993 — the prompt-fallback feature (closed by #1654).
  • Sibling: reroute-gap (#1749).

Code

_generate_from_intrinsic (huggingface.py); resolve_adapter + the walk (adapter.py); call_intrinsic (mellea/stdlib/components/intrinsic/_util.py); _find_adapter (adapter.py, type-filtered lookup).

Ngôn ngữ chính
Python
Star
1.8k
Fork
161
Merge trung bình
4 ngày 3 giờ
Pull request đã merge (30 ngày)
45

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của generative-computing/mellea

Tất cả issue của generative-computing/mellea

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.