> ## Documentation Index
> Fetch the complete documentation index at: https://liquidai-example-leonie-demo.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# LFM2.5-1.2B-Base

> Pre-trained 1.2B parameter base model for fine-tuning and custom applications

<a href="/lfm/models/text-models" className="back-button">← Back to Text Models</a>

LFM2.5-1.2B-Base is the pre-trained foundation model for the LFM2.5 series. Ideal for fine-tuning on custom datasets or building specialized checkpoints. Not instruction-tuned—use LFM2.5-1.2B-Instruct for chat applications.

<div style={{display: 'flex', gap: '0.5rem', margin: '0.5rem 0 1.5rem 0'}}>
  <a href="https://huggingface.co/LiquidAI/LFM2.5-1.2B-Base" style={{padding: '0.35rem 0.7rem', borderRadius: '4px', fontSize: '0.85rem', fontWeight: 600, textDecoration: 'none', backgroundColor: '#fbbf24'}}><span style={{color: '#000'}}>HF</span></a>
  <a href="https://huggingface.co/LiquidAI/LFM2.5-1.2B-Base-GGUF" style={{padding: '0.35rem 0.7rem', borderRadius: '4px', fontSize: '0.85rem', fontWeight: 600, textDecoration: 'none', backgroundColor: '#60a5fa'}}><span style={{color: '#000'}}>GGUF</span></a>
  <a href="https://huggingface.co/LiquidAI/LFM2.5-1.2B-Base-ONNX" style={{padding: '0.35rem 0.7rem', borderRadius: '4px', fontSize: '0.85rem', fontWeight: 600, textDecoration: 'none', backgroundColor: '#86efac'}}><span style={{color: '#000'}}>ONNX</span></a>
</div>

## Specifications

| Property       | Value          |
| -------------- | -------------- |
| Parameters     | 1.2B           |
| Context Length | 32K tokens     |
| Architecture   | LFM2.5 (Dense) |

<div className="use-cases">
  <CardGroup cols={3}>
    <Card title="Fine-tuning" icon="sliders">
      TRL compatible (SFT, DPO, GRPO)
    </Card>

    <Card title="Custom Training" icon="flask">
      Build domain-specific models
    </Card>

    <Card title="32K Context" icon="text-width">
      Extended context for long documents
    </Card>
  </CardGroup>
</div>

## Quick Start

<Tabs>
  <Tab title="Transformers">
    **Install:**

    ```bash theme={null}
    pip install "transformers>=5.2.0" torch accelerate
    ```

    **Download & Run:**

    ```python theme={null}
    from transformers import AutoModelForCausalLM, AutoTokenizer

    model_id = "LiquidAI/LFM2.5-1.2B-Base"
    model = AutoModelForCausalLM.from_pretrained(
        model_id,
        device_map="auto",
        dtype="bfloat16",
    )
    tokenizer = AutoTokenizer.from_pretrained(model_id)

    # Base model uses raw text completion (not chat template)
    inputs = tokenizer("The future of AI is", return_tensors="pt").to(model.device)
    output = model.generate(**inputs, max_new_tokens=512)
    print(tokenizer.decode(output[0], skip_special_tokens=True))
    ```
  </Tab>

  <Tab title="vLLM">
    **Install:**

    ```bash theme={null}
    pip install vllm==0.14
    ```

    **Run:**

    ```python theme={null}
    from vllm import LLM, SamplingParams

    llm = LLM(model="LiquidAI/LFM2.5-1.2B-Base")

    sampling_params = SamplingParams(
        temperature=0.8,
        min_p=0.05,
        max_tokens=512,
    )

    # Base model uses raw text completion
    output = llm.generate("The future of AI is", sampling_params)
    print(output[0].outputs[0].text)
    ```
  </Tab>

  <Tab title="SGLang">
    **Install:**

    ```bash theme={null}
    uv pip install "sglang>=0.5.10"
    ```

    **Launch server:**

    ```bash theme={null}
    sglang serve \
        --model-path LiquidAI/LFM2.5-1.2B-Base \
        --host 0.0.0.0 \
        --port 30000
    ```

    **Query (OpenAI-compatible):**

    ```python theme={null}
    from openai import OpenAI

    client = OpenAI(base_url="http://localhost:30000/v1", api_key="None")

    # Base model uses raw text completion (not chat)
    response = client.completions.create(
        model="LiquidAI/LFM2.5-1.2B-Base",
        prompt="The future of AI is",
        temperature=0.8,
        max_tokens=512,
    )

    print(response.choices[0].text)
    ```
  </Tab>
</Tabs>
