Skip to main content

meerax

Version CI Python License

Meerax machine-learning module ecosystem

Shared ML utilities — LLM providers, evaluation metrics, visualization, and report generation. Used as an in-house dependency across all of Sameer Maurya's ML projects and organization. Source repo: the-forge — kept its original name; only the installable package was renamed to meerax.

CI gates on mypy (strict = true, with 2 narrowly-scoped # type: ignore exceptions for known third-party stub gaps) and a minimum 85% test coverage — both enforced on every PR, not just checked locally.

Supports Python 3.9+ (requires-python = ">=3.9"). CI itself runs and is verified against Python 3.12 only — no version matrix — but installs and the full test suite have been manually verified clean on 3.9, 3.10, 3.11, and 3.12 before each release that touches this floor.

Install

pip install meerax

Or pin in requirements.txt:

meerax==1.10.3

Modules

Module What it gives you
meerax.llm Swap-in LLM backends — Claude, OpenAI, Ollama behind one interface, text or images
meerax.eval.classification F1, AUC-ROC, precision, recall in one call
meerax.eval.timeseries RMSE, MAPE, SMAPE, ADF stationarity test
meerax.eval.text BLEU-4, ROUGE-L for caption / summary quality
meerax.eval.recommender Precision@K, MAP@K for ranked recommendation lists
meerax.viz Dark-themed matplotlib plots (confusion matrix, ROC, forecast, decomposition)
meerax.data CSV/parquet loaders with schema validation, stratified + time splits, SMOTE
meerax.report Self-contained dark-themed HTML model-card report builder
meerax.logging One-call structured logger factory
meerax.vision Image folder dataset loader (PyTorch) + translation-grid plotting (torch or numpy/TF images)

Scaffolding Projects

Every project in the ecosystem follows the same PROJECT_STANDARDS.md layout and depends on meerax. The meerax CLI (installed alongside the package) generates or retrofits that layout:

# brand-new project
meerax new my-project --path ~/dev

# retrofit an existing, non-empty directory — additive only, never overwrites
cd ~/dev/my-existing-notebook-project
meerax init

meerax new creates the full src/{core,providers,services,utils,data} + tests/ + CI skeleton, pins requirements.txt to the current meerax release, and runs git init. The generated ci.yml calls this repo's reusable CI workflow instead of embedding its own copy, so fixes to the shared CI logic reach every project that uses it without needing to be manually reapplied. Also generates .github/dependabot.yml (pip + github-actions, weekly) so dependency pins don't quietly go stale.

Both new and init accept --template llm-report, which adds a real, runnable example on top of the bare skeleton — the "call an LLM, build an HTML report" shape that's shown up twice already (trend-whisperer, pixel-drift). It's genuinely functional code with real tests, not stub methods to fill in:

meerax new my-app --template llm-report
cd my-app && pip install -r requirements.txt
python -m src.app --prompt "Summarize this quarter's churn" --llm-provider ollama

meerax init fills in whatever's missing from that same layout without touching files that already exist, and reports any top-level files it doesn't recognize (e.g. notebooks) so you can move them into src/ by hand.

meerax doctor checks an existing project against PROJECT_STANDARDS.md — no Python version matrix, no committed docs/specs/docs/plans, a LICENSE file, VERSION/README/CHANGELOG consistency, Dependabot configured, and whether the project's meerax pin is current:

cd ~/dev/my-project
meerax doctor

Exits non-zero if anything fails, so it's safe to run in CI.

meerax bump <version> updates VERSION, the README version badge, and inserts a dated CHANGELOG heading in one step — the exact multi-file edit that's caused version-badge drift more than once across this ecosystem's history:

meerax bump 1.2.0

It doesn't write CHANGELOG content or a compare-link footer — those need someone who actually knows what changed.

Docker

meerax is a library and scaffolding CLI, not a batch pipeline — the image runs the meerax command directly, mounting your current directory as /workspace so scaffolded projects land on the host:

docker compose build
docker compose run --rm meerax new my-project
docker compose run --rm meerax doctor

The container writes files as its own meerax user; if that leaves generated files owned by a different UID than your host user, add -u "$(id -u):$(id -g)" to the docker compose run invocation. No .env/secrets are needed — the CLI's new/init/doctor/bump subcommands don't read any environment variables.

Quick Start

from meerax.llm import ClaudeProvider, PromptTemplate
from meerax.eval import evaluate_classifier
from meerax.viz import apply_meerax_theme
from meerax.report import ReportBuilder, ReportSection

# LLM: swap provider without changing downstream code
llm = ClaudeProvider()                         # or OpenAIProvider() / OllamaProvider()
tpl = PromptTemplate("Explain {finding} to a risk manager in 3 sentences.")
response = llm.generate(tpl.render(finding="high AUC-ROC with low recall"))

# Eval
metrics = evaluate_classifier(y_true, y_pred, y_prob=probabilities)
print(metrics)
# Accuracy : 0.9823
# F1       : 0.8741
# AUC-ROC  : 0.9912

# Viz + Report
apply_meerax_theme()
rb = ReportBuilder("Fraud Detection — Model Report v0.1.0")
rb.add_section(ReportSection(
    title="Performance",
    metrics=metrics.to_dict(),
    content=response.content,
))
rb.save("reports/model_report.html")

LLM Provider Interface

All providers implement LLMProvider.generate() and .chat(). Swap with one line:

from meerax.llm import ClaudeProvider, OpenAIProvider, OllamaProvider

llm = ClaudeProvider()    # needs ANTHROPIC_API_KEY
llm = OpenAIProvider()    # needs OPENAI_API_KEY
llm = OllamaProvider()    # needs Ollama running locally

Benchmarks

Self-contained benchmark scripts in benchmarks/:

Script Description
meerax_benchmark.py Times meerax's own core operations — CSV loading, data splitting, classification/timeseries eval metrics, HTML report generation — across representative sizes
kv_cache_benchmark.py KV caching simulation at GPT-2 Medium scale
python benchmarks/meerax_benchmark.py            # print results
python benchmarks/meerax_benchmark.py --record   # also append to benchmarks/results/history.jsonl

--record appends one JSON line per run, keyed by the installed meerax version, so performance can be compared release to release. Run it as part of cutting a release, alongside meerax bump, and commit the updated history.jsonl in the same commit. A GitHub Actions workflow (.github/workflows/benchmarks.yml) also runs it on demand (workflow_dispatch) and uploads the results as a build artifact — informational only, not a required CI check, since wall-clock timings on shared runners are too noisy to gate on.

Project Structure

the-forge/
├── meerax/              # Installable package
│   ├── llm/            # LLM provider abstraction
│   ├── eval/            # Evaluation metrics
│   ├── viz/             # Visualization utilities
│   ├── data/            # Data loading, splitting, resampling
│   ├── report/          # HTML report builder
│   ├── scaffold/        # Project skeleton templates + create/retrofit logic
│   ├── cli.py           # `meerax new` / `init` / `doctor` / `bump` command entry point
│   ├── doctor.py        # PROJECT_STANDARDS.md compliance checks
│   ├── release.py       # VERSION/README badge/CHANGELOG bump helper
│   ├── vision/          # Image dataset loader + translation-grid plotting
│   └── logging.py       # Structured logger
├── benchmarks/          # meerax's own perf benchmarks + standalone ML demo scripts
│   └── results/         # history.jsonl — one line per --record run, tracked across releases
├── tests/
│   ├── unit/            # 152 unit tests, zero external deps
│   └── integration/     # 4 cross-module pipeline tests
├── ARCHITECTURE.md
├── SECURITY.md
├── LICENSE
├── pyproject.toml
├── requirements.txt
├── Dockerfile
├── docker-compose.yml
└── VERSION

sameer-portfolio · mauryasameer.com

Release files for meerax 1.10.4

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

Source distribution (sdist)

Source distribution for meerax 1.10.4
File Size Uploaded
meerax-1.10.4.tar.gz 30.8 kB Details

Built distribution (wheel)

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

Total release size: 65.3 kB

Release files / meerax-1.10.4.tar.gz

Download URL meerax-1.10.4.tar.gz
Size 30.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5183158e7c45c4a550c520a681150f4df96efb8c9795055cc802e5bd7976859a
BLAKE2b-256 checksum
How to use checksums
d89a678a42319a2ea73e949397fa9ac9d6f9ed8fc3fcc74462235b3c1d8fc628
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 17, 2026.

Transparency log

Release files / meerax-1.10.4-py3-none-any.whl

Download URL meerax-1.10.4-py3-none-any.whl
Size 34.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fc4b8fb3d2d1a839cecf2129260f99207b48c2525a6435248310f2f1b867143d
BLAKE2b-256 checksum
How to use checksums
9eddd9d19868a9b00f14f75f14c112f303e0e3cd1e67825a4dd27317cf8699a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.10.4 This release

2 release files

1.10.3

2 release files

1.10.2

2 release files

1.10.1

2 release files

1.9.1

2 release files

1.9.0

2 release files

1.8.0

2 release files

1.7.4

2 release files

1.7.3

2 release files

1.7.2

2 release files

1.7.1

2 release files

1.7.0

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

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