Instructions to use gulding/EmsyAI with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use gulding/EmsyAI 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 gulding/EmsyAI:F32 # Run inference directly in the terminal: llama cli -hf gulding/EmsyAI:F32
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf gulding/EmsyAI:F32 # Run inference directly in the terminal: llama cli -hf gulding/EmsyAI:F32
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 gulding/EmsyAI:F32 # Run inference directly in the terminal: ./build/bin/llama cli -hf gulding/EmsyAI:F32
Use Docker
docker model run hf.co/gulding/EmsyAI:F32
- Llama new
- LM Studio
- Jan
- vLLM
How to use gulding/EmsyAI with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gulding/EmsyAI" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gulding/EmsyAI", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/gulding/EmsyAI:F32
- Ollama
How to use gulding/EmsyAI with Ollama:
ollama run hf.co/gulding/EmsyAI:F32
- Unsloth Desktop
- Docker Model Runner
How to use gulding/EmsyAI with Docker Model Runner:
docker model run hf.co/gulding/EmsyAI:F32
- Lemonade
How to use gulding/EmsyAI with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull gulding/EmsyAI:F32
Run and chat with the model
lemonade run user.EmsyAI-F32
List all available models
lemonade list
- Atomic Chat
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
tags:
|
| 6 |
+
- from-scratch
|
| 7 |
+
- pytorch
|
| 8 |
+
- educational
|
| 9 |
+
- lora
|
| 10 |
+
- code-generation
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# EmsyAI 🧠
|
| 14 |
+
|
| 15 |
+
EmsyAI is a **28 Million Parameter Decoder-only Transformer** built entirely from scratch in pure PyTorch for educational purposes. It is not a wrapper around the `transformers` library, but a fully hand-rolled implementation of a modern LLM architecture (heavily inspired by Llama 3).
|
| 16 |
+
|
| 17 |
+
## 🏗️ Model Architecture
|
| 18 |
+
|
| 19 |
+
- **Parameters**: ~28 Million
|
| 20 |
+
- **Layers**: 8
|
| 21 |
+
- **Hidden Dimension**: 512
|
| 22 |
+
- **Attention Heads**: 8 Query, 4 KV (Grouped Query Attention)
|
| 23 |
+
- **FFN Hidden Dimension**: 1408 (SwiGLU)
|
| 24 |
+
- **Context Length**: 512
|
| 25 |
+
- **Vocab Size**: 8000
|
| 26 |
+
- **Normalization**: Pre-RMSNorm
|
| 27 |
+
- **Positional Encoding**: Rotary Positional Embeddings (RoPE)
|
| 28 |
+
|
| 29 |
+
## 🔧 Training Details
|
| 30 |
+
|
| 31 |
+
### Phase 1: Base Pretraining
|
| 32 |
+
The base model was pretrained from scratch on ~40MB of Python source code (from the CPython repository) using a hand-rolled Byte-Pair Encoding (BPE) tokenizer.
|
| 33 |
+
- **Optimizer**: AdamW with `bfloat16` mixed precision
|
| 34 |
+
- **Learning Rate**: Cosine decay with linear warmup
|
| 35 |
+
- **Final Perplexity**: ~10.77
|
| 36 |
+
|
| 37 |
+
### Phase 2: Instruction Fine-Tuning (LoRA)
|
| 38 |
+
The model was fine-tuned to follow instructions using a custom, from-scratch Low-Rank Adaptation (LoRA) implementation.
|
| 39 |
+
- **Dataset**: `CodeAlpaca-20k`
|
| 40 |
+
- **LoRA Targets**: All linear layers (Q, K, V, O, w1, w2, w3)
|
| 41 |
+
- **Trainable Parameters**: 598,016 (2.11%)
|
| 42 |
+
- **Final Loss**: ~1.92
|
| 43 |
+
|
| 44 |
+
## 💻 Usage
|
| 45 |
+
|
| 46 |
+
To use this model, you will need the custom inference code from the GitHub repository:
|
| 47 |
+
[https://github.com/gulding/EmsyAI](https://github.com/gulding/EmsyAI)
|
| 48 |
+
|
| 49 |
+
Because the tokenizer and architecture are custom-built, this model is **not directly compatible** with the `transformers` `AutoModel` API. It is designed to be run using the `chat_instruct.py` script provided in the GitHub repo.
|
| 50 |
+
|
| 51 |
+
## 🎓 Educational Value
|
| 52 |
+
This project demonstrates how to build every layer of a modern Large Language Model from mathematical first principles, including the data pipeline, the Transformer core, LoRA adapters, and autoregressive KV-caching generation.
|