Instructions to use AZERDSQ/G1-nano-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AZERDSQ/G1-nano-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AZERDSQ/G1-nano-instruct", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("AZERDSQ/G1-nano-instruct", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AZERDSQ/G1-nano-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AZERDSQ/G1-nano-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AZERDSQ/G1-nano-instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/AZERDSQ/G1-nano-instruct
- SGLang
How to use AZERDSQ/G1-nano-instruct 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 "AZERDSQ/G1-nano-instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AZERDSQ/G1-nano-instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "AZERDSQ/G1-nano-instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AZERDSQ/G1-nano-instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use AZERDSQ/G1-nano-instruct with Docker Model Runner:
docker model run hf.co/AZERDSQ/G1-nano-instruct
G1-nano-instruct
A 60M-parameter GPT pretrained and instruction-tuned entirely on a single 8GB-RAM NVIDIA Jetson device, without cloud infrastructure or multi-GPU setups. Chat-oriented checkpoint with a native 2048-token context and real multi-turn conversation support.
Overview
G1-nano-instruct is the instruction-tuned version of G1 Nano. Both pretraining and supervised fine-tuning were performed under an 8GB unified-memory constraint.
It is not a larger or universally better successor to G0 Nano. The model keeps roughly the same parameter count and compute budget while prioritizing a native 2048-token context and multi-turn conversation support.
Model variants
The raw pretrained version of the same model is available as G1-nano-base.
What this version adds
Compared with G1-nano-base, this checkpoint adds supervised instruction fine-tuning, a chat format and real multi-turn conversation support.
Compared with the G0 Nano design, the main differences are the native 2048-token context and the multi-turn fine-tuning recipe, while keeping a similar model size and hardware budget.
Architecture
Llama-style decoder-only Transformer:
| Property | Value |
|---|---|
| Parameters | 60.0M, with embeddings shared with the language-model head |
| Layers | 14 |
| Hidden size | 576 |
| Attention | Grouped-Query Attention, 9 query heads / 1 key-value head, head dimension 64 |
| Position encoding | RoPE, θ=10000 |
| Feed-forward network | SwiGLU, hidden dimension 1664 |
| Normalization | RMSNorm |
| Context length | 2048 tokens, used natively in pretraining and fine-tuning |
| Vocabulary | 16,388 tokens: 16,384 SentencePiece tokens plus 4 chat tokens |
Training
- Pretraining data: approximately 1.5B tokens of English web and book text
- Sources: FineWeb-Edu, BookCorpus, OpenWebText, PG-19 and WikiHow
- Instruction tuning: approximately 39K conversations from UltraChat, OpenAssistant/oasst1 and cleaned Alpaca
- Conversation format: multi-turn conversations, packed without cross-conversation leakage
- Objective: causal next-token prediction followed by supervised instruction fine-tuning
- Training hardware: a single NVIDIA Jetson with 8GB of unified memory
Usage
Hugging Face Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "AZERDSQ/G1-nano-instruct"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_id, trust_remote_code=True)
messages = [
{"role": "user", "content": "What is the capital of France?"},
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
inputs = tokenizer(text, return_tensors="pt")
outputs = model.generate(
**inputs,
max_new_tokens=50,
do_sample=True,
top_k=50,
temperature=0.8,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
trust_remote_code=True is required because this repository uses a custom Transformer implementation.
Ollama
ollama run azerdsq/g1-nano-instruct
The chat format is built into the model. Conversation history can be carried across turns.
Benchmarks
Limitations
- 60M parameters impose a hard limit on factual knowledge; expect fluent but frequently incorrect answers on knowledge-intensive prompts.
- Maximum context length is 2048 tokens, which remains short compared with modern language models.
- English-only training data.
- Multi-turn support does not imply long-term memory or reliable conversation consistency.
- Single-sequence generation only; padded batched inference is not supported by the custom model code.
This model should not be used for high-stakes decisions, factual verification, medical advice, legal advice or autonomous actions.
License
Apache 2.0. This release contains model weights and the code required to load them; it does not include the training data or private training infrastructure.
Links
- Downloads last month
- -
