Skip to content

docs(export): say that the GGUF converter script is not installed by the export extra - #995

Closed
cemililik wants to merge 1 commit into
developmentfrom
docs/wave0-gguf-converter-discovery
Closed

cemililik wants to merge 1 commit into
developmentfrom
docs/wave0-gguf-converter-discovery

Conversation

@cemililik

@cemililik cemililik commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

pip install 'forgelm[export]' was described as bringing llama-cpp-python's "bundled" convert_hf_to_gguf.py, and the error hint advised pip install 'llama-cpp-python>=0.2.90'. forgelm export runs llama.cpp's converter with ForgeLM's own Python, and no released llama-cpp-python wheel puts the script where ForgeLM looks (0.2.90 installs it under bin/, 0.3.x does not ship it). A plain install ends with convert_hf_to_gguf.py not found inside the llama-cpp-python installation (exit 2) unless FORGELM_GGUF_CONVERTER points at the script in a llama.cpp checkout.

Related issues

Refs #113, #83 — the documentation half and the misleading error hint. Searching the locations real wheels use (or bundling the script) is a code change and stays open. The GGUF export and verify pages themselves are in the sidecar PR.

Changes

  • docs/usermanuals/{en,tr}/getting-started/installation.md: the [export] section now says the script is not included and gives the two commands that make it work (git clone https://github.com/ggml-org/llama.cpp; export FORGELM_GGUF_CONVERTER=…/convert_hf_to_gguf.py). It explains why the checkout's copy is needed: the upstream script imports sibling modules (conversion, gguf), and its requirements must be importable in the environment ForgeLM runs in. I checked the upstream repository location, the requirements/requirements-convert_hf_to_gguf.txt path and those imports against upstream master.
  • The CLI reference (FORGELM_GGUF_CONVERTER row, EN+TR), the usage and quickstart guides (EN+TR), the post-training notebook cell, the export extra's comment in pyproject.toml and the export.py module docstring say the same.
  • forgelm/export.py: the not-found message now says "Set FORGELM_GGUF_CONVERTER=/path/to/llama.cpp/convert_hf_to_gguf.py, the script inside a llama.cpp checkout" instead of advising a reinstall. No other code changes.

Trade-off

The documented route is a llama.cpp checkout plus an environment variable. That is the only route that works today; I did not add an env-free path.

Type

  • Documentation (and one error message)

Testing

  • tests/test_export.py::TestExportModel::test_missing_converter_script_in_package_is_runtime_error now also asserts the new hint (names FORGELM_GGUF_CONVERTER and "llama.cpp checkout", no pip install); it fails against the old message.
  • The full CLAUDE.md gauntlet from a clean worktree of this branch: exit 0.

Checklist

  • English and Turkish mirrors updated together (Turkish wording needs the owner's review)
  • CHANGELOG entry under [Unreleased]
  • Tests added

🤖 Generated with Claude Code

Summary by Sourcery

Clarify that GGUF export requires the converter from a llama.cpp checkout and direct users to configure it explicitly.

Bug Fixes:

  • Correct the GGUF export guidance and runtime error hint so they no longer claim that llama-cpp-python wheels provide the converter script.

Enhancements:

  • Document the supported llama.cpp checkout and FORGELM_GGUF_CONVERTER setup for GGUF export across English and Turkish guides, references, examples, notebook content, package metadata, and module documentation.

Documentation:

  • Update installation and export documentation to explain the converter's external llama.cpp requirement, required environment variable, and related dependencies.

Tests:

  • Extend export error handling coverage to verify the actionable llama.cpp checkout hint and absence of the obsolete reinstall advice.

Chores:

  • Record the corrected GGUF converter guidance in the unreleased changelog.

…the export extra

forgelm export runs llama.cpp's convert_hf_to_gguf.py with ForgeLM's own Python. The installation page, the export extra's
comment in pyproject.toml, the module docstring, the usage and quickstart guides and the post-training notebook said it was
llama-cpp-python's "bundled" script, and the error hint advised `pip install 'llama-cpp-python>=0.2.90'`. No released wheel
puts the script where ForgeLM searches (0.2.90 installs it under bin/, 0.3.x does not ship it), so a plain install ends with
"convert_hf_to_gguf.py not found inside the llama-cpp-python installation" (exit 2) unless FORGELM_GGUF_CONVERTER points at
the script in a llama.cpp checkout. The upstream script imports sibling modules (conversion, gguf), which is why the
checkout's copy has to be used; the upstream repository and the requirements path were checked.

The pages now say so, with the two commands that make it work; the error message names FORGELM_GGUF_CONVERTER and a
llama.cpp checkout instead of a reinstall, and a test pins that. Searching the locations real wheels use, or bundling the
script, are code changes and stay open.

Refs #113, #83

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@sourcery-ai

sourcery-ai Bot commented Oct 18, 2026

Copy link
Copy Markdown

Sorry @cemililik, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 12 hours and 45 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

@coderabbitai

coderabbitai Bot commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Next included review available in 51 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 3 included reviews currently available. Your 49 included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 7cc3a3be-8955-4d86-ade0-ce5aba9e1ee7
📥 Commits

Reviewing files that changed from the base of the PR and between 56b4f0d and 69eecb8.

📒 Files selected for processing: 13
  • CHANGELOG.md
  • docs/guides/quickstart-tr.md
  • docs/guides/quickstart.md
  • docs/reference/usage-tr.md
  • docs/reference/usage.md
  • docs/usermanuals/en/getting-started/installation.md
  • docs/usermanuals/en/reference/cli.md
  • docs/usermanuals/tr/getting-started/installation.md
  • docs/usermanuals/tr/reference/cli.md
  • forgelm/export.py
  • notebooks/post_training_workflow.ipynb
  • pyproject.toml
  • tests/test_export.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai

sourcery-ai Bot commented Oct 18, 2026

Copy link
Copy Markdown

Reviewer's Guide

This documentation-focused PR corrects the GGUF export installation contract: forgelm[export] does not provide the converter script, so users must obtain it from a llama.cpp checkout and configure FORGELM_GGUF_CONVERTER. The runtime hint, mirrored documentation, metadata comments, notebook, changelog, and regression test are updated consistently; converter discovery behavior itself is unchanged.

Sequence diagram for GGUF export converter discovery

sequenceDiagram
    participant User
    participant ForgeLM
    participant LlamaCpp
    participant Converter

    User->>ForgeLM: forgelm export
    ForgeLM->>ForgeLM: _find_converter_script()
    alt FORGELM_GGUF_CONVERTER is set
        ForgeLM->>LlamaCpp: Resolve convert_hf_to_gguf.py
        LlamaCpp-->>ForgeLM: Converter path
        ForgeLM->>Converter: Run with ForgeLM Python
        Converter-->>ForgeLM: GGUF output
    else Converter is not found in llama-cpp-python
        ForgeLM-->>User: FileNotFoundError with checkout and env-var hint
    end
Loading

File-Level Changes

Change Details Files
Correct the documented GGUF export setup to require a llama.cpp checkout and explicitly configured converter script.
  • Explain that the export extra installs supporting Python dependencies but not the converter script.
  • Add clone and FORGELM_GGUF_CONVERTER setup instructions, including sibling-module and requirements context.
  • Synchronize the requirement across English and Turkish installation, CLI, usage, quickstart, notebook, package metadata, and changelog documentation.
docs/usermanuals/en/getting-started/installation.md
docs/usermanuals/tr/getting-started/installation.md
docs/usermanuals/en/reference/cli.md
docs/usermanuals/tr/reference/cli.md
docs/reference/usage.md
docs/reference/usage-tr.md
docs/guides/quickstart.md
docs/guides/quickstart-tr.md
notebooks/post_training_workflow.ipynb
pyproject.toml
CHANGELOG.md
Align export module documentation and runtime diagnostics with the actual converter source and supported recovery path.
  • Update module and discovery docstrings to describe llama.cpp as the converter source and the environment variable as the practical route.
  • Replace the misleading llama-cpp-python reinstall hint with instructions to set FORGELM_GGUF_CONVERTER to a script in a llama.cpp checkout.
forgelm/export.py
Regression-test the revised missing-converter guidance.
  • Assert the runtime error names FORGELM_GGUF_CONVERTER and a llama.cpp checkout.
  • Assert that the error no longer recommends pip installation.
tests/test_export.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@cemililik

Copy link
Copy Markdown
Collaborator Author

Superseded by #998: the wave-0 fixes are combined by theme into five pull requests to cut the review load. This branch's commits are included there unchanged apart from the CHANGELOG.md merge; the branch stays on the remote.

@cemililik cemililik closed this Oct 18, 2026
cemililik added a commit that referenced this pull request Oct 18, 2026
…cument the converter requirement (#998)

## Summary

`forgelm export` now writes the SHA-256 sidecar that `forgelm
verify-gguf` and the documentation already assumed, and the GGUF
documentation describes what really happens. Two earlier pull requests
combined into one (#982 and #995, which will be closed as superseded);
the bot findings on #982 are folded in.

## Related issues

Refs #84, #85, #86 (docs), #83, #113. Making `verify-gguf` stricter than
"magic header + optional sidecar", and searching the locations real
llama-cpp-python wheels use for the converter, are separate changes and
stay open. The site strings that mention the sidecar are in a later pull
request.

## Changes

### Sidecar (was #982)

- `forgelm/export.py`: after the GGUF is written and hashed,
`<output>.sha256` is written in `sha256sum` format (`<digest> *<name>`)
through a temporary file and `os.replace`. A write failure returns
`success=False` (runtime error, exit 2) naming the GGUF path. For a
K-quant request the file written is the intermediate `.f16.gguf` and the
sidecar belongs to it. The `model_integrity.json` update failure is now
a `WARNING`, not `DEBUG`.
- The sidecar detects corruption and accidental change; it is **not**
tamper evidence, because whoever can replace the GGUF can replace the
sidecar next to it. The docs say so.
- `docs/usermanuals/{en,tr}/deployment/{gguf-export,verify-gguf}.md` and
`docs/reference/verify_gguf_subcommand{,-tr}.md`: real output, the
K-quant two-step flow, the real `exported_artifacts` JSON, what
`verify-gguf` checks and what it cannot, and the `--adapter` pitfall.
Review findings applied: the intermediate file is named by replacing
`.gguf` with `.f16.gguf`; the manifest entry is best effort.

### Converter script (was #995)

- `pip install 'forgelm[export]'` does not provide
`convert_hf_to_gguf.py`: no released llama-cpp-python wheel puts it
where ForgeLM searches (0.2.90 installs it under `bin/`, 0.3.x does not
ship it). The installation page, CLI reference, usage and quickstart
guides, the notebook, `pyproject.toml` comment and `export.py` docstring
now say to point `FORGELM_GGUF_CONVERTER` at the script in a llama.cpp
checkout; the upstream repository location, requirements path and
imports were checked.
- The not-found error message names `FORGELM_GGUF_CONVERTER` and a
llama.cpp checkout instead of advising a reinstall.

## Type

- [x] Feature (sidecar)
- [x] Documentation

## Testing

- `tests/test_export.py`: sidecar format and content, `sha256sum -c` and
`verify-gguf` accept it, atomic write and cleanup, K-quant sidecar,
failure path, plus the new converter hint test (**fails against the old
message**).
- The full `CLAUDE.md` gauntlet from a clean worktree of this branch:
exit 0.

## Checklist

- [x] English and Turkish mirrors updated together (Turkish wording
needs the owner's review)
- [x] CHANGELOG entries under `[Unreleased]`
- [x] Tests added

🤖 Generated with [Claude Code](https://claude.com/claude-code)

## Summary by Sourcery

Add reliable SHA-256 sidecars to GGUF export and align converter
requirements, verification behavior, and user documentation with the
implemented workflow.

New Features:
- Write SHA-256 sidecar files for exported GGUF artifacts, including
intermediate files produced for K-quant requests.
- Fail exports when the required sidecar cannot be written and elevate
integrity-manifest update failures to warnings.

Bug Fixes:
- Correct GGUF export and verification documentation to reflect actual
outputs, checks, limitations, K-quant workflow, and adapter usage.
- Correct converter setup guidance and error messaging to require a
llama.cpp checkout through FORGELM_GGUF_CONVERTER.

Enhancements:
- Clarify that sidecars detect accidental corruption but do not provide
tamper evidence.
- Document the actual exported_artifacts manifest structure and
verification behavior in English and Turkish documentation.

Documentation:
- Update installation, CLI, usage, quickstart, notebook, and GGUF
deployment documentation with the llama.cpp converter prerequisite and
sidecar workflow.

Tests:
- Add coverage for sidecar format, verification, atomic cleanup, K-quant
output, write failures, manifest warnings, and converter guidance.

Chores:
- Update the unreleased changelog and related export comments and
docstrings.

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant