Skip to main content

Software Poet Conscience — language-agnostic code aesthetic evaluation

Project description

eigenhelm

A conscience for agents, not an agent — language-agnostic code aesthetic evaluation sidecar.

Eigenhelm scores agent-generated code against mathematical aesthetic metrics derived from information theory, complexity science, and a PCA eigenspace trained on curated elite corpora. It runs alongside code-generating agents as a real-time quality signal.

License: AGPL-3.0


Quick Start

Install

uv tool install eigenhelm

For the HTTP server:

uv tool install "eigenhelm[serve]"

Evaluate a file

eigenhelm-evaluate path/to/file.py --model models/demo-python-v0.npz

Run the scoring server

eigenhelm-serve --model models/demo-python-v0.npz --host 0.0.0.0 --port 8080

API example

curl -X POST http://localhost:8080/evaluate \
  -H "Content-Type: application/json" \
  -d '{"source": "def add(a, b):\n    return a + b\n", "language": "python"}'

CLI Reference

Command Description
eigenhelm-evaluate Evaluate a source file against an eigenspace model
eigenhelm-train Train a new eigenspace model from a corpus directory
eigenhelm-inspect Inspect a saved model's metadata
eigenhelm-serve Run the evaluation HTTP server
eigenhelm-harness Run a statistical comparison harness across two code sets

HTTP API

Endpoint Method Description
/health GET Liveness probe
/evaluate POST Evaluate a code unit
/evaluate/batch POST Evaluate multiple code units

Supported Languages

Language Extension
Python .py
JavaScript .js
TypeScript .ts
Go .go
Rust .rs
Java .java
C .c
C++ .cpp
Ruby .rb
Swift .swift

Models

The bundled models/demo-python-v0.npz is a small demo model so you can run the full pipeline without a hosted account. Production-grade models trained on curated elite corpora are available via the hosted service or as a paid download.


Development Setup

git clone https://github.com/metacogdev/eigenhelm.git
cd eigenhelm

# Install with dev and serve dependencies
uv sync --extra dev --extra serve

# Run tests
uv run pytest

# Lint
uv run ruff check .

Architecture

eigenhelm/
├── virtue_extractor.py   — Tree-sitter + Lizard → FeatureVector (69 dimensions)
├── critic/               — AestheticCritic: Birkhoff, entropy, compression metrics
├── eigenspace.py         — EigenspaceModel: PCA projection, drift scoring
├── training/             — train_eigenspace(), save_model(), inspect_model()
├── helm.py               — DynamicHelm: PID-controlled inference steering
└── serve.py              — FastAPI HTTP evaluation server

License

eigenhelm is licensed under the GNU Affero General Public License v3.0.

Commercial Licensing

Looking to use eigenhelm in a proprietary SaaS or enterprise product without AGPL-3.0 obligations? A commercial license is available.

Contact us at licensing@eigenhelm.dev to discuss terms.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eigenhelm-0.2.0.tar.gz (61.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eigenhelm-0.2.0-py3-none-any.whl (76.1 kB view details)

Uploaded Python 3

File details

Details for the file eigenhelm-0.2.0.tar.gz.

File metadata

  • Download URL: eigenhelm-0.2.0.tar.gz
  • Upload date:
  • Size: 61.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for eigenhelm-0.2.0.tar.gz
Algorithm Hash digest
SHA256 03dd0b762afcff99c6f26e5d9b230f676c7329896b1c263f720c432ee8238a01
MD5 59820c0f492d4df9884ecfa72b1af838
BLAKE2b-256 00b75f5e7fa39f16cf796b67e93348ac9bb94d27b55b66bfd7c11ae7c3adf4d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for eigenhelm-0.2.0.tar.gz:

Publisher: publish.yml on matchdav/eigenhelm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eigenhelm-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: eigenhelm-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 76.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for eigenhelm-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d6fa2d87baad50f36d3443ab2250d4ba2a04e551019c6a883a422045b87792da
MD5 a823e192169eaa2c39e9ece8e1923b48
BLAKE2b-256 45c2ae64a3841b9bfafdf29b3247b163c8dd40c5748175d60a6f95219db1467c

See more details on using hashes here.

Provenance

The following attestation bundles were made for eigenhelm-0.2.0-py3-none-any.whl:

Publisher: publish.yml on matchdav/eigenhelm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page