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
Apply LeanReasoning release licence
Browse files- LICENSE-LEANREASONING.md +52 -0
- README.md +6 -1
LICENSE-LEANREASONING.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LeanReasoning Model Licence 1.0
|
| 2 |
+
|
| 3 |
+
Effective date: 5 November 2026
|
| 4 |
+
Licensor: realDeclan
|
| 5 |
+
|
| 6 |
+
This is a custom licence. It is not the Apache License 2.0 and must not be represented as an unmodified Apache-2.0 licence.
|
| 7 |
+
|
| 8 |
+
## 1. Scope and upstream rights
|
| 9 |
+
|
| 10 |
+
"Model" means the LeanReasoning trained adapter, the project's modifications to Qwen3-1.7B, and the merged checkpoint incorporating those modifications. These terms also accompany copies, conversions, quantisations and further modifications retaining the project's contributions.
|
| 11 |
+
|
| 12 |
+
These terms apply only to rights the Licensor can grant in those contributions and the derivative distribution. They do not revoke, replace or restrict rights independently granted by Qwen or another upstream rights holder in the original base model. The upstream Apache License 2.0 is retained unchanged as LICENSE in the model distribution, together with applicable upstream notices.
|
| 13 |
+
|
| 14 |
+
## 2. General permission
|
| 15 |
+
|
| 16 |
+
Subject to the exclusions below, the Licensor grants permission for research, personal and commercial use, reproduction, modification and redistribution of the Model under the permissions, conditions, patent provisions, attribution requirements, warranty disclaimers and liability limitations of Apache License 2.0, incorporated by reference from:
|
| 17 |
+
|
| 18 |
+
https://www.apache.org/licenses/LICENSE-2.0
|
| 19 |
+
|
| 20 |
+
For the Licensor's contributions, this custom licence governs wherever its additional restrictions differ from those incorporated terms. No permission is granted beyond rights controlled by the Licensor.
|
| 21 |
+
|
| 22 |
+
## 3. Microsoft exclusion
|
| 23 |
+
|
| 24 |
+
"Excluded Party" means:
|
| 25 |
+
|
| 26 |
+
- Microsoft Corporation;
|
| 27 |
+
- any entity that directly or indirectly controls, is controlled by, or is under common control with Microsoft Corporation; and
|
| 28 |
+
- any person or entity acting on behalf of, at the direction of, or as an agent or contractor for any such entity, in relation to the Model.
|
| 29 |
+
|
| 30 |
+
"Control" means the power to direct an entity's management or policies, whether through majority voting ownership, contract or another means. Merely using Microsoft products, being an ordinary customer, or holding a non-controlling investment does not by itself make a person an Excluded Party.
|
| 31 |
+
|
| 32 |
+
No rights under this licence are granted to an Excluded Party. An Excluded Party may not use, run, reproduce, modify, train on, fine-tune, distil, evaluate, benchmark, integrate, distribute, sublicense or commercially exploit the Model for any purpose, including Microsoft Copilot, GitHub Copilot, Azure AI or any other product, service, internal activity or research.
|
| 33 |
+
|
| 34 |
+
Other recipients may not use or supply the Model on behalf of an Excluded Party, or knowingly provide an Excluded Party with the Model, access to its inference, or model outputs for training, distillation or product development. Routing these activities through a third party does not avoid the exclusion.
|
| 35 |
+
|
| 36 |
+
## 4. Limited hosting exception
|
| 37 |
+
|
| 38 |
+
Solely to enable hosting chosen by the Licensor or a permitted recipient, an Excluded Party operating a general-purpose hosting service may store, transmit, back up and perform security or abuse checks on the distributed files as necessary to provide that service.
|
| 39 |
+
|
| 40 |
+
This exception permits GitHub to host the project and its files. It does not permit model inference, model training, fine-tuning, distillation, benchmarking, incorporation into Copilot or other AI products, or independent exploitation of the Model. It grants no additional right to use the files or their contents to train or improve AI systems.
|
| 41 |
+
|
| 42 |
+
## 5. Redistribution and notices
|
| 43 |
+
|
| 44 |
+
Recipients redistributing the Model or further derivatives retaining the project's contributions must include this licence, the unchanged upstream licence and applicable notices. They must identify their changes and retain the Microsoft exclusion for the project's contributions. They may not sublicense those contributions to an Excluded Party or remove this exclusion from them.
|
| 45 |
+
|
| 46 |
+
This licence does not purport to restrict independently obtained upstream materials or rights that applicable law makes available without permission.
|
| 47 |
+
|
| 48 |
+
## 6. Termination and disclaimer
|
| 49 |
+
|
| 50 |
+
Permissions granted under this licence terminate automatically upon breach of the Microsoft exclusion or redistribution conditions. Termination does not affect independently granted upstream rights.
|
| 51 |
+
|
| 52 |
+
The Model and the Licensor's contributions are supplied as-is, without warranties, subject to applicable law. The incorporated warranty disclaimers and liability limitations apply. No trademark rights or endorsement by Qwen, Microsoft, GitHub or the Apache Software Foundation are granted or implied.
|
README.md
CHANGED
|
@@ -1,4 +1,7 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
| 2 |
base_model: Qwen/Qwen3-1.7B
|
| 3 |
base_model_relation: finetune
|
| 4 |
pipeline_tag: text-generation
|
|
@@ -143,4 +146,6 @@ The accompanying index, model configuration, generation configuration, tokenizer
|
|
| 143 |
|
| 144 |
Base model: [Qwen/Qwen3-1.7B](https://huggingface.co/Qwen/Qwen3-1.7B).
|
| 145 |
|
| 146 |
-
The
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: other
|
| 3 |
+
license_name: leanreasoning-model-license-1.0
|
| 4 |
+
license_link: https://huggingface.co/realDeclan/LeanReasoning/blob/main/LICENSE-LEANREASONING.md
|
| 5 |
base_model: Qwen/Qwen3-1.7B
|
| 6 |
base_model_relation: finetune
|
| 7 |
pipeline_tag: text-generation
|
|
|
|
| 146 |
|
| 147 |
Base model: [Qwen/Qwen3-1.7B](https://huggingface.co/Qwen/Qwen3-1.7B).
|
| 148 |
|
| 149 |
+
The model is distributed under the [LeanReasoning Model Licence 1.0](LICENSE-LEANREASONING.md), a custom licence with Apache-2.0-based permissions for eligible recipients and an exclusion for Microsoft Corporation, its controlled/common-control entities, and parties acting on their behalf. This covers Copilot and all other uses, subject to the limited hosting exception described in the licence.
|
| 150 |
+
|
| 151 |
+
The unchanged upstream Apache 2.0 terms remain in [LICENSE](LICENSE). The custom restriction applies to the project's contributions and derivative distribution, not independently granted rights in Qwen's original model. This derivative modifies the original weights through fine-tuning and merging.
|