Frosya-1 (Micro-GPT 76M)
The first generation of local Artificial Intelligence developed by Fortaki (DTF). This is an ultra-lightweight language model of the Micro-GPT class, trained completely from scratch (from scratch) on a custom Russian text dataset. The project was built as a core component of the private Frosya (FreeSearch) desktop browser ecosystem.
The main philosophy of the project is to provide a fully functional local AI assistant that runs on absolutely any hardware without needing an internet connection or external APIs.
π Technical Specifications
- Architecture: GPT-2 LM Head (16 layers, 8 attention heads, hidden dimension
n_embd = 512) - Parameter Count: ~76.45 million (saved in FP32 format)
- Model Weights File Size: ~298.6 MB (
micro_gpt_170m.bin) - Dataset Size: 500 MB of cleaned text (~150+ million tokens)
- Tokenizer: Custom BPE (GPT2Tokenizer structure) optimized for the Russian language
- Vocabulary Size: 50,257 tokens
- Context Window: 512 tokens (strictly managed via rolling memory buffer)
π Project Structure
βββ .venv/ # Python virtual environment
βββ tokenizer/ # Custom BPE tokenizer matrix files
β βββ tokenizer.json
β βββ tokenizer_config.json
β βββ vocab.json
βββ micro_gpt_170m.bin # Model weights file (76M parameters in FP32)
βββ chat.py # Text inference script & context manager
βοΈ Core Implementation Details
Small language models (under 1B parameters) are highly prone to rapid context loss, hallucinations, and infinite loops. To maximize the output quality of the 76M weights, several clever heuristics are implemented directly in chat.py:
- Environment Bug Isolation: The script explicitly bypasses
torchvisionmodules to prevent critical import errors withtorchon newer environments (such as Python 3.13+). - Hardcoded System Prompt Injection: The core instruction (
Information: The user's name is Arsen...) is hard-glued to the very beginning of the context array on every generation step, preventing the model from "forgetting" its primary directives. - Sliding Context Window: The algorithm automatically discards (
.pop(0)) the oldest Q&A pairs from the dialogue history as soon as the total length approaches the strict 512-token limit, keeping the system prompt intact. - Conservative Sampling: The generation temperature is set to a low
0.4to keep responses coherent and deterministic, while arepetition_penalty=1.1effectively mitigates phrase-looping bugs.
π οΈ Quick Start
- Ensure you have Python installed (Python 3.11 - 3.13 recommended).
- Activate the pre-configured virtual environment:
# For Windows .venv\Scripts\activate # For Linux/macOS source .venv/bin/activate - Install the core requirements (if setting up a new environment):
pip install torch transformers - Initialize the local chat:
python chat.py
Developed by Fortaki for the DTF indie-dev community. It might be small, but it runs entirely on your own terms!