MCPcopy Create free account
hub / github.com/antirez/ds4 / print_topic

Function print_topic

ds4_help.c:478–521  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

476 more_line(fp, c, "Agent sessions:", "sessions");
477 more_line(fp, c, "Agent commands:", "commands");
478 more_line(fp, c, "Agent tool system:", "tools");
479 } else if (tool == DS4_HELP_BENCH) {
480 more_line(fp, c, "Benchmark sweep:", "benchmark");
481 } else if (tool == DS4_HELP_EVAL) {
482 more_line(fp, c, "Evaluation options:", "evaluation");
483 }
484 fputc('\n', fp);
485}
486
487static void print_examples(FILE *fp, const help_colors *c, ds4_help_tool tool, const char *topic) {
488 title(fp, c, "Examples");
489 if (topic_is(topic, "distributed")) {
490 opt(fp, c, "worker", "./ds4 --role worker --layers 21:output --coordinator 192.168.0.181 9000 -m ds4flash.gguf");
491 opt(fp, c, "coordinator", "./ds4 --role coordinator --layers 0:20 --listen 0.0.0.0 9000 -p \"Hello\" -m ds4flash.gguf");
492 } else if (topic_is(topic, "runtime")) {
493 if (tool == DS4_HELP_SERVER) {
494 opt(fp, c, "Metal API", "./ds4-server -m ds4flash.gguf --metal --ctx 100000");
495 opt(fp, c, "quiet API", "./ds4-server --power 60 --host 127.0.0.1 --port 8000");
496 } else if (tool == DS4_HELP_AGENT) {
497 opt(fp, c, "agent", "./ds4-agent -m ds4flash.gguf --ctx 100000");
498 opt(fp, c, "quiet agent", "./ds4-agent --power 50");
499 } else if (tool == DS4_HELP_BENCH) {
500 opt(fp, c, "bench", "./ds4-bench --prompt-file long.txt --ctx-max 32768");
501 opt(fp, c, "quiet bench", "./ds4-bench --prompt-file long.txt --power 70");
502 } else if (tool == DS4_HELP_EVAL) {
503 opt(fp, c, "eval", "./ds4-eval --questions 10 --ctx 100000");
504 opt(fp, c, "CPU debug", "./ds4-eval --cpu --questions 1 --tokens 32");
505 } else {
506 opt(fp, c, "Metal", "./ds4 -m ds4flash.gguf --metal -c 100000");
507 opt(fp, c, "quiet thermals", "./ds4 -p \"Summarize README\" --power 50");
508 }
509 } else if (topic_is(topic, "steering")) {
510 opt(fp, c, "steer FFN", "./ds4 -p \"Write tersely\" --dir-steering-file dir.bin --dir-steering-ffn 0.8");
511 } else if (tool == DS4_HELP_SERVER || topic_is(topic, "api") || topic_is(topic, "kv-cache")) {
512 opt(fp, c, "local API", "./ds4-server --ctx 100000 --kv-disk-dir ~/.ds4/server-kv --kv-disk-space-mb 8192");
513 opt(fp, c, "curl", "curl http://127.0.0.1:8000/v1/models");
514 } else if (tool == DS4_HELP_AGENT || topic_is(topic, "sessions") || topic_is(topic, "tools")) {
515 opt(fp, c, "interactive", "./ds4-agent");
516 opt(fp, c, "one shot", "./ds4-agent --non-interactive -p \"Create /tmp/hello.c\"");
517 } else if (tool == DS4_HELP_BENCH || topic_is(topic, "benchmark")) {
518 opt(fp, c, "csv", "./ds4-bench --prompt-file long.txt --ctx-max 32768 --csv speed.csv");
519 opt(fp, c, "prefill only", "./ds4-bench --prompt-file long.txt --gen-tokens 0");
520 } else if (tool == DS4_HELP_EVAL || topic_is(topic, "evaluation")) {
521 opt(fp, c, "first 10", "./ds4-eval --questions 10 --trace eval.trace");
522 opt(fp, c, "plain", "./ds4-eval --plain --nothink --tokens 512");
523 } else {
524 opt(fp, c, "chat", "./ds4");

Callers 1

ds4_help_printFunction · 0.85

Calls 15

streqFunction · 0.85
print_model_runtimeFunction · 0.85
tool_has_topicFunction · 0.85
print_samplingFunction · 0.85
print_steeringFunction · 0.85
print_distributedFunction · 0.85
print_cli_specificFunction · 0.85
print_cli_commandsFunction · 0.85
print_server_apiFunction · 0.85
print_server_thinkingFunction · 0.85
print_kv_cacheFunction · 0.85
print_agent_specificFunction · 0.85

Tested by

no test coverage detected