Text Generation
Transformers
Safetensors
English
gpt2
tinystories
pretraining-from-scratch
educational
tiny-language-model
base-model
text-generation-inference
Instructions to use laskar-ks/alcyone-v0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use laskar-ks/alcyone-v0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="laskar-ks/alcyone-v0")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("laskar-ks/alcyone-v0") model = AutoModelForCausalLM.from_pretrained("laskar-ks/alcyone-v0", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use laskar-ks/alcyone-v0 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "laskar-ks/alcyone-v0" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "laskar-ks/alcyone-v0", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/laskar-ks/alcyone-v0
- SGLang
How to use laskar-ks/alcyone-v0 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 "laskar-ks/alcyone-v0" \ --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": "laskar-ks/alcyone-v0", "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 "laskar-ks/alcyone-v0" \ --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": "laskar-ks/alcyone-v0", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use laskar-ks/alcyone-v0 with Docker Model Runner:
docker model run hf.co/laskar-ks/alcyone-v0
|
Download README.md from laskar-ks/alcyone-v0: direct link, hf CLI and curl.
- Browser
- Download file 5.22 kB
-
https://huggingface.co/laskar-ks/alcyone-v0/resolve/main/README.md
- Command line
-
hf download hf://laskar-ks/alcyone-v0/README.md
-
curl -L -o README.md https://huggingface.co/laskar-ks/alcyone-v0/resolve/main/README.md
5.22 kB
| license: apache-2.0 | |
| library_name: transformers | |
| pipeline_tag: text-generation | |
| language: | |
| - en | |
| tags: | |
| - gpt2 | |
| - tinystories | |
| - pretraining-from-scratch | |
| - educational | |
| - tiny-language-model | |
| - base-model | |
| datasets: | |
| - roneneldan/TinyStories | |
| # Alcyone β Base Model (pre-chat) | |
| **A 30.5M parameter GPT-2 style language model, pretrained from scratch on TinyStories.** | |
| This is the **base model**: fluent at continuing text, but not yet conversational. It is the foundation that the upcoming chat model will be fine-tuned on. | |
| Named after the brightest star in the Pleiades cluster β part of a star-named model family. | |
| ## Versioning philosophy | |
| This project reserves the **v1** milestone for the first **chat-capable** model. Everything before that β including this checkpoint β is considered the **v0 / base-model stage**. | |
| - **v0 stage (now):** pretraining from scratch. Goal = a model that writes coherent English text. β achieved here. | |
| - **v1 (upcoming):** instruction fine-tuning (SFT) on top of this base, turning a text-completer into an assistant you can actually chat with. | |
| In other words: this model is the *raw fluency*; v1 will add the *ability to follow instructions*. | |
| ## From first experiment to this base model | |
| | | First experiment | This base model | | |
| |---|---|---| | |
| | Parameters | ~4.2M | **30.5M** | | |
| | Layers | 4 | **8** | | |
| | Embedding dim | 256 | **512** | | |
| | Attention heads | 4 | **8** | | |
| | Context length | 128 | **256** | | |
| | Vocab size | 4,000 | **10,000** | | |
| | Training data | 5k stories | **500k stories** | | |
| | Training steps | 300 | **8,000** | | |
| | Final eval loss | β | **1.81** | | |
| The first experiment proved the from-scratch training loop works end-to-end. This base model scales it up into something that writes genuinely coherent stories β consistent characters, dialogue, and cause-and-effect. | |
| ## Model details | |
| | | | | |
| |---|---| | |
| | **Architecture** | GPT-2 (decoder-only Transformer) | | |
| | **Parameters** | 30.5M | | |
| | **Layers / Heads / Embedding** | 8 / 8 / 512 | | |
| | **Context length** | 256 tokens | | |
| | **Vocab size** | 10,000 | | |
| | **Tokenizer** | Byte-level BPE, trained from scratch on TinyStories | | |
| | **Initialization** | Random (no pretrained weights) | | |
| | **Objective** | Causal language modeling (next-token prediction) | | |
| ## Training | |
| | | | | |
| |---|---| | |
| | **Data** | [roneneldan/TinyStories](https://huggingface.co/datasets/roneneldan/TinyStories) β 500k story subset | | |
| | **Hardware** | Google Colab Free Tier (NVIDIA Tesla T4, 16GB) | | |
| | **Precision** | fp16 | | |
| | **Optimizer** | AdamW (HF Trainer default) | | |
| | **Learning rate** | 5e-4, cosine schedule, 200 warmup steps | | |
| | **Batch size** | 32 | | |
| | **Steps** | 8,000 (~0.6 epoch) | | |
| | **Wall-clock time** | ~41 minutes | | |
| | **Train loss** | 1.82 | | |
| | **Eval loss** | 1.81 | | |
| Train and eval loss stayed nearly identical throughout (1.82 vs 1.81), indicating clean generalization with no overfitting. The eval-loss curve plateaued near the end β suggesting further gains would come from a larger model or more data, not longer training. | |
| ## Intended use & limitations | |
| A **base language model**, not an instruction-tuned chat model. Given a short English prompt, it continues the text in TinyStories style. | |
| **It will NOT (yet):** | |
| - follow instructions or answer questions β that is what the v1 chat model will add | |
| - produce text outside the children's-story domain | |
| - maintain perfect long-range plot coherence (local grammar is strong; global plot occasionally drifts) | |
| - stop cleanly at the end of a story (it tends to begin a new one, since it was trained on a continuous stream) | |
| ## Quick start | |
| ```python | |
| from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline | |
| REPO = "laskar-ks/alcyone-v1" # ganti ke "laskar-ks/alcyone-base" jika repo di-rename | |
| model = AutoModelForCausalLM.from_pretrained(REPO) | |
| tokenizer = AutoTokenizer.from_pretrained(REPO) | |
| gen = pipeline("text-generation", model=model, tokenizer=tokenizer) | |
| print(gen("Once upon a time, there was a little", | |
| max_new_tokens=120, do_sample=True, temperature=0.8, | |
| clean_up_tokenization_spaces=False)[0]["generated_text"]) | |
| ``` | |
| ## Example output | |
| > Once upon a time, there was a little girl named Lily. She loved to play outside in the sunshine. One day, she saw a butterfly flying around in the sky. She wanted to catch it, but she accidentally stepped on a rock and fell down. Her mommy came to help her... Lily felt better and thanked her mommy. | |
| ## Roadmap | |
| - **v0 stage β first experiment (4.2M):** proof the from-scratch pretraining loop works. | |
| - **v0 stage β base model (30.5M, this):** coherent story generation. The foundation. | |
| - **v1 β chat (upcoming):** instruction fine-tuning (SFT) to turn this base into a conversational assistant. *This is the milestone that earns the "v1" name.* | |
| - **Beyond:** larger model / more data to push past the current loss plateau. | |
| ## About the name | |
| **Alcyone** (Ξ· Tauri) is the brightest star in the Pleiades open star cluster. Part of a star-named model family alongside other projects (Parallax, Altair, etc.). | |
| ## Author | |
| Trained by [Laskar](https://huggingface.co/laskar-ks) as part of an AI engineering portfolio exploring agentic systems and foundational ML. |