llama.cpp/examples
Daniel Bevenius 8b16cf0bfe
examples : add debug utility/example
This commit introduces a new example named llama-debug which is a
utility that is intended to be used to assist with developing/debugging
a converted model.

The motivation for this utilitiy is to assist in model conversion work
to verify that the model produces the expected outputs. It is intended
to replace logits.cpp in examples/model-conversion.

Example usage:
```console
./build/bin/llama-debug \
    -m models/Qwen2.5-0.5B-Instruct.gguf \
    --prompt "Hello, my name is" \
    --save-logits
...
Model add_bos: false
Input prompt: "Hello, my name is"
Token ids (5):
Hello(9707) ,(11)  my(847)  name(829)  is(374)
Data saved to data/llamacpp-Qwen2.5-0.5B-Instruct.bin
Data saved to data/llamacpp-Qwen2.5-0.5B-Instruct.txt
Prompt saved to data/llamacpp-Qwen2.5-0.5B-Instruct-prompt.txt
Tokens saved to data/llamacpp-Qwen2.5-0.5B-Instruct-tokens.bin
```

For more details about the options available for this example, please
refer to examples/debug/README.md.
2025-12-29 17:20:23 +01:00
..
batched common : refactor common_sampler + grammar logic changes (#17937) 2025-12-14 10:11:13 +02:00
batched.swift examples : remove references to `make` in examples [no ci] (#15457) 2025-08-21 06:12:28 +02:00
convert-llama2c-to-ggml gguf: gguf_writer refactor (#15691) 2025-09-05 11:34:28 +02:00
debug examples : add debug utility/example 2025-12-29 17:20:23 +01:00
deprecation-warning Update deprecation-warning.cpp (#10619) 2024-12-04 23:19:20 +01:00
diffusion models : Added support for RND1 Diffusion Language Model (#17433) 2025-11-24 14:16:56 +08:00
embedding common : refactor common_sampler + grammar logic changes (#17937) 2025-12-14 10:11:13 +02:00
eval-callback common : refactor common_sampler + grammar logic changes (#17937) 2025-12-14 10:11:13 +02:00
gen-docs gen-docs: automatically update markdown file (#18294) 2025-12-22 19:30:19 +01:00
gguf examples(gguf): GGUF example outputs (#17025) 2025-11-05 19:58:16 +02:00
gguf-hash GGUF: C++ refactor, backend support, misc fixes (#11030) 2025-01-07 18:01:58 +01:00
idle metal : add residency sets keep-alive heartbeat (#17766) 2025-12-05 19:38:54 +02:00
llama.android android: routine maintenance - Dec 2025 (#18338) 2025-12-29 15:51:13 +02:00
llama.swiftui llama : deprecate llama_kv_self_ API (#14030) 2025-06-06 14:11:15 +03:00
lookahead common : refactor common_sampler + grammar logic changes (#17937) 2025-12-14 10:11:13 +02:00
lookup common : refactor common_sampler + grammar logic changes (#17937) 2025-12-14 10:11:13 +02:00
model-conversion model-conversion : add device option to embd run orig model (#18386) 2025-12-29 13:37:02 +01:00
parallel common : refactor common_sampler + grammar logic changes (#17937) 2025-12-14 10:11:13 +02:00
passkey examples : remove references to `make` in examples [no ci] (#15457) 2025-08-21 06:12:28 +02:00
retrieval retrieval : use at most n_seq_max chunks (#18400) 2025-12-29 13:21:13 +02:00
save-load-state common : refactor common_sampler + grammar logic changes (#17937) 2025-12-14 10:11:13 +02:00
simple examples : support encoder-decoder models in the simple example (#16002) 2025-09-17 10:29:00 +03:00
simple-chat simple-chat : fix context-exceeded condition (#14494) 2025-07-02 14:12:07 +03:00
simple-cmake-pkg examples : add missing code block end marker [no ci] (#17756) 2025-12-04 14:17:30 +01:00
speculative common : restore grammar-based rejection sampling (#18137) 2025-12-17 19:46:00 +02:00
speculative-simple common : refactor common_sampler + grammar logic changes (#17937) 2025-12-14 10:11:13 +02:00
sycl [SYCL] replace llama-cli by llama-completion to rm the impact to test script (#18290) 2025-12-23 12:59:12 +08:00
training common : refactor common_sampler + grammar logic changes (#17937) 2025-12-14 10:11:13 +02:00
CMakeLists.txt examples : add debug utility/example 2025-12-29 17:20:23 +01:00
convert_legacy_llama.py metadata: Detailed Dataset Authorship Metadata (#8875) 2024-11-13 21:10:38 +11:00
json_schema_pydantic_example.py py : type-check all Python scripts with Pyright (#8341) 2024-07-07 15:04:39 -04:00
json_schema_to_grammar.py common : fix json schema with '\' in literals (#17307) 2025-11-29 17:06:32 +01:00
llama.vim llama : remove KV cache defragmentation logic (#15473) 2025-08-22 12:22:13 +03:00
pydantic_models_to_grammar.py pydantic : replace uses of __annotations__ with get_type_hints (#8474) 2024-07-14 19:51:21 -04:00
pydantic_models_to_grammar_examples.py llama : move end-user examples to tools directory (#13249) 2025-05-02 20:27:13 +02:00
reason-act.sh scripts : make the shell scripts cross-platform (#14341) 2025-06-30 10:17:18 +02:00
regex_to_grammar.py py : switch to snake_case (#8305) 2024-07-05 07:53:33 +03:00
server-llama2-13B.sh scripts : make the shell scripts cross-platform (#14341) 2025-06-30 10:17:18 +02:00
server_embd.py llama : fix FA when KV cache is not used (i.e. embeddings) (#12825) 2025-04-08 19:54:51 +03:00
ts-type-to-grammar.sh scripts : make the shell scripts cross-platform (#14341) 2025-06-30 10:17:18 +02:00