Text Generation
Transformers
Safetensors
English
gpt2
causal-lm
from-scratch
fineweb
undertrained
text-generation-inference
Instructions to use helloadhavan/llara1.0-100M-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use helloadhavan/llara1.0-100M-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="helloadhavan/llara1.0-100M-base")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("helloadhavan/llara1.0-100M-base") model = AutoModelForCausalLM.from_pretrained("helloadhavan/llara1.0-100M-base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use helloadhavan/llara1.0-100M-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "helloadhavan/llara1.0-100M-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "helloadhavan/llara1.0-100M-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/helloadhavan/llara1.0-100M-base
- SGLang
How to use helloadhavan/llara1.0-100M-base 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 "helloadhavan/llara1.0-100M-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "helloadhavan/llara1.0-100M-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "helloadhavan/llara1.0-100M-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "helloadhavan/llara1.0-100M-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use helloadhavan/llara1.0-100M-base with Docker Model Runner:
docker model run hf.co/helloadhavan/llara1.0-100M-base
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,117 @@
|
|
| 1 |
---
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
tags:
|
| 6 |
+
- gpt2
|
| 7 |
+
- causal-lm
|
| 8 |
+
- text-generation
|
| 9 |
+
- from-scratch
|
| 10 |
+
- fineweb
|
| 11 |
+
library_name: transformers
|
| 12 |
+
pipeline_tag: text-generation
|
| 13 |
---
|
| 14 |
+
|
| 15 |
+
# Llara
|
| 16 |
+
|
| 17 |
+
Llara is a 117M parameter autoregressive language model trained from scratch on English web text. It follows the GPT-2 Small architecture and is trained entirely from random initialisation — no pretrained weights, no distillation, no fine-tuning of an existing model.
|
| 18 |
+
|
| 19 |
+
The name **Llara** is original and unrelated to LLaMA or LoRA.
|
| 20 |
+
|
| 21 |
+
---
|
| 22 |
+
|
| 23 |
+
## Model Details
|
| 24 |
+
|
| 25 |
+
| Property | Value |
|
| 26 |
+
|---|---|
|
| 27 |
+
| Architecture | GPT-2 (decoder-only transformer) |
|
| 28 |
+
| Parameters | ~90-100M |
|
| 29 |
+
| Context length | 256 tokens |
|
| 30 |
+
| Embedding dim | 768 |
|
| 31 |
+
| Layers | 12 |
|
| 32 |
+
| Attention heads | 12 |
|
| 33 |
+
| Vocabulary | 50,257 (GPT-2 BPE) |
|
| 34 |
+
| Training data | FineWeb (HuggingFaceFW/fineweb), Custom dataset |
|
| 35 |
+
| Training docs | 1,000,000 documents |
|
| 36 |
+
| Epochs | 1 |
|
| 37 |
+
| Precision | fp16 |
|
| 38 |
+
|
| 39 |
+
---
|
| 40 |
+
|
| 41 |
+
## Training
|
| 42 |
+
|
| 43 |
+
Llara was trained on 1 million documents sampled from [FineWeb](https://huggingface.co/datasets/HuggingFaceFW/fineweb), a large-scale curated English web dataset. Documents were tokenised with the GPT-2 BPE tokeniser and packed into non-overlapping 1024-token blocks.
|
| 44 |
+
|
| 45 |
+
**Training configuration:**
|
| 46 |
+
|
| 47 |
+
| Hyperparameter | Value |
|
| 48 |
+
|---|---|
|
| 49 |
+
| Optimiser | AdamW |
|
| 50 |
+
| Learning rate | 3e-4 |
|
| 51 |
+
| LR schedule | Cosine decay |
|
| 52 |
+
| Warmup steps | 2,000 |
|
| 53 |
+
| Weight decay | 0.1 |
|
| 54 |
+
| Effective batch size | 32 |
|
| 55 |
+
| Gradient accumulation | 8 steps |
|
| 56 |
+
| Dropout | 0.1 (residual, embedding, attention) |
|
| 57 |
+
|
| 58 |
+
Gradient checkpointing was enabled throughout training to reduce memory usage.
|
| 59 |
+
|
| 60 |
+
---
|
| 61 |
+
|
| 62 |
+
## Usage
|
| 63 |
+
|
| 64 |
+
```python
|
| 65 |
+
from transformers import GPT2LMHeadModel, AutoTokenizer, pipeline
|
| 66 |
+
|
| 67 |
+
model = GPT2LMHeadModel.from_pretrained("helloadhavan/llara1.0-100M-base")
|
| 68 |
+
tokenizer = AutoTokenizer.from_pretrained("helloadhavan/llara1.0-100M-base")
|
| 69 |
+
|
| 70 |
+
gen = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
| 71 |
+
|
| 72 |
+
output = gen(
|
| 73 |
+
"The history of artificial intelligence",
|
| 74 |
+
max_new_tokens=200,
|
| 75 |
+
do_sample=True,
|
| 76 |
+
temperature=0.8,
|
| 77 |
+
top_p=0.95,
|
| 78 |
+
repetition_penalty=1.1,
|
| 79 |
+
)
|
| 80 |
+
|
| 81 |
+
print(output[0]["generated_text"])
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
---
|
| 85 |
+
|
| 86 |
+
## Limitations
|
| 87 |
+
|
| 88 |
+
- Llara is trained on English web text only and performs poorly on other languages.
|
| 89 |
+
- Like all autoregressive LMs trained on web data, it may reproduce biases, factual errors, or inappropriate content present in the training corpus.
|
| 90 |
+
- It is a research model trained from scratch and is not instruction-tuned or aligned — it should not be used in production or user-facing applications without further fine-tuning and safety work.
|
| 91 |
+
- At 95M parameters and 256k training documents, it is significantly smaller and less trained than models like GPT-2 (which saw 40GB of text). Outputs may be incoherent on complex prompts.
|
| 92 |
+
|
| 93 |
+
---
|
| 94 |
+
|
| 95 |
+
## Intended Use
|
| 96 |
+
|
| 97 |
+
Llara is intended for:
|
| 98 |
+
|
| 99 |
+
- Research and experimentation with small language models
|
| 100 |
+
- Learning how GPT-style models are trained from scratch
|
| 101 |
+
- A base for fine-tuning on downstream tasks
|
| 102 |
+
|
| 103 |
+
---
|
| 104 |
+
|
| 105 |
+
## Training Framework
|
| 106 |
+
|
| 107 |
+
Trained using [Hugging Face Transformers](https://github.com/huggingface/transformers) `Trainer` on a single GPU.
|
| 108 |
+
|
| 109 |
+
---
|
| 110 |
+
|
| 111 |
+
## License
|
| 112 |
+
|
| 113 |
+
Apache 2.0
|
| 114 |
+
|
| 115 |
+
<div>
|
| 116 |
+
<blockquote><strong>Note:</strong> i am a AI hobbyist, not an AI engineer</blockquote>
|
| 117 |
+
</div>
|