/ Модель

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

Контекст
128 000 токенов
Параметры
956 млн
Лицензия
Своя лицензия
Архитектура
lfm2 · dense
Базовая модель
LFM2-700M
Библиотека
transformers
Опубликована
21 сен 2026

lfm2-700m-linux-command

Генерация текстаТекст → текст6 профессий

Дообученная LFM2-700M, которая преобразует англоязычные запросы в одну команду Linux shell.

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

Бенчмарки

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

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

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

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

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

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

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

thealper2/lfm2-700m-linux-command — дообученная модель на базе LiquidAI/LFM2-700M для преобразования запроса на естественном языке в одну команду Linux shell. Она выдаёт только команду, без пояснений; предусмотрен шаблон чата LFM2, а для получения стабильного ответа рекомендуется жадное декодирование. Архитектура — плотная Lfm2ForCausalLM с гибридным сочетанием полного внимания и коротких свёрток. В README указано 742,5 млн параметров, а метаданные каталога приводят 956,3 млн; контекстное окно по метаданным — 128 000 токенов. Модель обучалась на наборах nl2bash и linux-command-dataset, языковая метка карточки — английский.

Она подходит для получения кандидатов команд по кратким описаниям задач, например для поиска файлов или процессов, и как генератор команд в изолированном терминальном агенте. На тестовом наборе точное совпадение с единственным эталонным ответом составило 29,1%, структурное — 30,3%; эти показатели не измеряют семантическую корректность всех допустимых команд. Модель может выводить неверные или разрушающие команды и не проверяет их безопасность. README указывает лицензию как other без конкретизации условий, поэтому лицензионные права следует сверить с карточкой репозитория Hugging Face.

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

  • получение команды для поиска файла или процесса
  • подбор команды Linux по описанию задачи на английском языке
  • генерация кандидата shell-команды для проверки оператором
  • формирование команд для изолированного терминального агента

Ограничения

На отложенном тесте точное совпадение составило 29,1%, а структурное совпадение не гарантирует смысловую корректность; длинные многоэтапные сценарии выходят за рамки коротких обучающих ответов. Команды могут быть ошибочными или разрушительными и не проверяются на безопасность; не запускайте их без проверки.

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

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

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

Также подходит для

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

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

Открыть на Hugging Face

thealper2/lfm2-700m-linux-command

LiquidAI/LFM2-700M fine-tuned to map a natural-language Linux task to a single shell command. The target output is the command only; no explanation is produced.

Model details

FieldValue
Base modelLiquidAI/LFM2-700M
ArchitectureLfm2ForCausalLM — hybrid, 16 layers: full attention at [2, 5, 8, 10, 12, 14], gated short convolution elsewhere
Parameters742,489,344 total (641,826,048 non-embedding)
Hidden size / heads / KV heads1536 / 24 / 8
Vocabulary65,536
Context length (base)128,000
Training precisionbfloat16
Fine-tuning methodfull
TaskNL instruction → shell command

Prompt format

The model uses the LFM2 ChatML-style chat template and was trained with no system prompt. Apply the template rather than constructing the string manually.

<|startoftext|><|im_start|>user
Find which process is using port 8080.<|im_end|>
<|im_start|>assistant
lsof -i :8080<|im_end|>

Two LFM2 tokenizer details matter:

  • The chat template emits bos_token itself and add_bos_token is true in tokenizer_config.json. Tokenise templated text with add_special_tokens=False, or the sequence gets a duplicated BOS.
  • Decode with clean_up_tokenization_spaces=False; the BPE cleanup step strips spaces around punctuation and can corrupt shell commands.

Special tokens: BOS <|startoftext|> (1), EOS <|im_end|> (7), PAD <|pad|> (0).

Usage

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "thealper2/lfm2-700m-linux-command"
tokenizer = AutoTokenizer.from_pretrained(model_id, clean_up_tokenization_spaces=False)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.bfloat16).to("cuda").eval()

messages = [{"role": "user", "content": "Find which process is using port 8080."}]
prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).to(model.device)

output = model.generate(
    **inputs,
    max_new_tokens=128,
    do_sample=False,                      # deterministic decoding
    eos_token_id=tokenizer.eos_token_id,
    pad_token_id=tokenizer.pad_token_id,
)
command = tokenizer.decode(output[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True).strip()
print(command)  # lsof -i :8080

Greedy decoding (do_sample=False) is the intended configuration: the task has a single intended answer and sampling only adds variance.

Training data

SourceRaw rowsSchema
jiacheng-ye/nl2bash9,305nl, bash
mecha-org/linux-command-dataset8,669input, output

Both were normalised to {instruction, command, source} and then:

  1. Cleaned — markdown fences and $/# prompt prefixes stripped, whitespace runs collapsed outside quoted strings, records with unbalanced quotes, prose instead of a command, or no parseable utility dropped. Commands themselves were never rewritten.
  2. Deduplicated — exact (instruction, command) duplicates removed. Rows sharing a command with a different instruction, or an instruction with a different valid command, were kept deliberately.
  3. Balanced — find was 35.2% of the raw corpus. It was capped per-utility using a diversity-aware ordering that retains every distinct flag signature before retaining any repeat, lowering its share to ~19%.
  4. Split — 90/5/5, grouped by instruction template (filenames, paths, numbers and quoted literals abstracted) so templated paraphrases cannot straddle the train/test boundary.

Split sizes: 11756 train / 652 validation / 653 test. Leakage checks report zero overlap across splits at the exact-pair, instruction and instruction-template level.

Training configuration

Hyper-parameterValue
Methodfull
Epochs3
Learning rate3e-05
Schedulercosine
Warmup ratio0.03
Weight decay0.01
Optimizeradamw_torch_fused
Per-device batch size16
Gradient accumulation2
Max sequence length128
Precisionbfloat16
Seed42

Loss is computed on the assistant turn only; prompt tokens are masked with -100.

max_length was chosen from the tokenised length distribution of the corpus (mean 37.7, median 34, p90 57, p95 66, p99 87, max 403) — a 128-token budget covers 99.94% of examples.

Run record

FieldValue
Final training loss0.516
Validation loss0.6445
Training time425.0 s
Peak VRAM8.95 GB
GPUNVIDIA GeForce RTX 5060 Ti
torch / transformers2.11.0+cu128 / 5.17.0

Evaluation

Measured on the held-out test set with greedy decoding.

MetricBase LFM2-700MFine-tunedDelta
Exact match0.00610.2910+0.2849
Normalised exact match0.00610.2910+0.2849
Structural match0.01070.3032+0.2925
Command validity0.47630.9939+0.5176
Token F10.11950.6470+0.5275
Primary-utility accuracy0.18070.8377+0.6570
Prose-output rate0.37830.0000-0.3783

Metric definitions:

  • Exact match — string equality after stripping surrounding whitespace.
  • Normalised exact match — equality after collapsing whitespace runs outside quotes and removing a trailing ;.
  • Structural match — utility, flag multiset (short-flag bundles expanded for utilities that use them) and operand sequence compared per pipeline segment. Recognises ls -la == ls -al.
  • Command validity — the output parses under a bash grammar parser (bashlex), not membership in a list of known utilities.
  • Token F1 — token-level overlap, as partial credit.
  • Primary-utility accuracy — the first utility matches the reference.
  • Prose-output rate — fraction of outputs that read as an explanation rather than a command.

Limitations

  • Structural match is not a semantic oracle. It compares command shape. It cannot tell that find . -name '*.py' and a shell glob achieve the same result, and it does not reason about flag semantics. It is an upper bound on exact match, not semantic accuracy.
  • Exact match understates correctness. Many Linux tasks have several valid answers; the test set carries one reference each.
  • Source-distribution bias. nl2bash is find-heavy and composition-heavy; mecha-org/linux-command-dataset is templated and single-utility-heavy. Per-source metrics differ and are reported separately in the project reports.
  • Distribution shift. Commands reference paths, hosts and variables that appear in the training corpora (/path/to/..., $source). Outputs may embed those placeholders instead of the user's real paths.
  • Short outputs only. Trained at a 128-token budget; long multi-stage scripts are out of distribution.
  • No verification of correctness or safety at generation time. The model can produce syntactically valid but wrong — or destructive — commands.

Intended use and safety

Intended for generating candidate shell commands for review, and as the command generator of a sandboxed terminal agent.

Do not execute generated commands directly on a host. The project this model comes from executes commands only inside a disposable Docker container started with --network none, --read-only, --cap-drop ALL, --security-opt no-new-privileges, a non-root user, no host bind mounts, bounded CPU/memory/PIDs and a wall-clock timeout, and screens commands against a destructive-pattern list and a read-only allowlist before running them.

License

Inherits the LFM Open License v1.0 of the base model, LiquidAI/LFM2-700M. Dataset licenses apply to the training data: mecha-org/linux-command-dataset is Apache-2.0; nl2bash derives from the TellinaTool/nl2bash corpus.

Citation

The NL2Bash corpus:

@inproceedings{LinWZE2018:NL2Bash,
  author    = {Xi Victoria Lin and Chenglong Wang and Luke Zettlemoyer and Michael D. Ernst},
  title     = {NL2Bash: A Corpus and Semantic Parser for Natural Language Interface to the Linux Operating System},
  booktitle = {LREC 2018},
  year      = {2018}
}

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

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

GPU в ailist

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

Можно запустить

Подбираем GPU…

Класс архитектуры
Lfm2ForCausalLM
Ревизия весов
bc6c786

0 моделей