Skip to content

feat: granite4.1#964

Merged
avinash2692 merged 14 commits into
mainfrom
avi/feat/granite4.1
Apr 30, 2026
Merged

feat: granite4.1#964
avinash2692 merged 14 commits into
mainfrom
avi/feat/granite4.1

Conversation

@avinash2692
Copy link
Copy Markdown
Member

@avinash2692 avinash2692 commented Apr 29, 2026

Misc PR

Type of PR

  • Bug Fix
  • New Feature
  • Documentation
  • Other

Description

Summary

  • Add IBM_GRANITE_4_1_3B, IBM_GRANITE_4_1_8B, IBM_GRANITE_4_1_30B, and IBM_GRANITE_GUARDIAN_4_1_8B model identifiers to the registry
  • Switch the default model across the framework from granite-4.0-micro (3B) to granite-4.1-3b
  • Update all Ollama tags from granite4:micro / granite4:micro-h to granite4.1:3b
  • Update documentation, examples, CI workflows, and test fixtures to reference the new model

What changed

Area Change
mellea/backends/model_ids.py Added 4 new ModelIdentifier constants for 4.1
mellea/stdlib/session.py Default model → IBM_GRANITE_4_1_3B
mellea/backends/ollama.py Default model → IBM_GRANITE_4_1_3B
mellea/backends/litellm.py Default model string → IBM_GRANITE_4_1_3B
cli/eval/runner.py Fallback model → IBM_GRANITE_4_1_3B
.github/workflows/quality.yml ollama pull granite4.1:3b
test/conftest.py Deduplicated model lists, updated to granite4.1:3b
test/scripts/ Updated OLLAMA_MODEL_LIST + VLLM_MODEL
25+ docs pages granite4:micro(-h)granite4.1:3b
Examples & notebooks Updated model references

What was NOT changed (intentional)

  • Intrinsics code — no 4.1 LoRA adapters exist yet; intrinsics examples/tests/constants remain on granite-4.0-micro
  • IBM_GRANITE_4_MICRO_3B constant — kept for backward compatibility
  • IBM_GRANITE_4_HYBRID_MICRO — hybrid model unaffected, Ollama tag unchanged

Testing

  • Tests added to the respective file if code was changed
  • New code has 100% coverage if code as added
  • Ensure existing tests and github automation passes (a maintainer will kick off the github automation when the rest of the PR is populated)

Attribution

  • AI coding assistants used

@github-actions
Copy link
Copy Markdown
Contributor

The PR description has been updated. Please fill out the template for your PR to be reviewed.

@avinash2692 avinash2692 changed the title Avi/feat/granite4.1 feat: granite4.1 Apr 29, 2026
@github-actions github-actions Bot added the enhancement New feature or request label Apr 29, 2026
@avinash2692 avinash2692 marked this pull request as ready for review April 29, 2026 18:57
@avinash2692 avinash2692 requested a review from a team as a code owner April 29, 2026 18:57
Copy link
Copy Markdown
Member

@nrfulton nrfulton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably clean up the docs and code-base if we have specific model ids showing up this often.

IBM_GRANITE_4_1_3B = ModelIdentifier(
hf_model_name="ibm-granite/granite-4.1-3b",
ollama_name="granite4.1:3b",
watsonx_name=None,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove these Nones.

IBM_GRANITE_4_1_3B = ModelIdentifier(
hf_model_name="ibm-granite/granite-4.1-3b",
ollama_name="granite4.1:3b",
watsonx_name=None,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove these Nones.

@avinash2692
Copy link
Copy Markdown
Member Author

We should probably clean up the docs and code-base if we have specific model ids showing up this often.

Not sure I quite follow. Are we talking about instances of Granite4.0 in docs?

@avinash2692 avinash2692 requested a review from nrfulton April 29, 2026 20:34
Copy link
Copy Markdown
Contributor

@ajbozarth ajbozarth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few things to fix before this merges.

Commit hygiene (blocking)
Commits are missing Signed-off-by (git commit -s, AGENTS.md §6) and Assisted-by: Claude Code (AGENTS.md §7). The PR will be squash-merged, so at least one commit needs both trailers before then.

Tests (non-blocking)
No new unit tests for the four new ModelIdentifier constants — checklist box is unchecked.

## Hello world

By default, `start_session()` connects to Ollama and uses **IBM Granite 4 Micro**
(`granite4:micro`). Make sure Ollama is running before you run this:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Branding mismatch. granite4.1:3b is Granite 4.1, not "Granite 4 Micro" — that name belonged to 4.0-micro. This line and line 85 should be updated, e.g. to IBM Granite 4.1 3B.


`start_session()` defaults to **Ollama** with **IBM Granite 4 Micro** (`granite4:micro`).
`start_session()` defaults to **Ollama** with **IBM Granite 4 Micro** (`granite4.1:3b`).
No API keys needed — just have Ollama running:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same branding mismatch: points to granite4.1:3b but still says "IBM Granite 4 Micro".

`start_session()` connects to Ollama on `localhost:11434` and uses
**IBM Granite 4 Micro** (`granite4:micro`) by default. On first run, Mellea
**IBM Granite 4 Micro** (`granite4.1:3b`) by default. On first run, Mellea
automatically pulls the model if it is not already downloaded:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same branding mismatch.


**Default backend:** `start_session()` with no arguments connects to a local
[Ollama](https://ollama.ai) instance running **IBM Granite 4 Micro**
(`granite4:micro`). Make sure Ollama is running before you execute any example.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same branding mismatch.


IBM_GRANITE_GUARDIAN_4_1_8B = ModelIdentifier(
hf_model_name="ibm-granite/granite-guardian-4.1-8b"
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "removing Nones" fixup dropped ollama_name=None, # TBD from IBM_GRANITE_GUARDIAN_4_1_8B entirely — there's no longer any indication that Ollama support is pending vs. not applicable. Also, all four new constants now use a compact single-line style inconsistent with every other constant in the file. Suggest reverting to multi-line with ollama_name=None, # not yet available for the guardian.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's no longer any indication that Ollama support is pending vs. not applicable.

@avinash2692 Granite 4.1 is on ollama: https://ollama.com/library/granite4.1

ollama pull granite4:micro
ollama pull granite4:micro-h
ollama pull granite4.1:3b
- name: Run Tests
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

granite4:micro-h was dropped from the pull list. Confirm no ollama-marked integration tests still use IBM_GRANITE_4_HYBRID_MICRO, or they'll cold-start/fail in CI.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, I think I confirmed that in a nightly run.

Comment thread test/conftest.py
)
for model in ["granite4:micro", "granite4:micro-h", "granite3.2-vision"]:
for model in ["granite4.1:3b", "granite3.2-vision"]:
try:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same concern: granite4:micro-h removed from the warm-up and eviction loops. Please verify no ollama-marked tests depend on the hybrid model being warm.

@ajbozarth
Copy link
Copy Markdown
Contributor

I believe all the items Claude found are either docs that could be handled in a follow up or non-issues, but it's worth double checking

@avinash2692
Copy link
Copy Markdown
Member Author

waiting on #970 to be resolved.

@avinash2692
Copy link
Copy Markdown
Member Author

I believe all the items Claude found are either docs that could be handled in a follow up or non-issues, but it's worth double checking

Yea, I think there are some branding/docs issues there. Like @nrfulton mentioned (and if I understood what he said there) I think we might have to clean up model names in docs quite a bit.

@avinash2692 avinash2692 added this pull request to the merge queue Apr 30, 2026
Merged via the queue into main with commit 5c05a5b Apr 30, 2026
8 checks passed
@avinash2692 avinash2692 deleted the avi/feat/granite4.1 branch April 30, 2026 16:49
akihikokuroda pushed a commit to akihikokuroda/mellea that referenced this pull request May 27, 2026
* updating core to granite4.1

* updating core to granite4.1

* updating tests to granite4.1

* updating ci to granite4.1

* adding 4.1 to all the docs

* missed one

* missed some more

* removing Nones

* adding xfail to a flaky test

* setting watsonx name to none to ignore it in tests

* temp hack for watsonx backend

* adding warning to docstring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants