Skip to content

Add a flag to disable page-type classification (dit model download) when using -json/-csv #2543

Closed

Description

@jalilm

httpx version:
v1.10.0

Current Behavior:
Passing -json (or -csv/-fpt) unconditionally initializes the dit page-type classifier (runner.go, if options.JSONOutput || options.CSVOutput || len(options.OutputFilterPageType) > 0 { dit.New() }). On a machine with no cached model, dit.New() downloads a ~92 MB model.json from Hugging Face (ModelURL in happyhackingspace/dit), logging INFO Model downloaded size=92.6MB to stderr.

There is no flag or env var to opt out.

Expected Behavior:
A flag (e.g. -no-classify) to use -json/-csv output without page-type classification, leaving ditClassifier unset classifyPage already early-returns when r.ditClassifier == nil, so it looks like a one-line guard.

Steps To Reproduce:

  1. Remove any cached model: rm -rf ~/.dit
  2. Run: echo https://example.com | httpx -json
  3. Observe httpx downloads the ~92 MB model and logs Model downloaded size=... — with no way to disable it.

Anything else:
We consume only core JSON fields (not page_type/forms), but must pass -json to parse output, which forces the classifier and its model download.
Workaround is pre-seeding ~/.dit/model.json (even {}), but an opt-out flag would be cleaner.

Activity

  1. added
    Type: Bug
    on Jul 22, 2026
  2. jatinder14 commented on Jul 25, 2026

    @jatinder14

    Update: PR is up at #2544

    Adds -no-classify so -json/-csv can skip the dit classifier and the model download. CodeRabbit caught that -nc already belongs to -no-color, so the short form was dropped. Unit tests and README are included.

  3. jalilm commented on Jul 26, 2026

    @jalilm
    Author

    thanks for the quick action, do you think you will release a minor version containing this flag?

  4. added a commit that references this issue on Aug 12, 2026
    9bcc668
  5. added a commit that references this issue on Aug 24, 2026
    2f8ce25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type: Bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions