Text Generation
Transformers
Safetensors
qwen3
reasoning
reasoning-compression
merged-lora
math
conversational
text-generation-inference
Instructions to use realDeclan/LeanReasoning with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use realDeclan/LeanReasoning with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="realDeclan/LeanReasoning") 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("realDeclan/LeanReasoning") model = AutoModelForCausalLM.from_pretrained("realDeclan/LeanReasoning", 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 realDeclan/LeanReasoning with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "realDeclan/LeanReasoning" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "realDeclan/LeanReasoning", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/realDeclan/LeanReasoning
- SGLang
How to use realDeclan/LeanReasoning 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 "realDeclan/LeanReasoning" \ --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": "realDeclan/LeanReasoning", "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 "realDeclan/LeanReasoning" \ --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": "realDeclan/LeanReasoning", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use realDeclan/LeanReasoning with Docker Model Runner:
docker model run hf.co/realDeclan/LeanReasoning
File size: 1,842 Bytes
5eb4c15 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | {
"source": {
"base_sha256": "a09e6071319669ea637b9a43f879ec49f74befd401d9e85b248314afe2bb1e6f",
"adapter_sha256": "4577fde047d8bbbed0c838be77efa007402839248e1ebee974d25ffc011b83d7",
"checkpoint_manifest_sha256": "7b9d65f4d47338dbce62c28849d2a2fb14139a7b2f09d94c2f896f866df292b6",
"dtype": "torch.bfloat16",
"merge": "merge_and_unload(safe_merge=True)"
},
"attention_implementation": "sdpa",
"tensor_sha256": "9aeef6382c69bb7997ce3061d0d039c7a8631a112e656f896c8b762728d2c9e8",
"files": {
"LICENSE": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30",
"README.md": "9ce0fed41d93d7f55be6a335377c35b4e63992dee61d156356b7f681a19147ea",
"added_tokens.json": "c0284b582e14987fbd3d5a2cb2bd139084371ed9acbae488829a1c900833c680",
"chat_template.jinja": "a55ee1b1660128b7098723e0abcd92caa0788061051c62d51cbe87d9cf1974d8",
"config.json": "175de0700ca3b0fb9881238898d0a66d49c2e78aa1d518ffa5f4dc825672b8af",
"generation_config.json": "ccd8574aefb7817f05e134730cbd0d75a96d1441aa1abb699758816d4ae33144",
"merges.txt": "8831e4f1a044471340f7c0a83d7bd71306a5b867e95fd870f74d0c5308a904d5",
"model-00001-of-00002.safetensors": "9b5c2fd51ab13cbf8ee49ce8792f98d7a43449f60947d223c9d98e27e505c536",
"model-00002-of-00002.safetensors": "53fade3cf69fabbf3c1528c12cbd3a4cb18daa1695888afab990f02776818a18",
"model.safetensors.index.json": "5974b0f15b555b8f68a18ef230110a9ef87ec9772788d40a9c9f15fa264b759f",
"special_tokens_map.json": "a36726f7fe394c1324021cac4a9ee3ad6c4f6285c0d98721f9b0b95888ec9905",
"tokenizer.json": "aeb13307a71acd8fe81861d94ad54ab689df773318809eed3cbe794b4492dae4",
"tokenizer_config.json": "68f2cfe250d0fd2c445bcbeb49183726d6c4dfca493bd10599742410c2fc4a79",
"vocab.json": "ca10d7e9fb3ed18575dd1e277a2579c16d108e32f27439684afa0e10b1440910"
}
}
|