Text Generation
Transformers
Safetensors
English
gabgpt
gift-of-gab
small-language-model
trained-from-scratch
byte-level
game-boy-advance
browser
conversational
custom_code
Instructions to use gszauer/ChatGBA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gszauer/ChatGBA with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="gszauer/ChatGBA", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("gszauer/ChatGBA", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use gszauer/ChatGBA with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gszauer/ChatGBA" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gszauer/ChatGBA", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/gszauer/ChatGBA
- SGLang
How to use gszauer/ChatGBA 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 "gszauer/ChatGBA" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gszauer/ChatGBA", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "gszauer/ChatGBA" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gszauer/ChatGBA", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use gszauer/ChatGBA with Docker Model Runner:
docker model run hf.co/gszauer/ChatGBA
|
Download source/README.md from gszauer/ChatGBA: direct link, hf CLI and curl.
- Browser
- Download file 2.01 kB
-
https://huggingface.co/gszauer/ChatGBA/resolve/main/source/README.md
- Command line
-
hf download hf://gszauer/ChatGBA/source/README.md
-
curl -L -o README.md https://huggingface.co/gszauer/ChatGBA/resolve/main/source/README.md
2.01 kB
| # ChatGBA source | |
| The Game Boy Advance inference engine and chat program behind `ChatGBA.gba`. | |
| ## Build | |
| ``` | |
| brew install arm-none-eabi-gcc # or any arm-none-eabi toolchain | |
| make | |
| ``` | |
| This writes `build/ChatGBA.gba`, byte for byte the same as `../ChatGBA.gba`. The weights come from `../chatgba-int8.bin`; `make WEIGHTS=other.bin` builds with another blob of the same shape. | |
| ## Files | |
| | File | What it is | | |
| |---|---| | |
| | `engine.c`, `engine.h` | The integer inference engine: int8 weights read straight from cartridge ROM, an int8 KV cache in a ring per block, fixed-point everything. Compiled as ARM and run from the fast internal RAM. | | |
| | `dot.s` | The hand-written ARM inner loop: int8 dot products, 16 weights per load burst. | | |
| | `chat.c`, `chat.h` | The conversation: `<|u|>message<|e|><|a|>reply<|e|>` turns through the engine, sampling and stopping at `<|e|>`. | | |
| | `main.c` | The program: the screen, the on-screen keyboard, the buttons, timing. | | |
| | `font.h` | The 6 × 10 font (Monaco at 9 px, with hand-drawn descenders). `font.py` regenerates it (needs Pillow). | | |
| | `model_config.h` | The model's shape and chat markers as compile-time constants, checked against the weights at start-up. | | |
| | `blob.s` | Places the weights (`model.bin`) in ROM. | | |
| | `crt0.s`, `gba.ld` | Start-up code and the memory map: ROM, the 256 KB of external work RAM (the KV cache), the 32 KB of internal RAM (the engine). | | |
| | `libc.c`, `gba_include/string.h` | The four C library functions the program needs; there is no C library. | | |
| | `fix_header.py` | Writes the Nintendo logo and header checksum into the ROM, so real hardware boots it. | | |
| ## The weights | |
| `chatgba-int8.bin` is the float32 model (`../chatgba-float32.gab`) quantized for this engine: every matrix as int8 with one scale per output row, norm scales and canon filters in Q16, plus lookup tables for RoPE, softmax and SiLU. The quantizer is part of the training code (not included here), since it reads the float model with it; it also writes `model_config.h`. | |