Go to file
Lucio Lelii 085ab55413 Ask Ollama whether a model can reason before telling it to
Every Ollama call carried think:true unconditionally, on the belief - stated
in a comment - that a model without the capability would ignore it. It does
not: Ollama answers with 400 "gemma:7b" does not support thinking, so every
flow pointed at gemma, llama3 or any other non-reasoning model failed outright.

Resolved per model rather than per flow, in two steps so that neither an old
Ollama nor one behind a proxy is left broken:

- /api/show reports a capability list, and "thinking" in it is the answer.
  Cached per endpoint and model, so it is asked once, not per call.
- When it cannot be asked - no capabilities field, /show unreachable - the
  flag is sent anyway and the rejection itself is the answer: the identical
  call is repeated without it and the result remembered. One wasted request
  per model per process, and none after that. Matched on the server's own
  wording, never the bare 400, so a misspelled model stays the error it is.

Off means the key is absent, not think:false - absence is the only state every
version of Ollama reads as "no opinion".

ModelParameters gains "reasoning" to overrule that per-model answer: ON sends
it whatever the model is and lets an incapable one fail rather than quietly
answering without it, OFF never sends it - the case detection cannot guess,
a model that does reason but where the tokens are not worth it. Empty, which
is what every existing flow has, is the per-model default.

An enum and not a boolean because the editor collapses a boolean to true or
false as soon as its group is opened (schema-driven-fields, next[key] =
rawValue === true), which would have turned reasoning off for the models that
have it. It follows MCPAgentUploadKind, lenient @JsonCreator included, since
a select nobody chose from posts "" and an enum cannot be coerced from that.

THINKING is deliberately outside LLMProvider.supportedParameters()'s default,
which is no longer allOf: only the Ollama protocol has the switch, and a
provider inheriting a claim to it would leave the run log silent about a
setting that reached nothing.

The MCP agent path carries the same setting but cannot detect anything - the
bridge is not Ollama and exposes no capability endpoint - so there it is
whatever the flow says, defaulting to on as before.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-22 09:48:14 +02:00
.mvn/wrapper upgrade to springboot 4 2026-05-05 19:22:53 +02:00
src Ask Ollama whether a model can reason before telling it to 2026-09-22 09:48:14 +02:00
.gitattributes first commit 2025-03-27 11:38:06 +01:00
.gitignore Remove the internal host and the working notes from the published source 2026-09-21 14:22:05 +02:00
CITATION.cff Point the project at its home on the ISTI Gitea 2026-09-21 14:48:54 +02:00
Dockerfile Harden Maven downloads in Docker build 2026-09-10 11:34:39 +02:00
LICENSE Release under the AGPL with an attribution term 2026-09-16 12:10:26 +02:00
LICENSE-ADDENDUM Point the project at its home on the ISTI Gitea 2026-09-21 14:48:54 +02:00
NOTICE Point the project at its home on the ISTI Gitea 2026-09-21 14:48:54 +02:00
README.md Point the project at its home on the ISTI Gitea 2026-09-21 14:48:54 +02:00
mvnw first commit 2025-03-27 11:38:06 +01:00
mvnw.cmd first commit 2025-03-27 11:38:06 +01:00
ollama-preloaded-docker image for test with ollama added 2025-09-29 17:00:57 +02:00
pom.xml Point the project at its home on the ISTI Gitea 2026-09-21 14:48:54 +02:00
run_service.sh Replace Flyway schema setup with JPA mappings 2026-09-09 12:20:36 +02:00

README.md

RUN LOCAL SERVICE

./run_service.sh

BUILD DOCKER IMAGE

docker buildx build –platform linux/amd64,linux/arm64 -t luciolelii/humainflow:latest . –push

License

Copyright (C) 2025-2026 Lucio Lelii — ISTI-CNR.

HumAIn Flow is released under the GNU Affero General Public License v3.0 or later (LICENSE), with an additional attribution term under section 7(b) of that license (LICENSE-ADDENDUM).

In practice this means:

  • you may use, study, modify and redistribute it freely;

  • if you run a modified version as a network service, you must offer its source to the users of that service;

  • any work based on it must keep the attribution below, both in the source and where the interface shows its legal notices:

    Based on HumAIn Flow, originally developed by Lucio Lelii (ISTI-CNR) — https://gitea-s2i2s.isti.cnr.it/lelii/humainflow-service

If you use HumAIn Flow in academic work, please cite it — see CITATION.cff.