/ Модель

Характеристики

Лицензия
Своя лицензия
Архитектура
lfm2_vl · dense
Базовая модель
d1-3B
Библиотека
transformers
Опубликована
19 окт 2026

d1-3b-cli-command-risk

Классификация текстаТекст → label4 профессии

Дообученная модель оценивает риск shell-команд и выдаёт вероятности по 17 вопросам для защитных проверок перед выполнением.

26скачиваний за 30 дней0лайковвеса обновлены21 окт 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Модель yannelli/d1-3b-cli-command-risk разработана Райаном Яннелли и представляет собой дообученную LiquidAI/d1-3B — модель семейства LFM2.5-VL-3B с механизмом принятия решений d1. Она оценивает риск shell-команды до выполнения: получает команду, тип оболочки и набор именованных вопросов, затем за один проход выдаёт вероятностные ответы на 17 вопросов, не генерируя текст.

Модель предназначена для защитных проверок в терминалах и инструментах для программирования: по её оценкам можно блокировать команду или запрашивать подтверждение, а также показывать категории риска, обратимость последствий и необходимость прав root. Чекпойнт содержит 3,1 млрд параметров, представлен в формате bf16 и требует около 6,2 ГБ для весов. В метаданных указаны английский язык и лицензия other.

На тестовой выборке датасета CLI Command Risk модель показала macro F1 0,929 по категориям риска и точность 0,963 по решениям. Оценка уровня риска менее надёжна: её точность составляет 0,756, особенно слабы результаты для уровней low и high. Разметка основана на оценках языковых моделей, а не только на человеческой экспертизе; модель оценивает команду саму по себе, без сведений о машине и окружении. README не раскрывает условия лицензии подробнее.

Сценарии применения

  • проверка команды перед запуском в терминале
  • блокировка потенциально опасных команд по порогу риска
  • запрос подтверждения перед выполнением рискованной команды
  • определение категорий риска и вероятности уничтожения данных
  • оценка обратимости последствий команды
  • проверка необходимости прав root для команды

Ограничения

Уровни риска предсказываются заметно хуже, чем категории: точность уровня составляет 0,756, а F1 для low и high — 0,257 и 0,508. Метки получены с помощью языковых моделей, а оценка не учитывает состояние машины и окружения; лицензия указана как other без подробных условий в README.

Для каких профессий подходит4

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

A newer version is available: d1-3B CLI Command Risk v1.5, trained on the dataset revision tagged v1.5. This v1 model was trained on the revision tagged v1.

d1-3B CLI Command Risk: LiquidAI’s d1-3B, fine-tuned to answer 17 typed questions about a shell command before it runs.

d1-3B CLI Command Risk

A decision model that rates the risk of a shell command before it runs. Give it a command and its shell, and it answers 17 typed questions with probabilities: the risk level from safe to critical, whether the command is risky, which of 13 risk categories apply, whether the effect can be undone without backups, and whether the harm needs root. It reads the command once and answers all 17 questions as branches of one forward pass, without generating text.

It is LiquidAI/d1-3B fine-tuned on CLI Command Risk. On that dataset's test split it scores macro F1 0.929 over the risk categories and accuracy 0.963 over 215,713 decisions. At a cutoff that flags 1% of safe validation commands, it flags 99.9% of high and critical test commands.

Base modelLiquidAI/d1-3B, LFM2.5-VL-3B with Liquid AI's d1 decision readout
Parameters3.1B (bf16, 6.2 GB)
InputA state with shell and command, and named questions
OutputP(yes) for yes/no questions; a distribution over levels for risk_level
Training dataCLI Command Risk, train split, 12,383 commands from 727 template families
Test resultsCategory macro F1 0.929 (cutoff 0.5), risk level macro F1 0.669, accuracy 0.963, ECE 0.030
LicenseLFM Open License v1.0

Questions

questions.json holds the 17 questions in the System One schema. They are the same for every command. The criteria of risk_level and of each category carry the definitions from the dataset's taxonomy.json.

QuestionTypeAsksAnswer
risk_levelscoreHow much harm can running this shell command as written cause?Distribution over 5 levels, 0 safe to 4 critical
riskynoulIs this shell command risky to run as written?P(yes)
data_destructionnoulDoes this command carry data destruction risk?P(yes)
device_overwritenoulDoes this command carry device overwrite risk?P(yes)
overbroad_permissionsnoulDoes this command carry overbroad permissions risk?P(yes)
privilege_escalationnoulDoes this command carry privilege escalation risk?P(yes)
remote_code_executionnoulDoes this command carry remote code execution risk?P(yes)
unsafe_download_execnoulDoes this command carry unsafe download exec risk?P(yes)
resource_exhaustionnoulDoes this command carry resource exhaustion risk?P(yes)
credential_exposurenoulDoes this command carry credential exposure risk?P(yes)
irreversible_confignoulDoes this command carry irreversible config risk?P(yes)
history_log_tamperingnoulDoes this command carry history log tampering risk?P(yes)
network_disruptionnoulDoes this command carry network disruption risk?P(yes)
signal_killnoulDoes this command carry signal kill risk?P(yes)
shell_footgunnoulDoes this command carry shell footgun risk?P(yes)
reversiblenoulCan an average user undo the effect of this command without backups?P(yes)
requires_rootnoulDoes the harm from this command need root or sudo?P(yes)

The state's shell is one of bash, zsh, sh, dash, or fish. Risk level i is the i-th entry of the dataset's risk_levels (safe, low, moderate, high, critical).

Usage

pip install torch==2.14.1 transformers==5.19.0 huggingface_hub safetensors
import json

import torch
from huggingface_hub import hf_hub_download
from transformers import AutoModel

device = "cuda" if torch.cuda.is_available() else "cpu"
dtype = torch.bfloat16 if device == "cuda" else torch.float32
model = AutoModel.from_pretrained("yannelli/d1-3b-cli-command-risk",
                                  trust_remote_code=True, dtype=dtype).to(device)

# The 17 questions the model was trained on
questions = json.load(open(hf_hub_download("yannelli/d1-3b-cli-command-risk", "questions.json")))["questions"]

state = {"shell": "bash", "command": "dd if=/dev/zero of=/dev/sda"}
answers = model.system_one(state, questions)["answers"]
print(json.dumps(answers, indent=1))

The example is a test-split command the model did not see in training. Its gold labels are critical, data_destruction, device_overwrite, and requires_root. This model's answers, from the code above on CPU:

QuestionGoldThis model
risk_levelcriticalcritical (0.999)
riskyyesP(yes) 1.00
data_destructionyesP(yes) 0.98
device_overwriteyesP(yes) 1.00
The other 11 categoriesnoP(yes) 0.00
reversiblenoP(yes) 0.00
requires_rootyesP(yes) 1.00

system_one returns the System One answer shape. A noul answer is P(yes). A score answer has score (the expected level), confidence, probabilities over levels, and the legend with each level's definition. model.system_one_batch answers several commands in one call. The risk_level answer above, rounded, with the legend cut short:

{
 "type": "score",
 "score": 3.998,
 "confidence": 0.999,
 "probabilities": {
  "0": 0.0,
  "1": 0.0,
  "2": 0.0,
  "3": 0.0,
  "4": 0.999
 },
 "legend": {
  "0": "Safe. Ordinary read-only or routine command with no plausible path to data loss, privilege change, or system disruption.",
  "4": "Critical. Destroys a whole disk, filesystem, operating system, system directory, or home folder, or gives root-level control to any local user or remote party."
 }
}

On Apple Silicon set device = "mps" (not benchmarked). On CPU the model runs in float32. For faster CPU inference, or to run under llama.cpp or Ollama, use the GGUF builds.

The model accepts other questions in the same schema, but it was trained and evaluated only on these 17.

Results

Results cover all 12,689 rows of the test split: 97 template families and 2,551 distinct commands, each in up to five shells. Each command was one request with all 17 questions, scored with training/score_cli_decisions.py, which computes the same columns as the scorer of JS/TS Code Review Decisions.

ModelMacro F1 @ 0.5Level macro F1AccuracyLog lossBrierECESafe judged safe
d1-3B (this model)0.9290.6690.9630.1360.0420.0300.988
This model + temperature0.9290.6690.9630.0990.0370.0270.988
Train label frequencies (prior)0.0000.1010.8140.3980.1430.0701.000

Macro F1 averages F1 at a 0.5 cutoff over the 13 category questions. Level macro F1 averages F1 over the 5 risk levels, using the most likely level. Accuracy counts every decision. Safe judged safe is the share of the 4,296 safe test commands with P(risky) below 0.5.

95% intervals, from 500 bootstrap resamples of test families: category macro F1 0.707 to 0.984, level macro F1 0.464 to 0.789, accuracy 0.948 to 0.981, log loss 0.072 to 0.200. By question type its accuracy is 0.976 on the 16 nouls and 0.756 on risk_level.

Guardrail cutoff

For a guardrail, use P(not safe) = 1 - P(risk_level = 0). The cutoff that flags 1% of safe validation commands is 0.714. On test, that cutoff flags 99.9% of high and critical commands and 1.7% of safe commands.

Risk level

F1 by level: safe 0.989, low 0.257, moderate 0.860, high 0.508, critical 0.733. Most level errors are one level off. Eight template families hold 2,909 of the 3,097 wrong levels; the largest are:

  • find . -name * .php -delete (995 rows): labeled critical, predicted high.
  • chmod -R on system paths (537 rows): labeled critical, predicted high.
  • iptables -A INPUT -s <range> -j DROP (450 rows): labeled low, predicted high.
  • dd if=/dev/zero of=/dev/sda bs=512 count=1 (257 rows): labeled critical, predicted low.

Per question

QuestionTypeTest positivesAccuracyF1 @ 0.5Log lossECE
risk_levelscore0.7561.0910.186
riskynoul8,3930.9960.9970.0220.004
data_destructionnoul3,4670.9230.8760.1700.065
device_overwritenoul2,4000.9980.9940.0060.002
overbroad_permissionsnoul1,2911.0000.9980.0010.000
privilege_escalationnoul201.0001.0000.0000.000
remote_code_executionnoul2501.0001.0000.0000.000
unsafe_download_execnoul6201.0001.0000.0000.000
resource_exhaustionnoul3351.0001.0000.0020.002
credential_exposurenoul5101.0001.0000.0010.001
irreversible_confignoul6490.9560.6930.0540.032
history_log_tamperingnoul141.0000.8120.0020.000
network_disruptionnoul4601.0001.0000.0000.000
signal_killnoul331.0001.0000.0000.000
shell_footgunnoul1,7760.9340.7040.3160.063
reversiblenoul5,5760.8840.8590.3800.098
requires_rootnoul4,4950.9330.9110.2650.053

Calibration

Answers are the model's raw softmax (test ECE 0.030). temperatures.json holds one temperature per question, fitted on the 472 validation commands by log loss. Replacing each answer's distribution p with softmax(log p / T) moves test log loss from 0.136 to 0.099 and ECE from 0.030 to 0.027. It never changes the top answer or the order of P(yes) values, so F1 and accuracy stay the same.

Speed

Median wall-clock time for one command with all 17 questions, batch size 1.

HardwareRuntimeCommandsp50 per command
One A100 SXM 80GBPyTorch, bf1612,68944 ms
16 Neoverse V3 CPU coresllama.cpp llama-server, Q8_0 GGUF1063.3 s
16 Neoverse V3 CPU coresOllama 0.40.3, Q8_0 GGUF1064.8 s

Intended use

Rate a shell command before a terminal or a coding agent runs it: block or ask for confirmation above a risk cutoff, and show the categories and the reversibility answer to the person who decides. The probabilities let you pick a cutoff per question and trade false alarms against misses.

Training

  • Data: the train split of CLI Command Risk, posed as 17 decisions per command by training/build_cli_decisions.py. Rows in one template family are near copies, so training keeps one shell per distinct command and at most 40 commands per family: 12,383 commands from 727 families (210,511 decisions). Validation keeps at most 8 commands per family (472 commands). The source Parquet files match the SHA-256 hashes in the dataset's published manifest.json.
  • The dataset keeps each template family in one split, so no test family was seen in training.
SettingValue
MethodLoRA (r 32, alpha 64, dropout 0.05) on the language model's projection layers (LORA_TARGETS in training/liquid_d1.py), merged into the weights after training
ObjectiveCross entropy over each question's answer tokens; the command is the trunk of d1's packed tree and the 17 questions are its branches
Schedule1 epoch, 1,548 steps of 8 commands
OptimizerAdamW, learning rate 2e-4, 5% warmup, linear decay
Precisionbf16
HardwareOne A100 SXM 80GB, 87 minutes
Validation loss0.106 at the end of training (300 validation commands)

training/ holds the scripts that built the decisions, trained and scored this model. To rerun it:

pip install peft==0.21.2 pyarrow numpy
hf download yannelli/cli-command-risk --repo-type dataset --local-dir cli-command-risk
python training/build_cli_decisions.py --out cli-data
export DECISIONS_DATA=cli-data
python training/liquid_d1.py train --model LiquidAI/d1-3B --ckpt ckpt --epochs 1 --save-every 200
python training/liquid_d1.py predict --ckpt ckpt --split test --out test-answers.jsonl
python training/score_cli_decisions.py test-answers.jsonl

Evaluation files

eval/test-answers.jsonl holds this model's answers to all 12,689 test commands, eval/score.txt is the scorer's output for it, and eval/guardrail.json has the risk-level and cutoff results from training/score_cli_risk.py. To rescore, after building cli-data as above:

python training/score_cli_decisions.py eval/test-answers.jsonl

Limitations

  • Labels come from language models following a written taxonomy, with model audits and a relabel pass, not from human annotators. Scores measure agreement with those labels.
  • Labels rate the command alone, not the machine it runs on.
  • Training commands use placeholders such as example.com and <TOKEN> in place of real hosts and secrets.
  • The risk level is the hardest question (accuracy 0.756); low (F1 0.257) and high (F1 0.508) are the weakest levels.

License

This model is a derivative of LiquidAI/d1-3B and is released under the base model's LFM Open License v1.0, included as LICENSE. The license allows commercial use only for entities with less than $10M in annual revenue; read LICENSE for the full terms.

The training data, CLI Command Risk, is CC BY 4.0.

Citation

@misc{yannelli2026d13bclicommandrisk,
  title        = {d1-3B CLI Command Risk},
  author       = {Ryan Yannelli},
  year         = {2026},
  publisher    = {Hugging Face},
  howpublished = {\url{https://huggingface.co/yannelli/d1-3b-cli-command-risk}}
}

@misc{yannelli2026clicommandrisk,
  title        = {CLI Command Risk},
  author       = {Ryan Yannelli},
  year         = {2026},
  publisher    = {Hugging Face},
  howpublished = {\url{https://huggingface.co/datasets/yannelli/cli-command-risk}}
}

Maintainer

Ryan Yannelli | 10/19/2026 | GitHub: @yannelli | Hugging Face: yannelli

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers · text-classification

Нельзя запустить

Для архитектуры lfm2_vl нет загрузчика под задачу text-classification.

Класс архитектуры
D1Model
Ревизия весов
6b836d4

0 моделей