Skip to content

Add Ollama model name mappings for Granite 4.1 to intrinsics adapter resolution #1084

@kndtran

Description

@kndtran

The intrinsics adapter resolver (download_intrinsic_adapter in mellea/formatters/granite/intrinsics/util.py) uses BASE_MODEL_TO_CANONICAL_NAME to normalize the base model name before looking up LoRA/aLoRA adapter paths in the Granite Intrinsics Library.

When serving intrinsics adapters via Ollama, the base model name is the Ollama identifier (e.g. granite4.1:3b), which needs to be mapped to the GGUF adapter directory name on HF (e.g. granite4.1_3b). The mapping for Granite 4.0 Micro already exists ("granite4:micro""granite4_micro"), but the Granite 4.1 equivalents are missing.

This causes download_intrinsic_adapter to fail with:

ValueError: Intrinsic 'answerability' as LoRA adapter on base model 'granite4.1:3b' not found...
Searched for path answerability/granite4.1:3b/lora/io.yaml

The resolver looks for granite4.1:3b literally in the path instead of normalizing it to granite4.1_3b.

Proposed fix

Add the following entries to BASE_MODEL_TO_CANONICAL_NAME in mellea/formatters/granite/intrinsics/constants.py:

    "granite4.1:3b": "granite4.1_3b",
    "granite4.1:8b": "granite4.1_8b",
    "granite4.1:30b": "granite4.1_30b",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions