Skip to main content

hardHats

coldHat is for play; hardHats are for work. hardHats is the framework — the factory that makes crews. A crew is a line-up of agents, each wearing a hat, run across a federation of free model backends.

A hat is one of two things:

  • an LLM hat — a model wearing an instruction (a role, a method, an output rule), or
  • a gate hat — a deterministic function: a real check, a linter, a measurement.

The same engine runs both, so a crew can put an LLM drafter and a deterministic verifier on the same line. That is the point: the LLM hats do the judgement, the gate hats do the facts, and nobody has to trust a model for something a rule can decide.

A crew is config, not code

from hardhats import Hat, Crew

crew = Crew("grant", [
    Hat("researcher", model=("groq", "openai/gpt-oss-20b"),
        instruction="List what a Statement of Need must establish."),
    Hat("writer", model=("github", "openai/gpt-4o"),
        instruction="Draft it in a cold, plain register. No AI-tell words."),
    Hat("critic", gate=slopgate),          # a deterministic gate hat
])

# pre-flight the crew against a conflict graph before it runs
conflicts = crew.preflight(load("dataset/prompt-conflicts.json"))

outputs = crew.run("Write a Statement of Need for an accessibility tool.")

Each hat sees the task and every prior hat's output, down the line.

The federation

hardhats.backends speaks to one chat() over many OpenAI-compatible (and Gemini) backends — Gemini, Groq, OpenRouter, Ollama, plus GitHub Models, Cloudflare Workers AI, Cerebras, Mistral, NVIDIA NIM, SambaNova and Cohere — each read from the environment, keys never printed. Add a key, gain a perspective.

Crews in the family

  • a11yhat — the WCAG accessibility machine, four crew leads as deterministic gate hats.
  • a grant crew, a compliance crew, a prompt-check crew — each a few lines of config.
  • the bench — 22 keyword-summonable crews (an expert for every call, each with a real gate). See hardhats/crews/README.md; list them with python -m hardhats.crews.

Tests

python -m unittest discover -s tests — the engine (pipeline + pre-flight) is verified with gate hats only, so it proves out with zero model calls.

License

MIT. Copyright Vincent Gonzalez / F-Keys Creative LLC.

Metadata

Release files for hardhats 0.2.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 hardhats 0.2.0
File Size Uploaded Provenance Actions
hardhats-0.2.0.tar.gz 17.2 kB Without provenance Details for hardhats-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hardhats 0.2.0
File Interpreter ABI Platform Actions
hardhats-0.2.0-py3-none-any.whl Python 3 none any Details for hardhats-0.2.0-py3-none-any.whl

Total release size: 26.9 kB

Release files / hardhats-0.2.0.tar.gz

Download URL hardhats-0.2.0.tar.gz
Size 17.2 kB
Tags Source
SHA-256 checksum
How to use checksums
de8e05642fab539de1ebfd8c8fdc264e8df733e99f5a35390e995c47880cd54e
BLAKE2b-256 checksum
How to use checksums
be6dab00c148109c19603bbd7fdf5874b364a8704cf37fbe3c6d3150fb13a37f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / hardhats-0.2.0-py3-none-any.whl

Download URL hardhats-0.2.0-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5214d29ef68eadbc28a4c0f3e31da1345c45e065e35032745c319aa27f862b86
BLAKE2b-256 checksum
How to use checksums
98bcb2edde36f3ee53f6e859d17a149d906e7fba61e5a7eb46fb74e9dba7808d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Security for hardhats 0.2.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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