Skip to main content

Local LLM Inference Platform with adapter support and evaluation toolkit

Project description

ML-Clara

ML-Clara is a small, config-driven CLI + Python API for:

  • Local LLM inference with streaming (clara run)
  • Performance benchmarking (clara bench)
  • Benchmark evaluation (clara eval)
  • LoRA fine-tuning (clara train) and adapter merging (clara export)
  • Device auto-detection (MPS/CUDA/CPU)

This repository also contains Apple’s CLaRa research codebase; ML-Clara lives in the clara/ package.


Install

pip install ml-clara
clara info

If your platform needs a specific PyTorch build, install PyTorch first, then install ML-Clara.


Quickstart

Run

clara run "Explain LoRA in one paragraph" --model gpt2
clara run "Write a haiku about debugging" --model gpt2 --stream

Create a config (recommended)

clara init-config --type default -o config.yaml
clara run "Hello" --config config.yaml

Eval

clara eval --model gpt2 --benchmarks perplexity --samples 50

Bench (performance)

clara bench --model gpt2 --trials 3 --warmup 1

Fine-tune (LoRA)

clara init-config --type finetune -o finetune.yaml
clara train --config finetune.yaml

Web UI (FastAPI)

pip install "ml-clara[server]"
clara serve --model gpt2

Then open http://127.0.0.1:8000.

The server also exposes OpenAI-compatible endpoints (for Open WebUI/LangChain):

  • GET /v1/models
  • POST /v1/chat/completions (supports stream: true via SSE)

GGUF / llama.cpp (inference-only)

Run .gguf models via llama.cpp using the optional GGUF backend:

pip install "ml-clara[gguf]"
clara run "Hello" --model /path/to/model.gguf --stream
clara serve --model /path/to/model.gguf

Local checksum verification (optional)

Verify local model artifacts with SHA256 (useful for .gguf files and local model dirs):

model:
  local_path: /path/to/model.gguf
  sha256: "0123... (64 hex chars)"

Export (merge adapter)

clara export outputs/my-adapter/final --output models/merged

Docs

  • Troubleshooting: docs/TROUBLESHOOTING.md
  • Benchmarking: docs/BENCHMARKING.md
  • Full repository README (CLaRa research + ML-Clara section): README.md

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

ml_clara-1.5.0.tar.gz (72.9 kB view details)

Uploaded Source

Built Distribution

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

ml_clara-1.5.0-py3-none-any.whl (77.7 kB view details)

Uploaded Python 3

File details

Details for the file ml_clara-1.5.0.tar.gz.

File metadata

  • Download URL: ml_clara-1.5.0.tar.gz
  • Upload date:
  • Size: 72.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.8

File hashes

Hashes for ml_clara-1.5.0.tar.gz
Algorithm Hash digest
SHA256 507df787a1d5cbb7b3f53754c16bced8c803c7aef60364505346f8d10b3cc4c3
MD5 7734a8ae5c813b440e9d0c5e7863bee8
BLAKE2b-256 2bbd317b7273f0f1a9d980fd5dfc30bb1cc4cd4bfdb454cadd1d5cbf7cbde6d9

See more details on using hashes here.

File details

Details for the file ml_clara-1.5.0-py3-none-any.whl.

File metadata

  • Download URL: ml_clara-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 77.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.8

File hashes

Hashes for ml_clara-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f8adbe11b77346445c5d83a726d39771702986a543900cdec4b20734f4fc5db
MD5 7040aa7a080f2b99028e50a5a060f26b
BLAKE2b-256 2697df589dacf6cdda269cb8f60fb3a99092464932986db5ac613bef02b003f5

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