mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-11-29 23:37:41 +00:00
* feat(wiki): let callers set the completion token limit Reasoning models can spend the hardcoded 16384 cap before a page is finished. Keep that default, and honor a flag, GITNEXUS_MAX_COMPLETION_TOKENS, or maxCompletionTokens in the CLI config. Fixes #3774 Co-authored-by: Cursor <cursoragent@cursor.com> * fix(wiki): reject LLM responses cut off at the completion token limit callLLM accepted a response whose finish_reason was "length" as a finished one, streamed or not, so a page cut off mid-sentence or mid-table was written and the run reported success. With a reasoning model the limit can be spent before the answer starts. Both paths now throw when the provider reports finish_reason "length", naming the limit. The generator already treats a thrown error as a failed module: the page is not written, the module is listed under "Failed modules", and the next run regenerates it. --------- Co-authored-by: nullptr <null@null.ptr> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Samuel Mbabhazi <samuelmbabhazi@gmail.com> Co-authored-by: Gergo Magyar <gergomagyar0@gmail.com> Co-authored-by: Gergő Magyar <gergomagyar@icloud.com>
51 lines
2.7 KiB
Markdown
51 lines
2.7 KiB
Markdown
# Wiki generation
|
|
|
|
[Back to GitNexus](../README.md)
|
|
|
|
Generate LLM-powered documentation from your knowledge graph:
|
|
|
|
```bash
|
|
# Requires an LLM API key (OPENAI_API_KEY, etc.)
|
|
gitnexus wiki
|
|
|
|
# Use a custom model or provider (default model: minimax/minimax-m2.5)
|
|
gitnexus wiki --model gpt-4o
|
|
gitnexus wiki --base-url https://api.anthropic.com/v1
|
|
gitnexus wiki --provider grok # local Grok Build CLI (uses `grok login`, no API key)
|
|
|
|
# Force full regeneration
|
|
gitnexus wiki --force
|
|
|
|
# Increase the timeout or retries for large codebases or slow LLM providers
|
|
gitnexus wiki --timeout <seconds> # LLM request timeout in seconds (default: disabled)
|
|
gitnexus wiki --retries <n> # Max LLM retry attempts per request (default: 3)
|
|
|
|
# Raise the completion-token limit (default: 16384)
|
|
gitnexus wiki --max-completion-tokens 131072
|
|
GITNEXUS_MAX_COMPLETION_TOKENS=131072 gitnexus wiki
|
|
# Or set "maxCompletionTokens": 131072 in ~/.gitnexus/config.json
|
|
# Precedence: flag, then the environment variable, then the config file.
|
|
|
|
# Allow a specific LAN/self-hosted HTTP LLM host (HTTPS is preferred for remote endpoints)
|
|
gitnexus wiki --base-url http://llama-box.local:8080/v1 --allow-insecure-connection llama-box.local
|
|
# Or set a comma-separated host allowlist:
|
|
GITNEXUS_ALLOW_INSECURE_CONNECTION=llama-box.local,192.168.1.23
|
|
|
|
# Change the output language
|
|
gitnexus wiki --lang <lang> # e.g. english, chinese, spanish, japanese
|
|
```
|
|
|
|
The completion limit must be a positive integer supported by your model. It applies to
|
|
OpenAI-compatible HTTP providers; local agent CLI providers manage their own limits.
|
|
For reasoning models, the limit includes reasoning tokens as well as the visible answer.
|
|
When a provider reports `finish_reason: "length"`, GitNexus rejects the incomplete response
|
|
instead of saving it as a finished page. Failed modules are listed, the command exits with
|
|
status 1, and a normal rerun retries them even if the repository commit has not changed.
|
|
Increase `--max-completion-tokens` within your model's supported limit before retrying.
|
|
Truncated grouping or overview responses also fail the run; batched grouping retains its
|
|
directory-based fallback. Incomplete runs are not published with `--gist`.
|
|
Use `--force` to replace incomplete pages already saved by an older version.
|
|
|
|
For safety, `http://` LLM base URLs are allowed by default only for loopback hosts (`localhost`, `127.0.0.1`, `::1`). `--allow-insecure-connection` and `GITNEXUS_ALLOW_INSECURE_CONNECTION` accept exact hostnames or IP addresses only; do not include schemes, ports, paths, credentials, or wildcards.
|
|
|
|
The wiki generator reads the indexed graph structure, groups files into modules via LLM, generates per-module documentation pages, and creates an overview page — all with cross-references to the knowledge graph.
|