{"id":21512,"library":"label-studio-ml","title":"Label Studio ML Backend","description":"Label Studio ML backend library for building, training, and deploying machine learning models with Label Studio. Version 1.0.9 supports Python >=3.6, released irregularly. Integrates with Label Studio for interactive labeling with model predictions.","status":"active","version":"1.0.9","language":"python","source_language":"en","source_url":"https://github.com/heartexlabs/label-studio-ml-backend","tags":["label-studio","machine-learning","ml-backend","data-labeling"],"install":[{"cmd":"pip install label-studio-ml","lang":"bash","label":"Install last stable"}],"dependencies":[],"imports":[{"note":"Incorrect import path from older docs or typos.","wrong":"from label_studio.ml import LabelStudioMLBase","symbol":"LabelStudioMLBase","correct":"from label_studio_ml.model import LabelStudioMLBase"},{"note":"Utility function to resolve local file paths from data URIs.","wrong":"","symbol":"get_local_path","correct":"from label_studio_ml.utils import get_local_path"}],"quickstart":{"code":"from label_studio_ml.model import LabelStudioMLBase\nfrom label_studio_ml.utils import get_local_path\n\nclass MyModel(LabelStudioMLBase):\n    def predict(self, tasks, context, **kwargs):\n        return [{\"result\": []}]\n\n    def fit(self, completions, workdir=None, **kwargs):\n        pass","lang":"python","description":"Basic skeleton for a Label Studio ML backend model."},"warnings":[{"fix":"Ensure predict() returns a list of dictionaries, each containing 'result' (list of annotation results).","message":"LabelStudioMLBase is the correct base class; avoid custom inheritance from sklearn-like classes directly. Predictions must be a list of dicts with 'result' key.","severity":"gotcha","affected_versions":"all"},{"fix":"Use Label Studio web interface to generate config, or pass a LabelConfig string via label_config in init.","message":"The old config system using label_config.xml is deprecated; use XML or JSON config from project settings.","severity":"deprecated","affected_versions":"<1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run pip install label-studio-ml and import as 'label_studio_ml'.","cause":"Package not installed or installed as 'label-studio-ml' but imported with wrong name.","error":"ModuleNotFoundError: No module named 'label_studio_ml'"},{"fix":"Define predict(self, tasks, **kwargs) returning list of dicts.","cause":"Method signature mismatch: predict(tasks, **kwargs) is required.","error":"TypeError: predict() missing 1 required positional argument: 'tasks'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}