mosaic-bench
Run the MOSAIC benchmark — nine validated psychometric questionnaires and four ethical dilemmas — against any LLM. Test data is pulled directly from the MOSAIC repository at a pinned commit and cached locally, so there is nothing to download by hand.
Install
pip install "mosaic-bench[openai]" # OpenAI, Groq, DeepSeek, vLLM, Ollama, ...
pip install "mosaic-bench[hf]" # HF Inference Providers
pip install "mosaic-bench[local]" # offline, via transformers
Run
export OPENAI_API_KEY=sk-...
mosaic --model gpt-4o --test mfq2 sdo --runs 10
Or pass the key inline:
mosaic --model gpt-4o --api-key sk-... --test mfq2
Any OpenAI-compatible endpoint works without code changes:
mosaic --backend openai --model qwen/qwen3-32b \
--base-url https://api.groq.com/openai/v1 --api-key gsk_...
mosaic --backend openai --model my-finetune \
--base-url http://localhost:8000/v1 --api-key dummy # local vLLM
Anything on the Hub:
export HF_TOKEN=hf_...
mosaic --backend hf --model meta-llama/Llama-3.3-70B-Instruct --test mfq2
Fully offline, no keys:
mosaic --backend local --model Qwen/Qwen3-8B --test mfq2 --runs 3
Output
mfq2 — gpt-4o
authority 21.00 ± 1.00
care 24.33 ± 2.08
equality 19.67 ± 5.13
! 2.1% of answers imputed — {'ok': 340, 'unparsable': 8}
Two files per test under results/<model>/:
<test>_<variant>.jsonl— one record per invocation: raw response, run index, temperature, timestamp, provider status.<test>_<variant>_scored.jsonl— the same records plusparsed_score,parse_statusandimputed.
Runs are resumable: re-running the same command skips (item, run) pairs already
on disk, and raising --runs only fills in the missing repetitions.
Python API
from mosaic_bench import build_backend, run_test
backend = build_backend("gpt-4o", api_key="sk-...")
summary = run_test(backend, "mfq2", runs=10)
print(summary["scores"], summary["quality"])
Notes on scoring
- Answers are parsed leniently but validated against each test's declared range; out-of-range values are rejected rather than accepted.
- Unparsable answers are imputed with the test's neutral score, and the imputed fraction is reported alongside every result.
- Provider content filters are recorded as
content_filteredand excluded from aggregation — never converted into a score. - Reverse-keyed items are flipped using
scale_min + scale_max.
Publishing
Until this is on PyPI, it installs straight from the repository:
pip install "git+https://github.com/EricaCoppolillo/MOSAIC#egg=mosaic-bench[openai]"
To publish to PyPI, from the package root:
python -m build
python -m twine upload dist/*
Prefer PyPI Trusted Publishing over an API token: it authenticates the GitHub Actions workflow via OIDC, so no long-lived secret lives in the repo. Configure the publisher once at pypi.org/manage/account/publishing/, then tag a release.
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 mosaic_llm_bench-0.1.0.tar.gz.
File metadata
- Download URL: mosaic_llm_bench-0.1.0.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef2f15045bf257c458219afef46f14adb57d791a7f18f64bcb63aae61822d4d6
|
|
| MD5 |
db8c56f95f6b0526f68fc992f7c2ddc7
|
|
| BLAKE2b-256 |
94f186e8b617ecf188d6a34e8a59d5fdd414f5acfe43a3a7d871aaca272e6f6d
|
File details
Details for the file mosaic_llm_bench-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mosaic_llm_bench-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4469da66a2ba37522ddd5edf9bdf9eb543a69f676b3cd8f3d52ee249122760f3
|
|
| MD5 |
85fd992d6a140f8db187696b3e6f5776
|
|
| BLAKE2b-256 |
b9eedf70a05afaafddc138899bc2ae2f01f809c681c7861291ae02093c46918d
|