Text Generation
Transformers
Safetensors
GGUF
Lithuanian
llama
lithuanian
from-scratch
reasoning
text-generation-inference
conversational
Instructions to use Linksas/L1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Linksas/L1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Linksas/L1")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Linksas/L1") model = AutoModelForCausalLM.from_pretrained("Linksas/L1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Linksas/L1 with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Linksas/L1:Q8_0 # Run inference directly in the terminal: llama cli -hf Linksas/L1:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Linksas/L1:Q8_0 # Run inference directly in the terminal: llama cli -hf Linksas/L1:Q8_0
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf Linksas/L1:Q8_0 # Run inference directly in the terminal: ./build/bin/llama cli -hf Linksas/L1:Q8_0
Use Docker
docker model run hf.co/Linksas/L1:Q8_0
- Llama new
- LM Studio
- Jan
- vLLM
How to use Linksas/L1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Linksas/L1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Linksas/L1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Linksas/L1:Q8_0
- SGLang
How to use Linksas/L1 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Linksas/L1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Linksas/L1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Linksas/L1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Linksas/L1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use Linksas/L1 with Ollama:
ollama run hf.co/Linksas/L1:Q8_0
- Unsloth Desktop
- Docker Model Runner
How to use Linksas/L1 with Docker Model Runner:
docker model run hf.co/Linksas/L1:Q8_0
- Lemonade
How to use Linksas/L1 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Linksas/L1:Q8_0
Run and chat with the model
lemonade run user.L1-Q8_0
List all available models
lemonade list
- Atomic Chat
|
Download README.md from Linksas/L1: direct link, hf CLI and curl.
- Browser
- Download file 2.89 kB
-
https://huggingface.co/Linksas/L1/resolve/main/README.md
- Command line
-
hf download hf://Linksas/L1/README.md
-
curl -L -o README.md https://huggingface.co/Linksas/L1/resolve/main/README.md
2.89 kB
| language: | |
| - lt | |
| license: apache-2.0 | |
| library_name: transformers | |
| pipeline_tag: text-generation | |
| tags: | |
| - llama | |
| - lithuanian | |
| - from-scratch | |
| - reasoning | |
| - gguf | |
| # L1 (259M) | |
| **L1** yra 259 milijonų parametrų `Llama` architektūros kalbos modelis, apmokytas nuo nulio lietuvių kalbai ir žingsnis po žingsnio matematiniam samprotavimui naudojant `<think>` žymes. | |
| ## Architektūra ir mokymas | |
| * **Architektūra:** Llama (`LlamaForCausalLM`), ~259M parametrų, 512 tokenų konteksto langas, specialiai lietuvių kalbai apmokytas BPE tokenizatorius. | |
| * **Bazinis mokymas (Pre-training):** 770,9 mln. tokenų iš lietuviško `FineWeb-2` duomenų rinkinio naudojant WSD (*Warmup-Stable-Decay*) grafiką. | |
| * **Instrukcijų mokymas (SFT):** 81 671 pavyzdys su *loss masking* (`MBZUAI/Bactrian-X` LT, `CohereForAI/aya_dataset`, `CohereForAI/aya_collection_language_split`, sintetinė `<think>` matematika ir GSM8K). | |
| ## Testavimo rezultatai (200 unikalių užduočių) | |
| | Kategorija | Rezultatas | Pastabos | | |
| | :--- | :---: | :--- | | |
| | **Matematika (aritmetika, procentai, lygtys)** | **82 / 100** | Sprendžia žingsnis po žingsnio `<think>` bloke | | |
| | **Lietuvių kalba (bendrosios žinios)** | **17 / 100** | 259M parametrų bazės riba | | |
| ## Svarbu: kaip paleisti per LM Studio, PocketPal AI ar Ollama (GGUF) | |
| Modelis buvo apmokytas su paprastu lietuvišku dialogo šablonu, o ne su standartinėmis `<|im_start|>` žymėmis. Jei naudojate **`L1-259M-Q8_0.gguf`**, programos nustatymuose **būtina** nurodyti šį šabloną (kitaip modelis generuos nesąmones): | |
| * **User Prefix (Before User):** `Žmogus: ` *(su tarpu gale)* | |
| * **User Suffix (After User):** `\nAsistentas:` | |
| * **Stop Strings:** `Žmogus:` | |
| * **Rekomenduojami parametrai:** `Temperature: 0.3` (matematikai `0.0`), `Repeat Penalty: 1.15` | |
| ### Užklausos pavyzdys | |
| ```text | |
| Žmogus: Išspręsk lygtį: 3x + 6 = 21 | |
| Asistentas: | |
| ``` | |
| ## Kaip paleisti per Python (`transformers`) | |
| ```python | |
| import torch | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| model_id = "Linksas/L1" | |
| tokenizer = AutoTokenizer.from_pretrained(model_id) | |
| model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16, device_map="auto") | |
| prompt = "Žmogus: Kiek yra 48 + 37?\nAsistentas:" | |
| inputs = tokenizer(prompt, return_tensors="pt").to(model.device) | |
| with torch.no_grad(): | |
| outputs = model.generate( | |
| **inputs, | |
| max_new_tokens=160, | |
| do_sample=False, | |
| repetition_penalty=1.15, | |
| eos_token_id=tokenizer.eos_token_id, | |
| ) | |
| print(tokenizer.decode(outputs[0], skip_special_tokens=True)) | |
| ``` | |
| ## Apribojimai | |
| Tai yra pirmoji eksperimentinė 259M parametrų versija (`L1`). Dėl mažo parametrų skaičiaus ir trumpo 512 tokenų konteksto modelis gali klysti faktiniuose klausimuose ar ilgesniuose samprotavimuose. |