Skip to main content

The llm-distiller

Running

usage: main.py [-h] [--prompt PROMPT] [--model MODEL] [--db DB] [--max-depth MAX_DEPTH] [--max-tokens MAX_TOKENS] [--compression-level {1,2,3,4,5,6,7,8,9}] [--seed SEED]
               [--bloom-size BLOOM_SIZE] [--bloom-hash-count BLOOM_HASH_COUNT] [--max-ngrams MAX_NGRAMS] [--no-color] [--retrieve-to-bloom] [--use-unsloth] [--api-url API_URL]
               [--api-key API_KEY] [--system-prompt SYSTEM_PROMPT] [--threads THREADS] [--secrets-file SECRETS_FILE] [--load-prompts-from-file LOAD_PROMPTS_FROM_FILE]
               [--api-hf-provider API_HF_PROVIDER] [--compression-algo COMPRESSION_ALGO] [--prompt-prefixes PROMPT_PREFIXES [PROMPT_PREFIXES ...]] [--batch-size BATCH_SIZE]
               [--remove-prompt] [--ngram-mode] [--min-tfidf-score MIN_TFIDF_SCORE] [--save-to-textfile SAVE_TO_TEXTFILE] [--q-mode] [--randomize-prompts] [--randomize-model-retry]
               [--randomize-remote-endpoint] [--strip-think-tag-form-prompt] [--exp-backoff] [--stream]

LLM Distiller with Bloom filter and SQLite storage.

options:
  -h, --help            show this help message and exit
  --prompt PROMPT       Root word or prompt to distill.
  --model MODEL         Huggingface model name (default: distilgpt2).
  --db DB               Path to SQLite database (default: words/data.db).
  --max-depth MAX_DEPTH
                        Max recursion depth (default: 10).
  --max-tokens MAX_TOKENS
                        Max tokens (default: 1024).
  --compression-level {1,2,3,4,5,6,7,8,9}
                        Zlib compression level (1-9, default: 6).
  --seed SEED           Torch manual seed (optional).
  --bloom-size BLOOM_SIZE
                        Bloom filter size (default: 100,000,000).
  --bloom-hash-count BLOOM_HASH_COUNT
                        Bloom filter hash count (default: 6).
  --max-ngrams MAX_NGRAMS
                        Max ngrams (default: 10).
  --no-color            Disable colored output.
  --retrieve-to-bloom   Retrieve words from the database to the Bloom filter.
  --use-unsloth         Use unsloth
  --api-url API_URL     OpenAI compatible API url.
  --api-key API_KEY     API key for auth.
  --system-prompt SYSTEM_PROMPT
                        System prompt
  --threads THREADS     Number of CPU threads for PyTorch (default: auto)
  --secrets-file SECRETS_FILE
                        Specify the secrets json file.
  --load-prompts-from-file LOAD_PROMPTS_FROM_FILE
                        Specify the prompts file file.
  --api-hf-provider API_HF_PROVIDER
                        Specify the hugging face inference provider
  --compression-algo COMPRESSION_ALGO
                        Specify the compresion algo to use.
  --prompt-prefixes PROMPT_PREFIXES [PROMPT_PREFIXES ...]
                        List of strings with spaces allowed
  --batch-size BATCH_SIZE
                        Number of prompts to process in parallel (default: 1)
  --remove-prompt       Remove the prompt from generation.
  --ngram-mode          ngram mode from generation.
  --min-tfidf-score MIN_TFIDF_SCORE
                        Specify the min_tfidf_score.
  --save-to-textfile SAVE_TO_TEXTFILE
                        Specify a text file to save generated text.
  --q-mode              Q-mode.
  --randomize-prompts   Randomize prompts when read from file.
  --randomize-model-retry
                        Randomize model to retry.
  --randomize-remote-endpoint
                        Randomize remote endpoint.
  --strip-think-tag-form-prompt
                        Strip the <think> and </think> tags from prompts.
  --exp-backoff         Set exponential backoff.
  --stream              Set stream.

With a local endpoint:

#!/bin/bash
set -x

PROMPT='make a list of the most important people in history'
MODEL=meta-llama/llama-4-scout-17b-16e-instruct

python main.py "$PROMPT" \
     --compression-level 9 \
     --max-tokens=2048 \
     --max-depth 100 \
     --seed=0 \
     --model=$MODEL \
     --use-unsloth \
     --db /content/drive/MyDrive/IA/data.db \
     --prompt-prefixes 'please explain' 'please elaborate' 'think about' 'formulate a theory about' 'demonstrate that' \
     --batch-size 8 \
     --remove-prompt \
     --min-tfidf-score=0.1

With a remote inference endpoint:

#!/bin/bash
set -x

PROMPT='make a list of the most important people in history'
PROVIDER=https://api.groq.com/openai/v1/
MODEL=meta-llama/llama-4-scout-17b-16e-instruct

python main.py "$PROMPT" \
  --api-url=$PROVIDER \
  --model=$MODEL \
  --max-tokens=4096 \
  --prompt-prefixes "please explain" "please elaborate" "think about" "formulate a theory about" "demonstrate that" \
  --remove-prompt \
  --secrets-file=.secrets.json \
  --min-tfidf-score=0.1

The license is MIT.

Metadata

Release files for llm-distiller 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llm-distiller 0.1.0
File Size Uploaded
llm_distiller-0.1.0.tar.gz 11.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llm-distiller 0.1.0
File Interpreter ABI Platform
llm_distiller-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.9 kB

Release files / llm_distiller-0.1.0.tar.gz

Download URL llm_distiller-0.1.0.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e9bd52a7536a2c0b84448b9ae863770e96bf92c771e480fd5ba299a69638c38f
BLAKE2b-256 checksum
How to use checksums
8183ddab39525082cf96d2a797f772ae8b65c02b45973cf3d1c519aeb1ebdcab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 28, 2026.

Transparency log

Release files / llm_distiller-0.1.0-py3-none-any.whl

Download URL llm_distiller-0.1.0-py3-none-any.whl
Size 14.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6bd7898651eaf2c197258e9f0bf3bbb6674c61f1d5ffd71a85ac417c5264771
BLAKE2b-256 checksum
How to use checksums
095307e7a645b7bc52af101e0b0366e040e7109979d28da06e1a721b7a7ebdf9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page