Skip to content

common: add --log-jsonl - #28437

Merged
ServeurpersoCom merged 2 commits into
masterfrom
xsn/log_jsonl
Sep 6, 2026
Merged

common: add --log-jsonl#28437
ServeurpersoCom merged 2 commits into
masterfrom
xsn/log_jsonl

Conversation

@ngxson

@ngxson ngxson commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Overview

Per discussion about equivalent of HF CLI --json output, we want to eventually allow downstream apps to read output from llama-server as JSON.

This is the first step of the plan, allow normal log lines to output as jsonl, with a specific "type": "log" on each log line.

In the future, we can extend this logic to have other types of log output, for example --fit output can have a specific output schema with its own type

Requirements

@ngxson
ngxson requested review from a team and ggerganov as code owners September 5, 2026 12:14
@github-actions github-actions Bot added documentation Improvements or additions to documentation server labels Sep 5, 2026
@ServeurpersoCom

ServeurpersoCom commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Nice, one thing before I approve: level_str() has no case for GGML_LOG_LEVEL_NONE, so every LOG() line (the raw llama-cli output and most of the server summaries) comes out as "level":"unknown", it should map to something explicit like "none".

Though NONE is not really a log, it's the user-facing output, so does it deserve its own "type" rather than a level under "log"?

@ngxson

ngxson commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator Author

Though NONE is not really a log, it's the user-facing output, so does it deserve its own "type" rather than a level under "log"?

not sure either, but let's still format it as json and give it a type anyway, so that downstream app can simply filter out type != "log" if they don't want to read any log

in next PRs, we will progressively add other type, downstream apps expect to use these extra types, not the "log"

Comment thread tools/cli/README.md
| `--reasoning-budget N` | token budget for thinking: -1 for unrestricted, 0 for immediate end, N>0 for token budget (default: -1)<br/>(env: LLAMA_ARG_THINK_BUDGET) |
| `--reasoning-budget-message MESSAGE` | message injected before the end-of-thinking tag when reasoning budget is exhausted (default: none)<br/>(env: LLAMA_ARG_THINK_BUDGET_MESSAGE) |
| `--reasoning-preserve, --no-reasoning-preserve` | preserve reasoning trace in the full history, not just the last assistant message (default: template default)<br/>compatible with certain templates having 'supports_preserve_reasoning' capability<br/>example: https://docs.z.ai/guides/capabilities/thinking-mode#preserved-thinking<br/>(env: LLAMA_ARG_REASONING_PRESERVE) |
| `--reasoning-preserve, --no-reasoning-preserve` | preserve reasoning trace in the full history, not just the last assistant message (default: enabled)<br/>compatible with certain templates having 'supports_preserve_reasoning' capability<br/>example: https://docs.z.ai/guides/capabilities/thinking-mode#preserved-thinking<br/>(env: LLAMA_ARG_REASONING_PRESERVE) |

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.

Is this being changed on purpose here? It doesn't seem directly related to --log-jsonl.

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.

llama-gen-doc needs to be run regularly, but people sometimes forget to do it. So, as soon as we run it, we update everything.

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.

Ah, understood. Thanks for explaining!

@ServeurpersoCom
ServeurpersoCom merged commit 7620399 into master Sep 6, 2026
24 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants