Python client library for the MIMaaS (Microcontroller Model as a Service) API. Submit TensorFlow Lite models, benchmark them on real microcontroller hardware, and get back detailed performance metrics — all without touching a single board.
pip install -e .With power analysis visualization:
pip install -e ".[viz]"from mimaas import MIMaaSClient
client = MIMaaSClient()
client.login("your_username", "your_password")
# Submit a model for evaluation
request = client.submit_request("model.tflite", "nrf5340dk")
# Wait for results
results = client.wait_for_completion(request.id)
print(results)Output:
Results:
Inference Time: 12.34 ms
Energy: 45.67 µJ
Power: 3702.10 µW
RAM: 48.2 KB
Flash: 112.5 KB
The client resolves settings in this order (first match wins):
| Priority | Source | Example |
|---|---|---|
| 1 | Constructor arguments | MIMaaSClient(api_url="...") |
| 2 | Environment variables | MIMAAS_API_URL, MIMAAS_API_TOKEN, MIMAAS_TIMEOUT |
| 3 | Config file | ~/.mimaas/config.yaml |
| 4 | Defaults | Built-in defaults |
Config file example (~/.mimaas/config.yaml):
api_url: https://api.mimaas.com
timeout: 120# Register a new account
client.register(
username="johndoe",
email="john@example.com",
first_name="John",
surname="Doe",
password="secure_password",
plan="free"
)
# Check your profile and remaining runs
profile = client.get_profile()
print(f"Runs remaining: {profile.available_runs}")
# View available plans
plans = client.list_plans()boards = client.list_boards()
for board in boards:
print(board)
# Check a specific board
board = client.get_board("nrf5340dk")
status = client.get_board_status("nrf5340dk")# Validate before submitting (does not consume a run)
result = client.validate_model("model.tflite", "nrf5340dk")
# Submit for evaluation
request = client.submit_request("model.tflite", "nrf5340dk", quantize=False)
# Poll manually
req = client.get_request(request.id)
print(req.status) # "pending" | "processing" | "done" | "error"
# Or block until done
results = client.wait_for_completion(request.id, timeout=600)
# List past requests
all_requests = client.list_requests()
done = client.list_requests(status="done", board="nrf5340dk")client.download_ram_report(request.id, "ram.json")
client.download_rom_report(request.id, "rom.json")
client.download_power_summary(request.id, "ppk2_summary.csv")
client.download_power_samples(request.id, "ppk2_samples.csv")
client.download_model(request.id, "model.tflite")
# Or grab everything at once
client.download_all_artifacts(request.id, "artifacts.zip")Requires the viz extra (pip install -e ".[viz]").
from mimaas.viz import plot_power_analysis
fig = plot_power_analysis("ppk2_samples.csv")
fig.show()Generates an interactive Plotly dashboard with current draw over time, distribution histograms, and per-inference statistics.