Text Generation
Transformers
Safetensors
qwen3_5_moe
image-text-to-text
agentic
tool-use
code
reasoning
conversational
Instructions to use badtheorylabs/BTL-4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use badtheorylabs/BTL-4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="badtheorylabs/BTL-4") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("badtheorylabs/BTL-4") model = AutoModelForMultimodalLM.from_pretrained("badtheorylabs/BTL-4", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use badtheorylabs/BTL-4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "badtheorylabs/BTL-4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "badtheorylabs/BTL-4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/badtheorylabs/BTL-4
- SGLang
How to use badtheorylabs/BTL-4 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 "badtheorylabs/BTL-4" \ --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": "badtheorylabs/BTL-4", "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 "badtheorylabs/BTL-4" \ --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": "badtheorylabs/BTL-4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use badtheorylabs/BTL-4 with Docker Model Runner:
docker model run hf.co/badtheorylabs/BTL-4
Commit History
-
Add llama.cpp serving command alongside vLLM
Verified signatureThe serving section documented only vLLM's --reasoning-parser qwen3. Compact is the llama.cpp release, and llama.cpp users had no documented equivalent for separating reasoning, which is required for multi-turn agent use.b46d88b
-
Set mtp_num_hidden_layers to 0 to match the released checkpoint
Verified signatureconfig.json declared mtp_num_hidden_layers=1, but the released checkpoint contains no MTP tensors: model.safetensors.index.json has 31666 tensors, zero matching mtp/nextn, and decoder layers 0-39 only against num_hidden_layers=40. Because the config advertised an extra multi-token-prediction module, stock GGUF conversion looked for blk.40 and hard-failed. Users had to pass --no-mtp to convert at all. Setting the count to 0 makes the config describe what actually ships, so conversion works by default. Weights are unchanged; this is a config-only correction.07efbda
-
BTL-4 merged weights
Verified signature0ffab27 -
initial commit
Verified signaturea5920fe