Text Generation
Transformers
Safetensors
English
Italian
gpt2
1gpu-llm
single-gpu
trained-from-scratch
gpt2preln
bilingual
english
italian
pretraining
base-model
causal-lm
llm-nanochat
preln
decay-only
text-generation-inference
Instructions to use nazdef/1gpu-llm-small-en-it-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nazdef/1gpu-llm-small-en-it-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nazdef/1gpu-llm-small-en-it-base")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("nazdef/1gpu-llm-small-en-it-base") model = AutoModelForCausalLM.from_pretrained("nazdef/1gpu-llm-small-en-it-base") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use nazdef/1gpu-llm-small-en-it-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nazdef/1gpu-llm-small-en-it-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nazdef/1gpu-llm-small-en-it-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/nazdef/1gpu-llm-small-en-it-base
- SGLang
How to use nazdef/1gpu-llm-small-en-it-base 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 "nazdef/1gpu-llm-small-en-it-base" \ --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": "nazdef/1gpu-llm-small-en-it-base", "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 "nazdef/1gpu-llm-small-en-it-base" \ --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": "nazdef/1gpu-llm-small-en-it-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use nazdef/1gpu-llm-small-en-it-base with Docker Model Runner:
docker model run hf.co/nazdef/1gpu-llm-small-en-it-base
| { | |
| "name": "decoding_tuning_en_it_v1", | |
| "config_path": "/tmp/llm-nanochat-dev-p0p1/configs/eval/decoding_tuning.yaml", | |
| "checkpoint_path": "/mnt/apps/llm-nanochat/checkpoints/20260622_resume-gpt2small-gpt2preln-k20-wsds800-final2e5-webwiki-step8000-dense50/step_8600.pt", | |
| "tokenizer_dir": "/mnt/apps/llm-nanochat/tokenizers/tokenizer_20260515_en50it50_webwiki_stratified_500M", | |
| "tuning_prompts_path": "/tmp/llm-nanochat-dev-p0p1/eval_prompts/decoding_tuning.jsonl", | |
| "holdout_prompts_path": "/tmp/llm-nanochat-dev-p0p1/eval_prompts/decoding_tuning_holdout.jsonl", | |
| "seeds": [ | |
| 1337, | |
| 1338, | |
| 1339 | |
| ], | |
| "holdout_top_k": 3, | |
| "target_length_ratio": 0.8, | |
| "score_weights": { | |
| "prompt_pass_rate": 2.0, | |
| "completion_rate": 0.5, | |
| "distinct_2": 1.2, | |
| "language_consistency": 0.75, | |
| "length_closeness": 0.5, | |
| "loop_rate": -2.0, | |
| "repeated_4gram_rate": -1.5, | |
| "language_switch_rate": -0.75 | |
| }, | |
| "presets": [ | |
| { | |
| "name": "balanced", | |
| "max_new_tokens": 64, | |
| "temperature": 0.8, | |
| "top_k": 50, | |
| "top_p": 0.95, | |
| "repetition_penalty": 1.1, | |
| "no_repeat_ngram_size": 0, | |
| "score": 2.7889629329004326, | |
| "score_breakdown": { | |
| "prompt_pass_rate": 0.08333333333333333, | |
| "completion_rate": 0.9523809523809523, | |
| "distinct_2": 0.9175757575757576, | |
| "language_consistency": 0.9513888888888888, | |
| "length_closeness": 0.9486607142857142, | |
| "loop_rate": 0.0, | |
| "repeated_4gram_rate": 0.09523809523809523, | |
| "language_switch_rate": 0.0 | |
| }, | |
| "total_rows": 21, | |
| "scored_rows": 12, | |
| "passed_rows": 1, | |
| "prompt_pass_rate": 0.08333333333333333, | |
| "completion_rate": 0.9523809523809523, | |
| "avg_generated_tokens": 48.57142857142857, | |
| "length_ratio": 0.7589285714285714, | |
| "length_closeness": 0.9486607142857142, | |
| "distinct_1": 0.5171597633136095, | |
| "distinct_2": 0.9175757575757576, | |
| "repeated_4gram_rate": 0.09523809523809523, | |
| "loop_rate": 0.0, | |
| "language_switch_rate_en": 0.0, | |
| "language_switch_rate_it": 0.0, | |
| "language_consistency_en": 0.9583333333333334, | |
| "language_consistency_it": 0.9444444444444444, | |
| "language_consistency_mean": 0.9513888888888888, | |
| "language_switch_rate_mean": 0.0, | |
| "tuning_rank": 1 | |
| }, | |
| { | |
| "name": "creative", | |
| "max_new_tokens": 64, | |
| "temperature": 1.0, | |
| "top_k": 100, | |
| "top_p": 0.95, | |
| "repetition_penalty": 1.1, | |
| "no_repeat_ngram_size": 0, | |
| "score": 2.7750582298136646, | |
| "score_breakdown": { | |
| "prompt_pass_rate": 0.08333333333333333, | |
| "completion_rate": 1.0, | |
| "distinct_2": 0.9565217391304348, | |
| "language_consistency": 0.9791666666666667, | |
| "length_closeness": 0.9285714285714287, | |
| "loop_rate": 0.047619047619047616, | |
| "repeated_4gram_rate": 0.09523809523809523, | |
| "language_switch_rate": 0.0 | |
| }, | |
| "total_rows": 21, | |
| "scored_rows": 12, | |
| "passed_rows": 1, | |
| "prompt_pass_rate": 0.08333333333333333, | |
| "completion_rate": 1.0, | |
| "avg_generated_tokens": 54.857142857142854, | |
| "length_ratio": 0.8571428571428571, | |
| "length_closeness": 0.9285714285714287, | |
| "distinct_1": 0.5599128540305011, | |
| "distinct_2": 0.9565217391304348, | |
| "repeated_4gram_rate": 0.09523809523809523, | |
| "loop_rate": 0.047619047619047616, | |
| "language_switch_rate_en": 0.0, | |
| "language_switch_rate_it": 0.0, | |
| "language_consistency_en": 0.9583333333333334, | |
| "language_consistency_it": 1.0, | |
| "language_consistency_mean": 0.9791666666666667, | |
| "language_switch_rate_mean": 0.0, | |
| "tuning_rank": 2 | |
| }, | |
| { | |
| "name": "anti_loop", | |
| "max_new_tokens": 64, | |
| "temperature": 0.8, | |
| "top_k": 50, | |
| "top_p": 0.9, | |
| "repetition_penalty": 1.15, | |
| "no_repeat_ngram_size": 4, | |
| "score": 2.7175428468801313, | |
| "score_breakdown": { | |
| "prompt_pass_rate": 0.0, | |
| "completion_rate": 0.9523809523809523, | |
| "distinct_2": 0.9261083743842364, | |
| "language_consistency": 0.9583333333333333, | |
| "length_closeness": 0.9654017857142857, | |
| "loop_rate": 0.0, | |
| "repeated_4gram_rate": 0.047619047619047616, | |
| "language_switch_rate": 0.0 | |
| }, | |
| "total_rows": 21, | |
| "scored_rows": 12, | |
| "passed_rows": 0, | |
| "prompt_pass_rate": 0.0, | |
| "completion_rate": 0.9523809523809523, | |
| "avg_generated_tokens": 49.42857142857143, | |
| "length_ratio": 0.7723214285714286, | |
| "length_closeness": 0.9654017857142857, | |
| "distinct_1": 0.5252403846153846, | |
| "distinct_2": 0.9261083743842364, | |
| "repeated_4gram_rate": 0.047619047619047616, | |
| "loop_rate": 0.0, | |
| "language_switch_rate_en": 0.0, | |
| "language_switch_rate_it": 0.0, | |
| "language_consistency_en": 0.9166666666666666, | |
| "language_consistency_it": 1.0, | |
| "language_consistency_mean": 0.9583333333333333, | |
| "language_switch_rate_mean": 0.0, | |
| "tuning_rank": 3 | |
| }, | |
| { | |
| "name": "conservative", | |
| "max_new_tokens": 64, | |
| "temperature": 0.6, | |
| "top_k": 40, | |
| "top_p": 0.9, | |
| "repetition_penalty": 1.05, | |
| "no_repeat_ngram_size": 0, | |
| "score": 1.3666469369276413, | |
| "score_breakdown": { | |
| "prompt_pass_rate": 0.25, | |
| "completion_rate": 0.8571428571428571, | |
| "distinct_2": 0.6885441527446301, | |
| "language_consistency": 0.9353070175438596, | |
| "length_closeness": 0.9635416666666666, | |
| "loop_rate": 0.2857142857142857, | |
| "repeated_4gram_rate": 0.6666666666666666, | |
| "language_switch_rate": 0.0 | |
| }, | |
| "total_rows": 21, | |
| "scored_rows": 12, | |
| "passed_rows": 3, | |
| "prompt_pass_rate": 0.25, | |
| "completion_rate": 0.8571428571428571, | |
| "avg_generated_tokens": 49.333333333333336, | |
| "length_ratio": 0.7708333333333334, | |
| "length_closeness": 0.9635416666666666, | |
| "distinct_1": 0.375, | |
| "distinct_2": 0.6885441527446301, | |
| "repeated_4gram_rate": 0.6666666666666666, | |
| "loop_rate": 0.2857142857142857, | |
| "language_switch_rate_en": 0.0, | |
| "language_switch_rate_it": 0.0, | |
| "language_consistency_en": 0.8706140350877193, | |
| "language_consistency_it": 1.0, | |
| "language_consistency_mean": 0.9353070175438596, | |
| "language_switch_rate_mean": 0.0, | |
| "tuning_rank": 4 | |
| }, | |
| { | |
| "name": "greedy", | |
| "max_new_tokens": 64, | |
| "temperature": 0.0, | |
| "top_k": 0, | |
| "top_p": 1.0, | |
| "repetition_penalty": 1.0, | |
| "no_repeat_ngram_size": 0, | |
| "score": -0.9418192340067341, | |
| "score_breakdown": { | |
| "prompt_pass_rate": 0.0, | |
| "completion_rate": 0.8571428571428571, | |
| "distinct_2": 0.05499438832772166, | |
| "language_consistency": 0.7708333333333333, | |
| "length_closeness": 0.9709821428571428, | |
| "loop_rate": 0.7142857142857143, | |
| "repeated_4gram_rate": 0.7142857142857143, | |
| "language_switch_rate": 0.0 | |
| }, | |
| "total_rows": 21, | |
| "scored_rows": 12, | |
| "passed_rows": 0, | |
| "prompt_pass_rate": 0.0, | |
| "completion_rate": 0.8571428571428571, | |
| "avg_generated_tokens": 49.714285714285715, | |
| "length_ratio": 0.7767857142857143, | |
| "length_closeness": 0.9709821428571428, | |
| "distinct_1": 0.0429042904290429, | |
| "distinct_2": 0.05499438832772166, | |
| "repeated_4gram_rate": 0.7142857142857143, | |
| "loop_rate": 0.7142857142857143, | |
| "language_switch_rate_en": 0.0, | |
| "language_switch_rate_it": 0.0, | |
| "language_consistency_en": 0.875, | |
| "language_consistency_it": 0.6666666666666666, | |
| "language_consistency_mean": 0.7708333333333333, | |
| "language_switch_rate_mean": 0.0, | |
| "tuning_rank": 5 | |
| } | |
| ], | |
| "holdout_presets": [ | |
| { | |
| "name": "anti_loop", | |
| "max_new_tokens": 64, | |
| "temperature": 0.8, | |
| "top_k": 50, | |
| "top_p": 0.9, | |
| "repetition_penalty": 1.15, | |
| "no_repeat_ngram_size": 4, | |
| "score": 3.339239677156561, | |
| "score_breakdown": { | |
| "prompt_pass_rate": 0.3333333333333333, | |
| "completion_rate": 1.0, | |
| "distinct_2": 0.9384885764499121, | |
| "language_consistency": 1.0, | |
| "length_closeness": 0.8427734375, | |
| "loop_rate": 0.0, | |
| "repeated_4gram_rate": 0.08333333333333333, | |
| "language_switch_rate": 0.0 | |
| }, | |
| "total_rows": 12, | |
| "scored_rows": 9, | |
| "passed_rows": 3, | |
| "prompt_pass_rate": 0.3333333333333333, | |
| "completion_rate": 1.0, | |
| "avg_generated_tokens": 59.25, | |
| "length_ratio": 0.92578125, | |
| "length_closeness": 0.8427734375, | |
| "distinct_1": 0.5800344234079173, | |
| "distinct_2": 0.9384885764499121, | |
| "repeated_4gram_rate": 0.08333333333333333, | |
| "loop_rate": 0.0, | |
| "language_switch_rate_en": 0.0, | |
| "language_switch_rate_it": 0.0, | |
| "language_consistency_en": 1.0, | |
| "language_consistency_it": 1.0, | |
| "language_consistency_mean": 1.0, | |
| "language_switch_rate_mean": 0.0, | |
| "holdout_rank": 3 | |
| }, | |
| { | |
| "name": "balanced", | |
| "max_new_tokens": 64, | |
| "temperature": 0.8, | |
| "top_k": 50, | |
| "top_p": 0.95, | |
| "repetition_penalty": 1.1, | |
| "no_repeat_ngram_size": 0, | |
| "score": 3.188462652470918, | |
| "score_breakdown": { | |
| "prompt_pass_rate": 0.3333333333333333, | |
| "completion_rate": 1.0, | |
| "distinct_2": 0.9244288224956063, | |
| "language_consistency": 0.9761904761904763, | |
| "length_closeness": 0.8606770833333334, | |
| "loop_rate": 0.0, | |
| "repeated_4gram_rate": 0.16666666666666666, | |
| "language_switch_rate": 0.0 | |
| }, | |
| "total_rows": 12, | |
| "scored_rows": 9, | |
| "passed_rows": 3, | |
| "prompt_pass_rate": 0.3333333333333333, | |
| "completion_rate": 1.0, | |
| "avg_generated_tokens": 58.333333333333336, | |
| "length_ratio": 0.9114583333333334, | |
| "length_closeness": 0.8606770833333334, | |
| "distinct_1": 0.5628227194492255, | |
| "distinct_2": 0.9244288224956063, | |
| "repeated_4gram_rate": 0.16666666666666666, | |
| "loop_rate": 0.0, | |
| "language_switch_rate_en": 0.0, | |
| "language_switch_rate_it": 0.0, | |
| "language_consistency_en": 1.0, | |
| "language_consistency_it": 0.9523809523809524, | |
| "language_consistency_mean": 0.9761904761904763, | |
| "language_switch_rate_mean": 0.0, | |
| "holdout_rank": 1 | |
| }, | |
| { | |
| "name": "creative", | |
| "max_new_tokens": 64, | |
| "temperature": 1.0, | |
| "top_k": 100, | |
| "top_p": 0.95, | |
| "repetition_penalty": 1.1, | |
| "no_repeat_ngram_size": 0, | |
| "score": 3.096005074384881, | |
| "score_breakdown": { | |
| "prompt_pass_rate": 0.1111111111111111, | |
| "completion_rate": 1.0, | |
| "distinct_2": 0.9579158316633266, | |
| "language_consistency": 1.0, | |
| "length_closeness": 0.9485677083333334, | |
| "loop_rate": 0.0, | |
| "repeated_4gram_rate": 0.0, | |
| "language_switch_rate": 0.0 | |
| }, | |
| "total_rows": 12, | |
| "scored_rows": 9, | |
| "passed_rows": 1, | |
| "prompt_pass_rate": 0.1111111111111111, | |
| "completion_rate": 1.0, | |
| "avg_generated_tokens": 53.833333333333336, | |
| "length_ratio": 0.8411458333333334, | |
| "length_closeness": 0.9485677083333334, | |
| "distinct_1": 0.6379647749510763, | |
| "distinct_2": 0.9579158316633266, | |
| "repeated_4gram_rate": 0.0, | |
| "loop_rate": 0.0, | |
| "language_switch_rate_en": 0.0, | |
| "language_switch_rate_it": 0.0, | |
| "language_consistency_en": 1.0, | |
| "language_consistency_it": 1.0, | |
| "language_consistency_mean": 1.0, | |
| "language_switch_rate_mean": 0.0, | |
| "holdout_rank": 2 | |
| } | |
| ], | |
| "recommended_preset": { | |
| "name": "balanced", | |
| "score": 2.7889629329004326, | |
| "score_breakdown": { | |
| "prompt_pass_rate": 0.08333333333333333, | |
| "completion_rate": 0.9523809523809523, | |
| "distinct_2": 0.9175757575757576, | |
| "language_consistency": 0.9513888888888888, | |
| "length_closeness": 0.9486607142857142, | |
| "loop_rate": 0.0, | |
| "repeated_4gram_rate": 0.09523809523809523, | |
| "language_switch_rate": 0.0 | |
| } | |
| }, | |
| "artifacts": { | |
| "summary_json": "/mnt/apps/llm-nanochat/evals/20260623_0346_gpt2small_preln_step8600_decoding_search/summary.json", | |
| "report_md": "/mnt/apps/llm-nanochat/evals/20260623_0346_gpt2small_preln_step8600_decoding_search/report.md", | |
| "tuning_leaderboard_csv": "/mnt/apps/llm-nanochat/evals/20260623_0346_gpt2small_preln_step8600_decoding_search/tuning_leaderboard.csv", | |
| "holdout_leaderboard_csv": "/mnt/apps/llm-nanochat/evals/20260623_0346_gpt2small_preln_step8600_decoding_search/holdout_leaderboard.csv", | |
| "tuning_generations_jsonl": "/mnt/apps/llm-nanochat/evals/20260623_0346_gpt2small_preln_step8600_decoding_search/tuning_generations.jsonl", | |
| "holdout_generations_jsonl": "/mnt/apps/llm-nanochat/evals/20260623_0346_gpt2small_preln_step8600_decoding_search/holdout_generations.jsonl" | |
| } | |
| } |