Logo: Ml4t Production Readiness

Ml4t Production Readiness

Organisatioun
ml4t
ml4t-production-readiness

Pre-deployment checklist covering data pipelines, risk limits, monitoring, and governance. Use when preparing to go live with a new strategy or model.

Iwwersiicht

Editeurml4t
Repositoryskills
Skill-Nummml4t-production-readiness
Stären
45
Forks
13
Matgeliwwert Dateien
Nëmmen Instruktiounen
LizenzApache-2.0
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    ml4t huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Ml4t Production Readiness an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/ml4t/skills/tree/main/workflows/production-readiness
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ml4t/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/workflows/production-readiness .claude/skills/ml4t-production-readiness
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Ml4t Production Readiness an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Ml4t Production Readiness automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Ml4t Production Readiness net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Production Readiness

A validated backtest is not a production system. The gap between "model works" and "strategy can run unattended with real money" requires infrastructure that most teams skip until the first incident.

The Problem

A team deploys a model that passed validation. On day three, the data vendor has an outage. The model receives stale prices, generates signals, and the execution system submits orders on bad data. There is no kill switch, no staleness check, no alert. By the time someone notices, the strategy has lost two months of expected returns in a single session. Every production failure traces back to missing infrastructure, not bad models.

The Pattern

WRONG

python
# Model works in backtest - deploy directly
import pickle
from broker_api import submit_orders

model = pickle.load(open("best_model.pkl", "rb"))
data = fetch_latest_data()
signals = model.predict(data)
orders = signals_to_orders(signals)
for order in orders:
    submit_orders(order)  # No limits, no monitoring, no kill switch

CORRECT

python
# Five infrastructure layers before any live order
import datetime as dt

# Layer 1: DATA PIPELINE - validate freshness and integrity
latest_ts = data_store.get_latest_timestamp()
staleness = dt.datetime.now(dt.timezone.utc) - latest_ts
assert staleness < dt.timedelta(hours=2), f"Data stale: {staleness}"
assert data_store.validate_schema(), "Schema mismatch - pipeline broken"

# Layer 2: MODEL VERSIONING - reproducibility and audit trail
model_hash = compute_model_hash(model_path)
assert model_hash == registry.get_deployed_hash(), "Model hash mismatch"
assert registry.get_training_date(model_hash) > dt.date(2025, 6, 1), "Model too old"

# Layer 3: RISK LIMITS - hard limits that cannot be overridden by signals
risk_config = {
    "max_position_pct": 0.05,       # No single position > 5% of portfolio
    "max_sector_pct": 0.25,         # No sector > 25%
    "max_daily_turnover": 0.20,     # Max 20% daily turnover
    "max_drawdown_halt": 0.10,      # Halt trading at 10% drawdown
    "max_gross_leverage": 1.5,      # Hard leverage cap
}

# Layer 4: MONITORING - detect problems before they compound
# → Use ml4t-drift-detection for feature/prediction distribution shifts
# → Use ml4t-risk-metrics for rolling drawdown and exposure tracking
# Alerts fire on: data staleness, drift PSI > 0.25, drawdown > threshold

# Layer 5: KILL SWITCH - automated and manual halt capability
# → Use ml4t-kill-switch for implementation
# Kill switch triggers: max drawdown, data staleness, model drift, manual override
# Kill switch action: flatten all positions, cancel open orders, alert team

Five Readiness Layers

LayerWhat It CoversFailure Without It
Data pipelineFreshness, schema validation, fallback sourcesTrading on stale or corrupted data
Model versioningHash verification, training metadata, feature configDeploying wrong model, irreproducible results
Risk limitsPosition, sector, leverage, drawdown hard limitsUnbounded loss from signal errors
MonitoringDrift detection, performance tracking, alertingProblems compound for hours/days before detection
Kill switchAutomated halt + manual override + flatten capabilityCannot stop bleeding when something breaks

Paper Trading Gate

No strategy goes live without minimum 4 weeks of paper trading covering at least one rebalance cycle. Paper trading validates order generation, fill assumptions, data pipeline reliability, and monitoring/alerting behavior.

Guardrails

  • If you cannot explain exactly which model version is running, do not trade live
  • If the kill switch has not been tested (triggered and verified), it does not work
  • If data fallback has not been tested by simulating a source outage, assume it will fail
  • If drawdown limits exist only in code you can override, they are not real limits
  • If there is no on-call rotation or incident playbook, the first production issue will be chaotic

Production Implementation

ml4t-live provides the infrastructure for safe live deployment:

python
import asyncio
from ml4t.backtest import Strategy  # Same Strategy class as backtest
from ml4t.live import AlpacaDataFeed, AlpacaBroker, LiveEngine, LiveRiskConfig, SafeBroker

risk = LiveRiskConfig(execution_mode="shadow", max_drawdown_pct=0.10)
broker = SafeBroker(AlpacaBroker(api_key, secret_key), risk)  # pre-trade limits and kill switch
feed = AlpacaDataFeed(api_key, secret_key, symbols=["SPY"], experimental=True)
engine = LiveEngine(MyStrategy(), broker, feed)  # run() is a coroutine
asyncio.run(engine.run())

Checklist

  • Data pipeline validates freshness (staleness < threshold) and schema on every run
  • Fallback data source tested by simulating primary source failure
  • Deployed model hash matches training registry entry
  • Feature pipeline is identical between training and production (no train/serve skew)
  • Hard risk limits set; sector and leverage caps enforced outside LiveRiskConfig
  • Kill-switch drill: it latches, close_all_positions() flattens, your pager fires
  • Monitoring dashboards operational with alerts for drift, drawdown, staleness
  • Paper trading completed for minimum 4 weeks with no execution anomalies
  • Incident playbook and governance sign-off completed before go-live

Heefeg gestallte Froen

Wat mécht de KI-Skill Ml4t Production Readiness?

Pre-deployment checklist covering data pipelines, risk limits, monitoring, and governance. Use when preparing to go live with a new strategy or model.

Firwat Ml4t Production Readiness op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Ml4t Production Readiness besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Ml4t Production Readiness an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/ml4t/skills/tree/main/workflows/production-readiness an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Ml4t Production Readiness benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Ml4t Production Readiness benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Ml4t Production Readiness domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Ml4t Production Readiness gratis?

Jo. ml4t huet de Skill ënner der Lizenz Apache-2.0 op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇