`m decompose`: the docs example, the smaller-model advice and the generated script don't match what the CLI does
Los mantenedores suelen responder en 3 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 18/100
- Tipo de issue
- Documentación
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- markdown, ollama, python
- Área
- cli, documentation, testing
Línea de trabajo
Start by running the reproduction block on a fresh checkout with Ollama up, then read docs/docs/how-to/m-decompose.md against cli/decompose/decompose.py (default model near line 203, --enable-script-run pass-through near line 456), pipeline.py:171/:596 and cli/decompose/m_decomp_result_v3.py.jinja2:26, where the model id is hardcoded. Run uv run pytest test/decompose test/cli/test_decompose_unit.py test/cli/test_decompose_input.py and the shell examples in docs/examples/m_decompose/ before touching anything. Done means the page's commands run verbatim with matching output, the template starts the session with the model/backend/endpoint actually passed, and the PR pastes transcripts plus per-model run counts for the model advice.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What users see
Someone following how-to/m-decompose.md hits a series of dead ends:
- The page's own example (
task.txtfollowed bypython output/m_decomp_result/m_decomp_result.py) points at a path that never gets created. - The page says the default model is a small Granite model and suggests another small Granite model to avoid a big download. The real default is
mistral-small3.2:latest(24B, 15 GB), and the small models we tried failed the pipeline. - Even when a smaller model works, the generated script hardcodes
mistral-small3.2:latest, so running it pulls the 15 GB model anyway. - The OpenAI example fails immediately with an assertion error.
There is no single big bug here. The CLI, the template, the docs and the examples were each right at some point and have drifted apart. #1838 asks for the Granite version strings on this page to be updated, and #1862 does that, but those edits sit on top of claims that are wrong for other reasons. I'd like the page, the CLI and the examples fixed together.
Terms used below: a job is one task the CLI decomposes. --input-file makes one job per non-empty physical line, and each job gets its own output directory.
What happened
I ran everything on a checkout based on Mellea main (the cli/decompose code is identical to main), with Ollama on macOS. Each run is a single sample, so read the pass/fail results as indicative, not as rates. Measuring them properly is part of the work.
1. The multi-line example creates four jobs, not one.
docs/docs/how-to/m-decompose.md shows a task.txt that is one task wrapped over four lines. The CLI makes one job per non-empty line, so it decomposes four sentence fragments and writes m_decomp_result_1 to m_decomp_result_4. The documented m_decomp_result/ directory does not exist. This behaviour is old (v0.9.0 does the same). #1761, which is not in a release yet, added \n escapes inside a line, and it updated refactor-prompts-with-cli.md but not this page. A fix that uses \n therefore works on main but not on the 0.9.0 CLI.
Also, if a later job fails, the outputs of the earlier jobs are deleted (the docstring says so, but it surprises people). On granite4.1:8b, jobs 1 and 2 completed, job 3 failed to parse, and the output directory ended up empty.
The shell examples have the same problem, from reading the code (I did not run them). docs/examples/m_decompose/example.txt has three non-empty lines, so decompose_using_cli.sh writes three numbered directories, and decompose_intermediary_python_command.sh then runs python ./m_decomp_result.py, which won't exist.
2. Small models fail the pipeline.
granite4.1:3b, single-line task: failed after about 50 s (TagExtractionError).granite4.2:3b: failed after about 6 min (TagExtractionError) in 3 of 3 CLI runs (two single-line, one with the 4-linetask.txt). One call to the Python API with a shorter, different prompt did succeed.granite4.1:8b, single-line task: completed, and the generated script ran end to end.
There is no documented minimum model, and the CLI doesn't warn when a small model is likely to fail.
3. The generated script ignores the model you passed.
cli/decompose/m_decomp_result_v3.py.jinja2:26 has mellea.start_session(model_id="mistral-small3.2:latest"). A script generated with --model-id granite4.1:8b still starts a Mistral session. The CLI help says --enable-script-run makes the script expose argparse overrides for backend, model, endpoint and API key. The option is passed through (decompose.py:456), but no template under cli/decompose/ refers to it, so I don't see how it can work. With the model edited by hand to the 8B, the script ran and exited 0 and produced a blog post.
4. The generated validators are brittle.
In that run, 3 of the script's sampling calls ended with Invoking select_from_failure after 2 failed attempts. One generated validator (validations/val_fn_1.py:13) checks line.startswith("Title:"), while the model wrote **Title:**. I did not look into the other failures.
5. The OpenAI example is incomplete.
--backend openai --model-id gpt-4o-mini fails with AssertionError: Required to provide "backend_endpoint". pipeline.py:219-224 requires both --backend-endpoint and --backend-api-key. The page shows neither.
6. The default model is wrong on the page.
On main, line 62 says m decompose defaults to granite4.1:3b (lines 28 and 89 also use it). #1862 changes those three lines to granite4.2:3b. The real default is mistral-small3.2:latest (decompose.py:203, pipeline.py:171 and :596), which the Ollama library lists at 15 GB. The same page's "~15 GB" note already contradicts the Granite default.
7. Smaller doc gaps.
- The subtask field table omits
general_instructions, which the API returns. - The output includes a
validations/directory that the page never mentions. docs/examples/m_decompose/README.mdanddecompose_using_cli.shsuggestgranite4:latestas an alternative to Mistral. I haven't tried it.
Not tested: I never ran the default mistral-small3.2:latest model, so I can't say whether the pipeline works reliably on it.
What we expected
Every command on the how-to page works as written, the example output matches the page, and the model advice is true. A user who passes --model-id X gets a script that uses X.
How to reproduce
Use a fresh output directory each time. The CLI creates it only after the LLM run and fails with FileExistsError if it already exists.
# The page's task: one task wrapped over four lines
printf '%s\n' \
'Write a short blog post about the benefits of morning exercise.' \
'Include a catchy title, an introduction paragraph, three main benefits' \
'with explanations, and a conclusion that encourages readers to start' \
'their morning exercise routine.' > task.txt
# A single-line version that does complete on a larger model
echo 'Write a short blog post about the benefits of morning exercise, with a title, an introduction, three benefits and a conclusion.' > task_single.txt
# 1. Look for "run pipeline job 1/4" in the output, and for output1/m_decomp_result/ afterwards
mkdir output1 && m decompose run --input-file task.txt --out-dir ./output1/ --model-id granite4.1:8b
# 2 and 3. Single line with a small model, then with the 8B; then check which model the script uses
mkdir output2 && m decompose run --input-file task_single.txt --out-dir ./output2/ --model-id granite4.1:3b
mkdir output3 && m decompose run --input-file task_single.txt --out-dir ./output3/ --model-id granite4.1:8b
grep -n start_session output3/*/*.py
# 5. Fails with the backend_endpoint assertion
mkdir output4 && m decompose run --input-file task_single.txt --out-dir ./output4/ --backend openai --model-id gpt-4o-mini
Success criteria
Whoever picks this up should paste the evidence for each point into the PR.
- Docs run verbatim. Every command and snippet on
how-to/m-decompose.mdis run exactly as written, and the output matches the page. Paste the transcript. - The sample task works. The example is a task the CLI treats as one job (for example one line, or
\nescapes if we ship that), andlsshows the directory names the page claims. The shell examples indocs/examples/m_decompose/are fixed or removed, and run. - Model advice is measured. The page recommends a model only if it completes the sample task reliably. Run it at least 10 times per model and report the model, the number of runs, the failures and the timings in the PR. Maintainers agree the bar when reviewing. If no small model passes, the page says so and states the smallest model that did.
- The script follows the CLI. A script generated with a non-default
--model-idstarts a session with that model (and the chosen backend and endpoint), and runs without any other model being pulled (ollama listbefore and after).--enable-script-runeither works or is removed from the help text. - Generated validators are checked. At least the
Title:case is fixed, and a test or note explains why the other sampling calls failed. - The OpenAI path works. The page shows
--backend-endpointand--backend-api-key, and the example is run against a real endpoint (Ollama's OpenAI-compatible/v1endpoint is enough). - The default model is documented correctly, and has been run end to end at least once.
- Tests and examples all run, before and after. Report pass/fail counts for:
uv run pytest test/decompose test/cli/test_decompose_unit.py test/cli/test_decompose_input.pyuv run pytest -m slow docs/examples/m_decompose(needs Ollama; the example is markedslow, so it is skipped by default)- both shell examples in
docs/examples/m_decompose/, run by hand uv run poe clidocsif any CLI help text changesnpx markdownlint-cli2 "docs/docs/**/*.md"
- Regression tests. Tests cover the chosen behaviour for multi-line input and for the script's model.
Decisions for maintainers before work starts
- Default model. Is a 24B, 15 GB default right for a first run? Changing it means making the pipeline reliable on smaller models first.
- Failed jobs. Should a failure in job N delete the finished output of jobs 1 to N-1, or keep it?
- Released docs. The 0.9.0 snapshot has the same page errors. Do we fix
version-0.9.0too? If so, any\nfix won't work there, because the 0.9.0 CLI has no\nexpansion.
Environment
Mellea main at the time of writing (2026-11-23), Python 3.12, macOS, Ollama running locally. Models: granite4.1:3b, granite4.2:3b, granite4.1:8b.
Related: #1838, #1862, #1761
- Lenguaje dominante
- Python
- Estrellas
- 1.8k
- Forks
- 161
- Merge medio
- 4 d 3 h
- PR fusionados (30 d)
- 45
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de generative-computing/mellea
-
bug: `mellea.plugins.builtin_debug.generation.log_generation_post_call` shows model as unknownAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
generative-computing/mellea#1864 ·
Los mantenedores suelen responder en 3 días
-
bug: instruct() and react() replay tool-call turns without tool_callsPosiblemente ocupada @simonyang08 la tomó hace 21 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
generative-computing/mellea#1784 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
Silently mangled docstrings: lone backslash line-continuations in non-raw docstrings collapse command examplesPosiblemente ocupada @madhusudhan1260 la tomó hace 18 días. Abiertogood first issue p2
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
generative-computing/mellea#1780 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 3 días
-
area/telemetry enhancement p2
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
generative-computing/mellea#1210 ·
Los mantenedores suelen responder en 3 días
-
Add requirement priorityAbiertoarea/requirement area/stdlib enhancement p2
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
generative-computing/mellea#31 · 2 comentarios ·
Los mantenedores suelen responder en 3 días
Todos los issues de generative-computing/mellea
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
OpenFreeEnergy/openfe#2371 ·
Los mantenedores suelen responder en 2 días
-
HMDB's smiles file writes "None" for metabolites with an empty <smiles/> (file not currently used)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
NCATSTranslator/Babel#1269 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 Medio día Aptitud para principiantes 80/100
Los mantenedores suelen responder en 1 día
-
404 on sample dataAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
bcgov/nr-hydrometric-rating-curve#443 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100