thealper2/lfm2-700m-linux-command

TEXT GENERATIONPricing:Input $0.04 / Cached $0.002 / Output $0.08Concurrent Unit Cost:1Model Size:0.7BQuant:BF16Context Size:32kPublished:Sep 21, 2026License:otherArchitecture:Transformer Featherless Exclusive Cold

The thealper2/lfm2-700m-linux-command model is a 0.7 billion parameter LFM2-based causal language model fine-tuned to translate natural language Linux tasks into single shell commands. Developed by thealper2, it utilizes a hybrid architecture with 16 layers and a 32,768 token context length. This model specializes in generating precise, command-only outputs for Linux operations, achieving significant improvements in command validity and primary-utility accuracy over its base model.

Loading preview...

Model Overview

The thealper2/lfm2-700m-linux-command is a specialized 0.7 billion parameter model, fine-tuned from the LiquidAI/LFM2-700M base, designed to convert natural language instructions into single Linux shell commands. Its architecture is a hybrid Lfm2ForCausalLM with 16 layers, featuring full attention and gated short convolution. The model has a vocabulary of 65,536 and was trained with a context length of 128,000 tokens for the base model, though fine-tuning used a max sequence length of 128 tokens.

Key Capabilities

  • Natural Language to Shell Command Translation: Directly maps user-provided natural language descriptions of Linux tasks to executable shell commands.
  • Command-Only Output: Produces only the shell command, without additional explanations or prose.
  • High Command Validity: Achieves a command validity of 0.9939 on its test set, a substantial improvement over the base model's 0.4763.
  • Optimized for Deterministic Output: Intended for greedy decoding (do_sample=False) to ensure consistent and predictable command generation.

Training and Performance

The model was fine-tuned using a full fine-tuning method on a curated dataset combining jiacheng-ye/nl2bash and mecha-org/linux-command-dataset. This data underwent extensive cleaning, deduplication, and balancing to ensure quality and diversity. Evaluation metrics show significant gains post-fine-tuning, including a +0.2849 delta in exact match and a +0.6570 delta in primary-utility accuracy. The prose-output rate was reduced to 0.0000, confirming its command-only output focus.

Intended Use and Safety

This model is intended for generating candidate shell commands for review or as a component within a sandboxed terminal agent. It is critical not to execute generated commands directly on a host without verification, as the model does not guarantee correctness or safety. The project recommends execution within isolated, resource-limited, and permission-restricted environments like Docker containers with strict security policies.