YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

Available Files

File Format Size Use Case
model.safetensors SafeTensors ~445 MB HuggingFace / Transformers
garras-F16.gguf GGUF F16 ~226 MB Full precision, Ollama / llama.cpp
garras-Q8_0.gguf GGUF Q8 ~130 MB ⭐ Recommended for local inference
Modelfile-f16 Ollama β€” Modelfile for F16 variant
Modelfile-q8 Ollama β€” Modelfile for Q8 variant

For models under 1B parameters, Q8 is the recommended quantization. Q4 is too lossy at this scale and noticeably degrades output quality.

Model Details

Architecture

Garras is a standard GPT-2 decoder-only transformer with pre-norm layer normalization and weight tying between the token embedding and the language model head.

Hyperparameter Value
Layers (n_layer) 12
Attention heads (n_head) 12
Embedding dim (n_embd) 768
Sequence length 2,048
Vocab size 32,000
Dropout 0.1
Activation GELU

Tokenizer

A custom bilingual BPE tokenizer trained on samples from all four data domains, ensuring proper subword coverage for both English and Portuguese.

Special tokens:

Token Purpose
`<\ endoftext\
`<\ padding\
`<\ im_start\
`<\ im_end\
`<\ system\
`<\ user\
`<\ assistant\
`<\ poesia\
`<\ ensaio\

Training Data

Garras was pretrained on a curated mix of four prose/web streams. No QA pairs or instruction data were used during pretraining β€” those are reserved for fine-tuning.

Domain Weight Datasets Purpose
General English 50% FineWeb (CC-MAIN-2024-10), ML-ArXiv-Papers High-quality filtered web + academic prose
Brazilian Portuguese 30% Portuguese-PD, ClassiCC-PT Bilingual balance β€” Garras's core differentiator
Multilingual bridge 10% mC4 (pt), VeraCruz PT-BR EN↔PT vocabulary overlap, reduces code-switching
EN Academic 10% peS2o (Semantic Scholar) Structured reasoning patterns

Training Procedure

Hyperparameter Value
Optimizer AdamW
Learning rate 3e-4
LR schedule Cosine with warmup
Warmup steps 2,000
Weight decay 0.1
Max gradient norm 1.0
Batch size 16 Γ— 4 grad accum Γ— 2048 seq = 131K tokens/step
Total tokens 2.2B
Precision fp16 mixed precision
Hardware 1Γ— NVIDIA A100 40GB (Google Colab)

Fine-Tuning Roadmap

Garras is designed as a base model. The following fine-tuning stages are planned:

Stage Datasets Status
Instruction + Chat UltraChat 200K, Aya (PT), OpenHermes πŸ”œ Planned
Domain specialization KisanVaani, CROP, Bible QA, Theology QA πŸ”œ Planned
Author voice Custom poetry + essays with `<\ poesia\

Intended Use

Direct Use

  • Bilingual text generation (English and Brazilian Portuguese)
  • Foundation for fine-tuning on domain-specific tasks
  • Research and experimentation with small-scale LLMs
  • Educational purposes β€” understanding transformer training from scratch

Downstream Use

  • Chat assistants (after instruction fine-tuning)
  • Agricultural advisory tools
  • Bilingual content generation
  • Domain-specific QA systems

Out-of-Scope Use

  • This is a 125M parameter base model β€” it will not match the quality of larger instruction-tuned models
  • Not suitable for production use without fine-tuning
  • Should not be used for medical, legal, or safety-critical applications
  • May generate biased, incorrect, or nonsensical text

Bias, Risks, and Limitations

  • Scale limitations: At 125M parameters, Garras has limited world knowledge and reasoning capability compared to larger models.
  • Training data bias: The model inherits biases present in web-crawled data (FineWeb, mC4, etc.) and public-domain books.
  • Language balance: Despite the 30% Portuguese allocation, English performance will generally be stronger due to the larger English data ecosystem.
  • Repetition: Small models are prone to repetitive generation. Use the recommended sampling parameters (temperature 0.85, repeat_penalty 1.35, top_k 40) to mitigate this.
  • Hallucination: The model will confidently generate plausible-sounding but factually incorrect text.

Environmental Impact

  • Hardware: 1Γ— NVIDIA A100 40GB
  • Cloud Provider: Google Colab
  • Training time: ~12-24 hours (estimated for 2.2B tokens)
  • Carbon footprint: Minimal for this model scale

Technical Notes

GGUF Conversion

The GGUF files were produced using llama.cpp's convert_hf_to_gguf.py. The custom BPE tokenizer required a patch to get_vocab_base_pre() to register the tokenizer hash β€” it maps to "gpt2" pre-tokenizer type since both use ByteLevel encoding.

Ollama Sampling Parameters

The Modelfiles include tuned sampling parameters for small model inference:

Parameter Value Purpose
temperature 0.85 Slightly creative, avoids greedy repetition
top_k 40 Cuts noise from low-quality tokens
top_p 0.92 Nucleus sampling threshold
repeat_penalty 1.35 Prevents loops
repeat_last_n 128 Look-back window for repeat penalty
num_predict 512 Caps generation length
tfs_z 0.95 Tail-free sampling
typical_p 0.95 Locally typical sampling

Citation

@misc{garras2025,
  author       = {hipnologo},
  title        = {Garras: A Bilingual English/Portuguese LLM Trained from Scratch},
  year         = {2025},
  publisher    = {HuggingFace},
  url          = {https://huggingface.co/hipnologo/garras}
}

Author

hipnologo β€” GitHub

Built with ❀️ and 🐾 """

api = HfApi() api.upload_file( path_or_fileobj=readme_content.encode("utf-8"), path_in_repo="README.md", repo_id=HF_REPO_NAME, ) print(f"βœ… Model card updated β†’ https://huggingface.co/{HF_REPO_NAME}")

Downloads last month
11
Safetensors
Model size
0.1B params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support