Skip to main content

CLI and Python client for SWECC BenchAnything / Mesocosm (mesocosm + bench commands).

Project description

swecc-mesocosm

CLI and Python client for SWECC's BenchAnything / Mesocosm platform.

pip install swecc-mesocosm
mesocosm --help

One package, one command (mesocosm). There is no separate bench binary or swecc-bench on PyPI.

Env author quick start

mkdir my-env && cd my-env
mesocosm init

ollama pull llama3.2
python adapter.py          # terminal 1
mesocosm run local         # terminal 2 — Ollama + benchanything.json, no submit

When ready for the platform: mesocosm auth loginmesocosm env submitmesocosm run create. See LOCAL_DEV.md in your repo after mesocosm init.

Command overview

Area Examples
Local env / Ollama mesocosm init, mesocosm run local
Auth & teams mesocosm auth login, mesocosm team create
Submit repo mesocosm env submit --github-url …
Platform runs mesocosm run create, mesocosm run export RUN_ID
Domain helpers mesocosm suggest, mesocosm validate, mesocosm register
Bench-api eval mesocosm doctor, mesocosm eval test, mesocosm run get

See PACKAGING.md in this directory for how bench_common is bundled and how mesocosm run routes local vs platform subcommands.

Install (dev)

pip install -e ./packages/swecc-mesocosm

Configure

export MESOCOSM_BASE_URL=https://api.swecc.org/bench   # production
mesocosm doctor

Default: http://127.0.0.1:8010 (docker compose). See infra/mesocosm.env.example in the monorepo.

Python client

import asyncio
from swecc_mesocosm import BenchClient

async def main():
    c = BenchClient(base_url="http://127.0.0.1:8010")
    try:
        domains = await c.list_domains(published_only=True)
        print(len(domains), "published")
    finally:
        await c.aclose()

asyncio.run(main())

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

swecc_mesocosm-0.2.2-py3-none-any.whl (75.9 kB view details)

Uploaded Python 3

File details

Details for the file swecc_mesocosm-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: swecc_mesocosm-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 75.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for swecc_mesocosm-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e6dc7f2c48aab52b246b64d8c4db2a1a94c08dddc108b6ec888b9cd03da8e2a2
MD5 2b99bdd0beeb076ffa9c00d0a8d4ca86
BLAKE2b-256 f4b1705b010034952daec17c2484b494d27ab0da4956ffa526c6cab36386a049

See more details on using hashes here.

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