Text Generation
Transformers
Safetensors
PyTorch
English
Portuguese
kern_qwen3_moe
kern
sparse-moe
experimental
custom_code
conversational
Instructions to use Project-KERN/KERN-Lab-0.5-624M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Project-KERN/KERN-Lab-0.5-624M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Project-KERN/KERN-Lab-0.5-624M", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Project-KERN/KERN-Lab-0.5-624M", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Project-KERN/KERN-Lab-0.5-624M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Project-KERN/KERN-Lab-0.5-624M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Project-KERN/KERN-Lab-0.5-624M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Project-KERN/KERN-Lab-0.5-624M
- SGLang
How to use Project-KERN/KERN-Lab-0.5-624M 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 "Project-KERN/KERN-Lab-0.5-624M" \ --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": "Project-KERN/KERN-Lab-0.5-624M", "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 "Project-KERN/KERN-Lab-0.5-624M" \ --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": "Project-KERN/KERN-Lab-0.5-624M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Project-KERN/KERN-Lab-0.5-624M with Docker Model Runner:
docker model run hf.co/Project-KERN/KERN-Lab-0.5-624M
File size: 1,365 Bytes
52ce59d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | NOTICE — KERN-Lab-0.5-624M
Project KERN adapted Qwen/Qwen3-0.6B-Base, distributed by the Qwen team under the Apache License, Version 2.0.
Upstream model: https://huggingface.co/Qwen/Qwen3-0.6B-Base
Pinned revision: da87bfb608c14b7cf20ba1ce41287e8de496c0cd
Upstream SafeTensors SHA-256: cd2a512003e2f9f3cd3c32a9c3573f820bb28c940f73c57b1ddaa983d9223eba
Upstream citation: Qwen Team, Qwen3 Technical Report, https://arxiv.org/abs/2505.09388
Modifications by Project KERN: zero-based layer 14 replaces the dense SwiGLU FFN with one shared expert and three routed experts, using top-2 routing, a shared weight of 0.5 and an FP32 router. The upstream tokenizer and the remaining Transformer layers are retained. The release adds a custom loader, AutoClass entries, example clients and documentation.
Attribution for documentation and code used in the adaptation training split:
- FastAPI contributors, https://github.com/fastapi/fastapi (MIT, revision a1b3be01aadc)
- Hugging Face Transformers contributors, https://github.com/huggingface/transformers (Apache-2.0, revision c44d29d8e7e8)
- Flask contributors, https://github.com/pallets/flask (BSD-3-Clause, revision 49943b5a9441)
- Requests contributors, https://github.com/psf/requests (Apache-2.0, revision 3c7baaa05ab4)
- SymPy contributors, https://github.com/sympy/sympy (BSD-3-Clause, revision 91dae8140170)
|