Instructions to use inaciose/inacio-sft-d16v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use inaciose/inacio-sft-d16v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="inaciose/inacio-sft-d16v1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("inaciose/inacio-sft-d16v1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use inaciose/inacio-sft-d16v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "inaciose/inacio-sft-d16v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "inaciose/inacio-sft-d16v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/inaciose/inacio-sft-d16v1
- SGLang
How to use inaciose/inacio-sft-d16v1 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 "inaciose/inacio-sft-d16v1" \ --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": "inaciose/inacio-sft-d16v1", "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 "inaciose/inacio-sft-d16v1" \ --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": "inaciose/inacio-sft-d16v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use inaciose/inacio-sft-d16v1 with Docker Model Runner:
docker model run hf.co/inaciose/inacio-sft-d16v1
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("inaciose/inacio-sft-d16v1", device_map="auto")inacio-sft-d16v1
inacio-sft-d16v1 is the first instruction-tuned model of the nanochatpt project. It is obtained by supervised fine-tuning (SFT) of the base model inacio-d16v1, with the objective of improving conversational abilities while maintaining European Portuguese (PT-PT) as the primary language.
This release represents the first end-to-end demonstration of the complete nanochatpt training pipeline, from tokenizer training to pretraining and supervised fine-tuning.
Base Model
This model is fine-tuned from:
- inaciose/inacio-d16v1
The base model was pretrained from scratch on a corpus primarily composed of European Portuguese text, together with a smaller proportion of English.
Model Architecture
- Architecture: NanoChat
- Decoder-only Transformer
- Parameters: 872,416,058
- Layers: 16
- Hidden size: 1024
- Attention heads: 8
- KV heads: 8
- Context length: 2048 tokens
- Vocabulary: 65,536 tokens
Supervised Fine-Tuning Dataset
The instruction tuning stage uses NanoChat's TaskMixture framework.
Training data consists of:
- CAIS MMLU (English)
- OpenAI GSM8K (English)
- inaciose/smol-smoltalk-pt-v1 (Mix European Portuguese 80%, English 20%)
The Portuguese conversational dataset smol-smoltalk-pt-v1 was created specifically for this project as a temporary PT-PT replacement for HuggingFaceTB/smol-smoltalk.
It is derived from:
- AMALIA-LLM-0626-SFT-Dataset
Future releases will progressively replace the remaining English instruction datasets with Portuguese equivalents.
https://huggingface.co/datasets/cais/mmlu https://huggingface.co/datasets/openai/gsm8k https://huggingface.co/datasets/inaciose/smol-smoltalk-pt-v1
Training
Supervised fine-tuning was performed on the Modal cloud platform using:
- 4 Γ NVIDIA A100 SXM4 80GB
The model was initialized directly from the pretrained checkpoint of inacio-d16v1.
Intended Uses
This model is intended for:
- conversational assistants
- experimentation
- educational purposes
- research on European Portuguese language models
Current Capabilities
The model is capable of:
- maintaining multi-turn conversations
- following simple instructions
- generating structured answers
- responding primarily in Portuguese
Compared to the base model, it produces considerably more natural conversational responses and follows instruction formats learned during supervised fine-tuning.
Current Limitations
This is the first public SFT release of nanochatpt.
The model still presents significant limitations, including:
- factual hallucinations
- weak mathematical reasoning
- inconsistent scientific explanations
- occasional repetition
- occasional generation of special conversation tokens (e.g.
<|assistant_end|>)
These behaviours are expected for a first-generation instruction-tuned model trained on a relatively small Portuguese conversational corpus.
Future releases may improve both the instruction dataset and the amount of Portuguese pretraining data.
Requeriments
nanochatpt or nanochat cloned to your machine, install requirements. https://github.com/inaciose/nanochatpt
copy the model to your local folder copy the tokenizer to your local folder
cache/modal βββ chatsft_checkpoints β βββ d16 β βββ meta_0XXXXX.json β βββ model_0XXXXX.pt β βββ optim_0XXXXX_rank0.pt β βββ optim_0XXXXX_rank1.pt β βββ optim_0XXXXX_rank2.pt β βββ optim_0XXXXX_rank3.pt βββ tokenizer βββ token_bytes.pt βββ tokenizer.pkl
export NANOCHAT_BASE_DIR=cache/modal
run the python -m scripts/chat_cli.py
Project
nanochatpt is an personal open research project whose objective is to train compact language models from scratch with European Portuguese as the primary language.
Future work includes:
- larger pretraining corpora
- improved Portuguese instruction datasets
- Portuguese evaluation benchmarks
- additional supervised fine-tuning
- reinforcement learning alignment
Model tree for inaciose/inacio-sft-d16v1
Base model
inaciose/inacio-d16v1
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="inaciose/inacio-sft-d16v1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)