Text Generation
Transformers
Safetensors
English
qwen3
code
conversational
text-generation-inference
Instructions to use janhq/Jan-v3-4B-base-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use janhq/Jan-v3-4B-base-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="janhq/Jan-v3-4B-base-instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("janhq/Jan-v3-4B-base-instruct") model = AutoModelForCausalLM.from_pretrained("janhq/Jan-v3-4B-base-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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use janhq/Jan-v3-4B-base-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "janhq/Jan-v3-4B-base-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": "janhq/Jan-v3-4B-base-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/janhq/Jan-v3-4B-base-instruct
- SGLang
How to use janhq/Jan-v3-4B-base-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 "janhq/Jan-v3-4B-base-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": "janhq/Jan-v3-4B-base-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 "janhq/Jan-v3-4B-base-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": "janhq/Jan-v3-4B-base-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use janhq/Jan-v3-4B-base-instruct with Docker Model Runner:
docker model run hf.co/janhq/Jan-v3-4B-base-instruct
Commit History
-
Update README.md (#4)
- Update README.md (6d0f79bafbf111ed1dd368ba1fc49b998b64916d) Co-authored-by: Vu Dinh Bach <bachvudinh@users.noreply.huggingface.co>f331713
-
Update README.md (#3)
Verified signature- Update README.md (41e911ba1ad695ac78971b65fbb8e5c0ac382323) Co-authored-by: Jan Team <jan-ai@users.noreply.huggingface.co>71fd89a
-
Update README.md (#1)
Verified signature- Update README.md (cab02bc10ce67ea49e074ecb9e4a6a62cf338617) Co-authored-by: Alan Dao <alandao@users.noreply.huggingface.co>35b6ecf -
Update README.md
Verified signatureab5ad9b
-
Update README.md
Verified signaturef0f5686 -
Update README.md
Verified signatured537d57 -
Update README.md
Verified signaturecbeb8d5
-
Update README.md
Verified signature6a1eb17 -
Update README.md
Verified signature7f14de0
-
Update README.md
Verified signature97fc452 -
Update README.md
Verified signature15a3f12 -
Update README.md
Verified signature9410144 -
Update README.md
Verified signature691696f -
Update README.md
Verified signatured8c0227 -
Update README.md
Verified signatureede1ed0 -
Update README.md
Verified signature9c9d918 -
Update README.md
Verified signature3fb010f -
Update README.md
Verified signature9837308
-
Update README.md
Verified signature941a212 -
Update README.md
Verified signature265f5c7 -
Update README.md
Verified signaturee333726 -
Update README.md
Verified signaturea1690bb -
Update README.md
Verified signature00ab256 -
Update README.md
Verified signatureba80b24 -
Update README.md
Verified signaturecf1a241 -
Update README.md
Verified signature3c5dccf -
Update README.md
Verified signature50432ee -
Update README.md
Verified signature3882fcc -
Update README.md
Verified signature7271d50 -
Upload folder using huggingface_hub
Verified signature1bfee3f -
Create README.md
Verified signatureee2db5a
-
Upload folder using huggingface_hub
Verified signature015e65e -
initial commit
Verified signature08cf633