LLM-PQR
Test your models. Pick with evidence.
LLM-PQR is a small, provider-neutral tool for choosing among your models. You declare each model's measured quality, latency, token prices, capabilities, and whether it is local. Then you choose how much you value cost, speed, and quality. LLM-PQR produces an explainable recommendation without calling a provider or handling credentials.
Status: alpha. The first release is a deterministic selection core and CLI, not an autonomous router or a universal benchmark.
Why
Model choice is contextual. A low-cost local model may be ideal for private transformations; a stronger hosted model may be worthwhile for complex work. LLM-PQR keeps that decision in user-controlled data rather than hard-coding vendor tiers or marketing labels.
Quick start
python -m pip install llm-pqr
llm-pqr init --output models.json
llm-pqr choose \
--config models.json \
--input-tokens 1200 \
--output-tokens 300
For a more realistic reproducible example after cloning the repository:
llm-pqr choose \
--config examples/models.json \
--input-tokens 1200 \
--output-tokens 300
With the checked-in illustrative configuration, cost is weighted 8/10, speed
6/10, and quality 7/10. LLM-PQR recommends the economical cloud candidate
and shows its work:
{
"estimated_cost_usd": 0.000576,
"explanation": "Selected economy-cloud: best weighted score; estimated cost: $0.000576; priority weights: cost=0.38, latency=0.29, quality=0.33.",
"score": 0.787238,
"selected": {
"id": "economy-cloud",
"local": false,
"model": "your-economy-model",
"provider": "your-economy-provider"
}
}
Add --local-only and hosted candidates become ineligible rather than merely
receiving a lower privacy score:
llm-pqr choose --config examples/models.json --local-only
{
"excluded": {
"economy-cloud": "not local",
"frontier-cloud": "not local"
},
"selected": {
"id": "local-private",
"local": true,
"model": "your-local-model",
"provider": "your-local-runtime"
}
}
The values in examples/models.json are illustrative, not universal rankings.
Replace them with measured quality, latency, and verified current prices for
your models.
Create a fresh editable configuration with:
llm-pqr init --output models.json
Require a capability when needed:
llm-pqr choose --config models.json --require tools
The command returns JSON containing the selected model, excluded candidates, a score, the estimated cost (when rates are supplied), and normalized priority weights.
User-controlled configuration
llm-pqr init creates an editable JSON file:
{
"priorities": {"cost": 0.35, "latency": 0.25, "quality": 0.40},
"models": [
{
"id": "local-model",
"provider": "your-local-runtime",
"model": "replace-me",
"local": true,
"quality": 0.65,
"latency_ms": 900,
"input_cost_per_million": 0,
"output_cost_per_million": 0,
"capabilities": ["text"]
}
]
}
Fields
id,provider,model: your labels. No provider is special-cased.local: a technical locality declaration.--local-onlyexcludes every model not marked local.quality: a 0–1 score from your benchmark or evaluation. LLM-PQR does not invent it.latency_ms: your measured latency estimate.input_cost_per_million,output_cost_per_million: USD token rates you have verified. Omit either if unknown; LLM-PQR reports cost as unknown rather than fabricating it.capabilities: user-defined labels such astext,tools,vision, orjson.priorities: non-negative relative weights. They are normalized automatically, so8/1/1is equivalent to0.8/0.1/0.1.
Decision model
- Apply hard requirements first:
local_onlyand required capabilities. - Normalize the remaining candidates' declared cost, latency, and quality values.
- Choose the highest weighted score and explain the result.
Privacy is a constraint, not a score: a non-local candidate cannot win a --local-only request. See Privacy Is a Constraint, Not a Score for the design rationale.
Important limits
- This release does not call providers, send prompts, store credentials, or measure models automatically.
- A
local: truedeclaration is user-supplied metadata, not a network-attested guarantee. Production integrations must verify resolved endpoints are local before handling private content. - Scores and recommendations are conditional on your workloads, model versions, settings, hardware, and measurements. They are not universal rankings.
- Token counts are not cost. Use current model-specific input/output rates and record their source/date in your workflow.
Development
uv run --with pytest --with ruff pytest
uv run --with ruff ruff check src tests
uv run --with ruff ruff format --check src tests
See CONTRIBUTING.md, SECURITY.md, and CHANGELOG.md.
License
MIT. See LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llm_pqr-0.1.1.tar.gz.
File metadata
- Download URL: llm_pqr-0.1.1.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7908a561ad3eedbc60de806e69f2340c888bafe2989b6438af93395a0360b6a
|
|
| MD5 |
78b7adcf794fea352313d4d206891284
|
|
| BLAKE2b-256 |
3ab1bae6e58dbebf063a761e65913eb0747fd5138332822be10449438299fdb7
|
Provenance
The following attestation bundles were made for llm_pqr-0.1.1.tar.gz:
Publisher:
publish.yml on Amazed-Labs/llm-pqr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_pqr-0.1.1.tar.gz -
Subject digest:
b7908a561ad3eedbc60de806e69f2340c888bafe2989b6438af93395a0360b6a - Sigstore transparency entry: 2489471771
- Sigstore integration time:
-
Permalink:
Amazed-Labs/llm-pqr@0a5476f13a507cad7e4f85142c3d553580f4ff17 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Amazed-Labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0a5476f13a507cad7e4f85142c3d553580f4ff17 -
Trigger Event:
release
-
Statement type:
File details
Details for the file llm_pqr-0.1.1-py3-none-any.whl.
File metadata
- Download URL: llm_pqr-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd557366fef9a3e47981cf6b558720325b0ffc97ce34698104d8b9655676d62e
|
|
| MD5 |
b7338d8beb32cc5a4f03ae05c672692f
|
|
| BLAKE2b-256 |
4cc408bba5c96f9efbdb6e9846247bcf8df47faa2a33f17f4594d86169ced1f6
|
Provenance
The following attestation bundles were made for llm_pqr-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on Amazed-Labs/llm-pqr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_pqr-0.1.1-py3-none-any.whl -
Subject digest:
bd557366fef9a3e47981cf6b558720325b0ffc97ce34698104d8b9655676d62e - Sigstore transparency entry: 2489471825
- Sigstore integration time:
-
Permalink:
Amazed-Labs/llm-pqr@0a5476f13a507cad7e4f85142c3d553580f4ff17 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Amazed-Labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0a5476f13a507cad7e4f85142c3d553580f4ff17 -
Trigger Event:
release
-
Statement type: