Text Generation
Transformers
Safetensors
PyTorch
English
qwen3
computer-science
software-engineering
programming
python
code-generation
debugging
conversational
text-generation-inference
Instructions to use Irfanuruchi/Qwen3-4B-Computer-Science with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Irfanuruchi/Qwen3-4B-Computer-Science with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Irfanuruchi/Qwen3-4B-Computer-Science") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Irfanuruchi/Qwen3-4B-Computer-Science") model = AutoModelForCausalLM.from_pretrained("Irfanuruchi/Qwen3-4B-Computer-Science", 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 Irfanuruchi/Qwen3-4B-Computer-Science with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Irfanuruchi/Qwen3-4B-Computer-Science" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Irfanuruchi/Qwen3-4B-Computer-Science", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Irfanuruchi/Qwen3-4B-Computer-Science
- SGLang
How to use Irfanuruchi/Qwen3-4B-Computer-Science 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 "Irfanuruchi/Qwen3-4B-Computer-Science" \ --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": "Irfanuruchi/Qwen3-4B-Computer-Science", "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 "Irfanuruchi/Qwen3-4B-Computer-Science" \ --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": "Irfanuruchi/Qwen3-4B-Computer-Science", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Irfanuruchi/Qwen3-4B-Computer-Science with Docker Model Runner:
docker model run hf.co/Irfanuruchi/Qwen3-4B-Computer-Science
| e3f091058ef0d3b827c8c923c295cabe9d640540b786046fe5e55c0f6380d769 model-00001-of-00003.safetensors | |
| 99762c7ebc40a90807c07acc7368a77b34f8d6efd08bbe61729419489b1b68d6 model-00002-of-00003.safetensors | |
| 2cfe806f9f865e31f6d2af34e2fdce2959d1704c4df1971d5674b79f904b2223 model-00003-of-00003.safetensors | |
| 5b36dbd79cdd00f76600e471c61157c10090952160d49c5a3d7e05840bda029a model.safetensors.index.json | |
| bd0d45ac9fa17c4a7d97e67537f90169325004fda58ae219eef89a7e7ce565a8 config.json | |
| 64d86df2173901c58389974bde21f7d2ab9eb7d79f35a337753329d39cf265c0 generation_config.json | |
| aeb13307a71acd8fe81861d94ad54ab689df773318809eed3cbe794b4492dae4 tokenizer.json | |
| 1cc43170694cd04a367485e0375be2ed61de4dfd72478d625703e3d5fe7a5de2 tokenizer_config.json | |
| a55ee1b1660128b7098723e0abcd92caa0788061051c62d51cbe87d9cf1974d8 chat_template.jinja | |