Skip to content
Language models

shika-10m: An ultra-lightweight character-level Llama-based language model

2 min readupdated

shika-10m by deerfieldgreen is an experimental 9.5M-parameter language model trained from scratch as part of the MiniLLM Lab project. Instead of standard subwords, it operates at the individual character level (character-level tokenization — each text character is treated as a separate token) and continues English text, generating coherent words and short sentences. Built on the standard Llama architecture, the model runs via transformers without any custom code. It is well-suited for researchers, students, and developers interested in exploring LLM mechanics and running quick tests on modest hardware or a CPU.

Key features

  • Llama architecture: 6 layers, hidden size of 384, GQA (Grouped-Query Attention with 6 query heads and 2 key-value heads), SwiGLU, RMSNorm, and RoPE positional encoding.
  • Character-level vocabulary: Includes 158 unique characters without beginning-of-sequence (BOS) or end-of-sequence (EOS) special tokens.
  • Diverse training corpus: Trained on 102 MB of English texts, incorporating Tiny Shakespeare, WikiText-2, TinyStories, Simple English Wikipedia, Python code, and documentation.
  • Trained on a laptop: The entire training run took 10,000 steps on an Apple M3 Pro chip (MPS).

What you can do

  • Use it as a clear educational reference for examining the LlamaForCausalLM architecture and character-level generation.
  • Run fast local experiments with sampling parameters (temperature, top_k) without a dedicated graphics card or heavy memory requirements.
  • Use it as a compact base for further fine-tuning on specific short-string generation tasks.

Example

from transformers import AutoModelForCausalLM, AutoTokenizer

tok = AutoTokenizer.from_pretrained("deerfieldgreen/shika-10m")
model = AutoModelForCausalLM.from_pretrained("deerfieldgreen/shika-10m")

inputs = tok("Once upon a time", return_tensors="pt")
out = model.generate(**inputs, max_new_tokens=200, do_sample=True, temperature=0.8, top_k=50)
print(tok.decode(out[0]))
Read moreDetails
Validation metrics: loss of 0.901 nats/char, perplexity of 2.46.
Context window limit: the combined length of the prompt and response must not exceed 256 characters.
Training: 10,000 steps (about 82 million characters, ~1 epoch), AdamW optimizer.
Limitations: due to its small size, the model loses coherence over full paragraphs and has not undergone instruction or safety tuning.
Discuss Telegram 0

Will it run?

Working out the memory needs

The bot is still collecting this model's weight sizes; the estimate will appear here in a few minutes. Meanwhile you can rent a GPU with headroom.

Massed ComputeOpen Massed Compute

Run it on Massed Compute

The script downloads the model to the rented machine. How to run it is in the model card.

  1. 1. Rent a machine with a fitting GPU

    Open Massed Compute
  2. 2. Paste the script into the machine's terminal

    Connect over SSH (the Massed Compute panel shows the command) or open a terminal on the machine's desktop.

    HF_TOKEN / CIVITAI_TOKENThe script starts with token lines: paste yours between the quotes. The Hugging Face token is for gated models, the Civitai one for Civitai models.

    # deerfieldgreen/shika-10m
    # ===== Tokens: paste yours between the quotes =====
    export HF_TOKEN=""        # huggingface.co/settings/tokens, for gated models
    # ==========================================
    mkdir -p ~/models
    curl -LsSf https://astral.sh/uv/install.sh | sh
    source "$HOME/.local/bin/env"
    uv tool install "huggingface_hub[cli]"
    hf download deerfieldgreen/shika-10m --local-dir ~/models/shika-10m
    # The model is in ~/models. How to run it is in the model card (link above).
    Add more LoRAs to shika-10m
  3. 3. Use it

    The model is in ~/models. How to run it is in the model card (link above).

Stop the machine in the panel when you are done: it bills by the minute while it runs.

How to speed it up

Picked for this model type. Choose your hardware above to see what fits you exactly.

  • FlashAttention 44.0.0b42from December 2, 2026new release

    fastest exact attention on B200

    Kernels for Blackwell (beta). Exact attention without quantisation — fine for everything, LLMs included.

    How to enable: pip install flash-attn-4; vLLM and SGLang pick it up themselves.

    Earlier generations (2)
    • FlashAttention 3 — The Hopper (H100/H200) version with FP8.
    • FlashAttention 2 — The standard for RTX 30/40/50 and A100: exact attention without the memory cost of long contexts.
  • torch.compile2.15.0from October 28, 2026

    10–30% for free

    Compiles the model for your GPU. Slower first run, faster afterwards.

    How to enable: model = torch.compile(model); in ComfyUI the TorchCompileModel node.

  • MTP (multi-token prediction)0.34.0from November 16, 2026new release

    1.5–2× generation speed

    If the model has MTP layers (DeepSeek-V3/R1, Qwen3-Next, GLM, MiMo and others), it predicts several tokens per step itself.

    How to enable: vLLM / SGLang: --speculative-config '{"method": "mtp", "num_speculative_tokens": 1}'. Check the model card.

    Earlier generations (2)
    • EAGLE-3 — Speculative decoding with a small draft head. For models without their own MTP layers.
    • EAGLE-2 / Medusa — Earlier draft-head generations. Still work if that is all you find.
  • FP8 KV cache0.34.0from November 16, 2026new release

    2× more context in the same memory

    Keeps the attention cache in 8 bits, so long contexts fit where they did not.

    How to enable: vLLM: --kv-cache-dtype fp8; llama.cpp: -ctk q8_0 -ctv q8_0.

  • vLLM / SGLang0.34.0from November 16, 2026new release

    many times more tokens/s on a server

    Server engines: batching, FlashAttention, FP8 and speculative decoding out of the box.

    How to enable: vllm serve <model> — an OpenAI-compatible API.

    Earlier generations (1)
    • llama.cpp — GGUF models on any GPU, Mac or even CPU; some layers can stay in RAM.

Model family

New posts about versions of shika-10m (quants, finetunes, LoRAs) will show up under the bell.

No known relatives of this model yet. All derivatives on Hugging Face

About the model

deerfieldgreen/shika-10m
Author
deerfieldgreen
Category
Language models
Released
Posted

On NeyroLearn

Hugging Face

00

Ask AI about this model

Answered by Gemini 4 · the chat is kept only in this tab

Comments