Skip to main content

xlmtec

PyPI version Python License

xlmtec is a command-line toolkit for fine-tuning large language models. Describe your task in plain English, get a ready-to-run config, browse HuggingFace models, and train — all from the terminal.


Features

  • AI-powered config generation — describe your task, get a YAML config from Claude, Gemini, or GPT
  • Model Hub browser — search and inspect HuggingFace models without leaving the terminal
  • 5 fine-tuning methods — LoRA, QLoRA, Full, Instruction, DPO
  • Config validation — catch errors before training starts
  • Dry-run mode — preview your training plan without loading a model
  • Rich terminal UI — progress bars, panels, colour output throughout

Installation

# Core (lightweight — no ML deps)
pip install xlmtec

# With training support
pip install xlmtec[ml]

# With AI suggestions (pick your provider)
pip install xlmtec[claude]    # Anthropic
pip install xlmtec[gemini]    # Google
pip install xlmtec[codex]     # OpenAI
pip install xlmtec[ai]        # All three

# Everything
pip install xlmtec[full]

Quickstart

1. Get an AI-generated config

xlmtec ai-suggest "fine-tune a small model for customer support" --provider claude

Outputs a ready-to-run YAML config and the exact command to run.

2. Browse models on HuggingFace

xlmtec hub search "bert" --task text-classification --limit 5
xlmtec hub trending
xlmtec hub info google/bert-base-uncased

3. Validate your config

xlmtec config validate config.yaml

4. Train

# Preview without loading model
xlmtec train --config config.yaml --dry-run

# Start training
xlmtec train --config config.yaml

Commands

Command Description
xlmtec ai-suggest "<task>" Generate a config from plain English
xlmtec hub search "<query>" Search HuggingFace models
xlmtec hub info <model-id> Show model details
xlmtec hub trending Top trending models
xlmtec config validate <file> Validate a YAML config
xlmtec train --config <file> Fine-tune a model
xlmtec train --config <file> --dry-run Preview training plan
xlmtec recommend Get method recommendation for your hardware
xlmtec evaluate Evaluate a fine-tuned model
xlmtec benchmark Compare multiple runs
xlmtec merge Merge LoRA adapter into base model
xlmtec upload Upload model to HuggingFace Hub
xlmtec --version Show installed version

Fine-tuning methods

Method VRAM Best for
lora Low (4–8 GB) Most tasks, fast convergence
qlora Very low (4 GB) Large models on limited hardware
full High (24 GB+) Best quality, small models
instruction Low (4–8 GB) Prompt/response style tasks
dpo Low (4–8 GB) Preference learning from pairs

AI Providers

Set your API key as an environment variable, then pass --provider:

export ANTHROPIC_API_KEY=sk-ant-...
xlmtec ai-suggest "summarise legal documents" --provider claude

export GEMINI_API_KEY=...
xlmtec ai-suggest "summarise legal documents" --provider gemini

export OPENAI_API_KEY=sk-...
xlmtec ai-suggest "summarise legal documents" --provider codex

Example config

model:
  name: gpt2

dataset:
  source: local_file
  path: data/train.jsonl

lora:
  r: 16
  alpha: 32
  target_modules: [c_attn]

training:
  output_dir: output/run1
  num_epochs: 3
  batch_size: 4
  learning_rate: 2e-4

Development

git clone https://github.com/Abdur-azure/xlmtec.git
cd xlmtec
pip install -e ".[full,dev]"
pytest tests/ -v --ignore=tests/test_integration.py

Changelog

See CHANGELOG.md for full release history.

License

MIT

Release files for xlmtec 3.27.0

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

Source distribution (sdist)

Source distribution for xlmtec 3.27.0
File Size Uploaded
xlmtec-3.27.0.tar.gz 153.5 kB Details

Built distribution (wheel)

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

Total release size: 302.5 kB

Release files / xlmtec-3.27.0.tar.gz

Download URL xlmtec-3.27.0.tar.gz
Size 153.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ff2e525a7c1b8c3f102564482ca4317b56d44a9fe43cd473f3b5316eb6bd0947
BLAKE2b-256 checksum
How to use checksums
fd699b851f2de42ffc75348d7ecd5144f837c9ce2e2f3d02455e778e1fc809b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release files / xlmtec-3.27.0-py3-none-any.whl

Download URL xlmtec-3.27.0-py3-none-any.whl
Size 149.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a11684669aa15249be7194b3b2f80c6435027799d1e6097adce664df04a83cb
BLAKE2b-256 checksum
How to use checksums
b6661e69a470ae607c28a179596f19c763bce3e20f247e59cdcbea8ec18e7379
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release history Release notifications | RSS feed

This release

3.27.0 This release

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