Text Generation
Transformers
Safetensors
GGUF
English
qwen3.5
gated-deltanet
hybrid-attention
dense
tinystories
tiny-model
conversational
Instructions to use shibatch/tinyqwen35dense2m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use shibatch/tinyqwen35dense2m with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="shibatch/tinyqwen35dense2m")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("shibatch/tinyqwen35dense2m", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use shibatch/tinyqwen35dense2m with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf shibatch/tinyqwen35dense2m:Q4_K_M # Run inference directly in the terminal: llama cli -hf shibatch/tinyqwen35dense2m:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf shibatch/tinyqwen35dense2m:Q4_K_M # Run inference directly in the terminal: llama cli -hf shibatch/tinyqwen35dense2m:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf shibatch/tinyqwen35dense2m:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf shibatch/tinyqwen35dense2m:Q4_K_M
Use Docker
docker model run hf.co/shibatch/tinyqwen35dense2m:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use shibatch/tinyqwen35dense2m with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "shibatch/tinyqwen35dense2m" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shibatch/tinyqwen35dense2m", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/shibatch/tinyqwen35dense2m:Q4_K_M
- SGLang
How to use shibatch/tinyqwen35dense2m 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 "shibatch/tinyqwen35dense2m" \ --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": "shibatch/tinyqwen35dense2m", "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 "shibatch/tinyqwen35dense2m" \ --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": "shibatch/tinyqwen35dense2m", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use shibatch/tinyqwen35dense2m with Ollama:
ollama run hf.co/shibatch/tinyqwen35dense2m:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use shibatch/tinyqwen35dense2m with Docker Model Runner:
docker model run hf.co/shibatch/tinyqwen35dense2m:Q4_K_M
- Lemonade
How to use shibatch/tinyqwen35dense2m with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull shibatch/tinyqwen35dense2m:Q4_K_M
Run and chat with the model
lemonade run user.tinyqwen35dense2m-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Download example_generate.py from shibatch/tinyqwen35dense2m: direct link, hf CLI and curl.
- Browser
- Download file 1.21 kB
-
https://huggingface.co/shibatch/tinyqwen35dense2m/resolve/main/example_generate.py
- Command line
-
hf download hf://shibatch/tinyqwen35dense2m/example_generate.py
-
curl -L -o example_generate.py https://huggingface.co/shibatch/tinyqwen35dense2m/resolve/main/example_generate.py
1.21 kB
| """Generate a short TinyStories-style continuation from the local HF checkpoint.""" | |
| from pathlib import Path | |
| import torch | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| def main() -> None: | |
| model_dir = Path(__file__).resolve().parent / "hf" | |
| device = torch.device("cuda" if torch.cuda.is_available() else "cpu") | |
| tokenizer = AutoTokenizer.from_pretrained(model_dir) | |
| model = AutoModelForCausalLM.from_pretrained(model_dir, dtype=torch.float32).to(device) | |
| model.eval() | |
| prompt = "Once upon" | |
| input_ids = torch.tensor( | |
| [[tokenizer.bos_token_id] + tokenizer.encode(prompt, add_special_tokens=False)], | |
| dtype=torch.long, | |
| device=device, | |
| ) | |
| torch.manual_seed(1234) | |
| with torch.no_grad(): | |
| output = model.generate( | |
| input_ids=input_ids, | |
| max_new_tokens=100, | |
| do_sample=True, | |
| temperature=0.8, | |
| top_p=0.95, | |
| top_k=40, | |
| repetition_penalty=1.1, | |
| pad_token_id=tokenizer.pad_token_id, | |
| eos_token_id=tokenizer.eos_token_id, | |
| ) | |
| print(tokenizer.decode(output[0].tolist(), skip_special_tokens=True)) | |
| if __name__ == "__main__": | |
| main() | |