Text Generation
Transformers
Safetensors
English
qwen3
small
tiny
supra
supra2
efficient
instruct
chat
conversational
text-generation-inference
Instructions to use SupraLabs/Supra2-Medium-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SupraLabs/Supra2-Medium-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SupraLabs/Supra2-Medium-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("SupraLabs/Supra2-Medium-Instruct") model = AutoModelForCausalLM.from_pretrained("SupraLabs/Supra2-Medium-Instruct", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SupraLabs/Supra2-Medium-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SupraLabs/Supra2-Medium-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SupraLabs/Supra2-Medium-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SupraLabs/Supra2-Medium-Instruct
- SGLang
How to use SupraLabs/Supra2-Medium-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 "SupraLabs/Supra2-Medium-Instruct" \ --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": "SupraLabs/Supra2-Medium-Instruct", "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 "SupraLabs/Supra2-Medium-Instruct" \ --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": "SupraLabs/Supra2-Medium-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use SupraLabs/Supra2-Medium-Instruct with Docker Model Runner:
docker model run hf.co/SupraLabs/Supra2-Medium-Instruct
| license: apache-2.0 | |
| viewer: false | |
| datasets: | |
| - HuggingFaceFW/fineweb-edu | |
| language: | |
| - en | |
| pipeline_tag: text-generation | |
| library_name: transformers | |
| tags: | |
| - small | |
| - tiny | |
| - supra | |
| - supra2 | |
| - qwen3 | |
| - efficient | |
| - instruct | |
| - chat | |
| base_model: | |
| - SupraLabs/Supra2-Medium-Base | |
| <h1 align="center">Supra2-Medium Instruct</h1> | |
| <p align="center"> | |
| Ultra-efficient chat instruction model • 25M Parameters • 1K Context | |
| </p> | |
|  | |
| **Supra2-Medium Instruct** is a 25M-parameter decoder-only language model pretrained from scratch by **SupraLabs** on 20B tokens of English web text. It uses the **Qwen3** architecture with a custom 16,384-token tokenizer. This is the instruct version of Supra2-Medium-Base. | |
| --- | |
| ## **Some samples...** | |
| Prompt: "How does ChatGPT work?" | |
| Answer: | |
| ```plaintext | |
| ChatGT is a chatbot-based AI that uses text-based language to generate and share information, such as responses, responses, and other forms of communication. It works by using natural language processing (NLP) to generate text, which is then converted into actionable responses. The AI then uses this NLP to generate the text, making it available for downloading, sharing, and retrieving. | |
| The AI then generates the text based on the input, allowing users to respond quickly and efficiently. This process is called "collaboration" or "memory" of the input text, where users can share their thoughts, feelings, and experiences with others. The chatbot then uses the text to generate responses, which are then sent to the AI to be used by the user. | |
| Overall, Chat GPT is a powerful tool for creating and sharing content, and it has become an integral part of many modern daily life, enabling people to interact with and understand the world around them. | |
| ``` | |
| Prompt: "What is AI?" | |
| Answer: | |
| ```plaintext | |
| AI is a technology that enables machines to learn, adapt, and improve their behavior. It's a way for humans to learn and adapt to new situations, from simple tasks like reading to more complex ones like writing. AI is used in various fields, including education, healthcare, and social sciences, as well as in the field of psychology, where it helps people understand and respond to emotions, behaviors, and experiences. | |
| In essence, AI is designed to help individuals learn, adjust, and thrive in a world where they can learn and grow, while also being able to adapt and learn from their environment. This means that AI can be used to make decisions, solve problems, and even learn from others, making it a valuable tool for individuals who want to learn more about themselves and their surroundings. | |
| ``` | |
| Prompt: "What is 2+2 ?" | |
| Answer: | |
| ```plaintext | |
| The result is **4**. | |
| ``` | |
| --- | |
| ## **Finetuning Data** | |
| | Source | Approx. share | | |
| | ----- | ----- | | |
| | `smol-smoltalk` | 77.5% | | |
| | Synthethic Basic Arithmetic | 9.3% | | |
| | `qwedsacf/grade-school-math-instructions` | 4.5% | | |
| | no_robots | 3.4% | | |
| | Style Rewrite of `smol-smoltalk` | 2.5% | | |
| | Style Rewrite of `no_robots` | 1.5% | | |
| | Templated `b-mc2/wikihow_lists` | 1.2% | | |
| --- | |
| ## **Usage** | |
| ```python | |
| import torch | |
| from tokenizers import pre_tokenizers | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| REPO_ID = "SupraLabs/Supra2-Medium-Instruct" | |
| device = "cuda" if torch.cuda.is_available() else "cpu" | |
| print(f"[*] Loading model and tokenizer from Hub: {REPO_ID}...") | |
| # 1. Load Tokenizer & configure ByteLevel pre-tokenizer | |
| tokenizer = AutoTokenizer.from_pretrained(REPO_ID, trust_remote_code=True) | |
| tokenizer._tokenizer.pre_tokenizer = pre_tokenizers.ByteLevel(add_prefix_space=False) | |
| # 2. Load Model | |
| model = AutoModelForCausalLM.from_pretrained( | |
| REPO_ID, | |
| torch_dtype=torch.bfloat16 if torch.cuda.is_available() else torch.float32, | |
| device_map="auto" if torch.cuda.is_available() else None, | |
| trust_remote_code=True | |
| ) | |
| model.eval() | |
| # 3. Prepare Chat Prompt | |
| messages = [ | |
| {"role": "user", "content": "What is AI?"} | |
| ] | |
| prompt_text = tokenizer.apply_chat_template( | |
| messages, | |
| tokenize=False, | |
| add_generation_prompt=True | |
| ) | |
| inputs = tokenizer(prompt_text, return_tensors="pt").to(device) | |
| print("[*] Generating response...\n") | |
| # 4. Generate | |
| im_end_id = tokenizer.convert_tokens_to_ids("<|im_end|>") | |
| eos_ids = [im_end_id, tokenizer.eos_token_id] if im_end_id is not None else tokenizer.eos_token_id | |
| with torch.no_grad(): | |
| output_ids = model.generate( | |
| **inputs, | |
| max_new_tokens=256, | |
| do_sample=True, | |
| temperature=0.2, | |
| top_p=0.85, | |
| top_k=25, | |
| no_repeat_ngram_size=3, | |
| pad_token_id=tokenizer.pad_token_id, | |
| eos_token_id=eos_ids | |
| ) | |
| # 5. Extract & Decode Response | |
| generated_tokens = output_ids[0][inputs["input_ids"].shape[-1]:] | |
| response = tokenizer.decode(generated_tokens, skip_special_tokens=True) | |
| print("--- Output ---") | |
| print(response.strip()) | |
| ``` | |
| --- | |
| *© SupraLabs 2026* |