Skip to main content

CLI Reference

The Python package includes the llm-forge command-line utility for shell scripting and quick validations without writing code.

Note: The CLI is currently only available via the Python package, not npm.

Usage

llm-forge [command] [options]

Commands

count

Counts exact tokens for a given string or file.

# Count direct string
llm-forge count gpt-4o "This is a test prompt."

# Count from file
llm-forge count claude-3-5-sonnet --file ./prompt.txt

chunk

Splits a document and outputs the chunks, either to stdout or a directory.

llm-forge chunk gpt-4o \
--file ./long-document.md \
--strategy sentence \
--max-tokens 1000 \
--overlap 100 \
--out-dir ./chunks

Supported strategies: sentence, paragraph, semantic, code, fixed

estimate

Calculates the API cost for processing a document.

llm-forge estimate gpt-4o --file ./data.txt

models

Lists all available models in the registry with their configurations.

llm-forge models

# Filter by provider
llm-forge models --provider openai

Environment Flags

You can force color output in CI/CD environments by setting FORCE_COLOR=1.