Text Generation
Transformers
Safetensors
hy_v3
hunyuan
hy3
Mixture of Experts
heretic
uncensored
decensored
abliterated
conversational
Instructions to use trohrbaugh/Hy3-heretic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use trohrbaugh/Hy3-heretic with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="trohrbaugh/Hy3-heretic") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("trohrbaugh/Hy3-heretic") model = AutoModelForCausalLM.from_pretrained("trohrbaugh/Hy3-heretic", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use trohrbaugh/Hy3-heretic with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "trohrbaugh/Hy3-heretic" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "trohrbaugh/Hy3-heretic", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/trohrbaugh/Hy3-heretic
- SGLang
How to use trohrbaugh/Hy3-heretic 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 "trohrbaugh/Hy3-heretic" \ --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": "trohrbaugh/Hy3-heretic", "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 "trohrbaugh/Hy3-heretic" \ --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": "trohrbaugh/Hy3-heretic", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use trohrbaugh/Hy3-heretic with Docker Model Runner:
docker model run hf.co/trohrbaugh/Hy3-heretic
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,199 +1,266 @@
|
|
| 1 |
---
|
|
|
|
| 2 |
library_name: transformers
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
---
|
|
|
|
| 5 |
|
| 6 |
-
#
|
| 7 |
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
|
|
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
-
|
| 13 |
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
-
<
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
|
| 19 |
|
| 20 |
-
- **Developed by:** [More Information Needed]
|
| 21 |
-
- **Funded by [optional]:** [More Information Needed]
|
| 22 |
-
- **Shared by [optional]:** [More Information Needed]
|
| 23 |
-
- **Model type:** [More Information Needed]
|
| 24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
| 25 |
-
- **License:** [More Information Needed]
|
| 26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
| 27 |
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
-
<
|
| 31 |
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
| 39 |
-
|
| 40 |
-
### Direct Use
|
| 41 |
-
|
| 42 |
-
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
| 43 |
-
|
| 44 |
-
[More Information Needed]
|
| 45 |
-
|
| 46 |
-
### Downstream Use [optional]
|
| 47 |
-
|
| 48 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
| 49 |
-
|
| 50 |
-
[More Information Needed]
|
| 51 |
-
|
| 52 |
-
### Out-of-Scope Use
|
| 53 |
-
|
| 54 |
-
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
| 55 |
-
|
| 56 |
-
[More Information Needed]
|
| 57 |
-
|
| 58 |
-
## Bias, Risks, and Limitations
|
| 59 |
-
|
| 60 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
| 61 |
-
|
| 62 |
-
[More Information Needed]
|
| 63 |
-
|
| 64 |
-
### Recommendations
|
| 65 |
-
|
| 66 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
| 67 |
-
|
| 68 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
| 69 |
-
|
| 70 |
-
## How to Get Started with the Model
|
| 71 |
-
|
| 72 |
-
Use the code below to get started with the model.
|
| 73 |
-
|
| 74 |
-
[More Information Needed]
|
| 75 |
-
|
| 76 |
-
## Training Details
|
| 77 |
-
|
| 78 |
-
### Training Data
|
| 79 |
-
|
| 80 |
-
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
| 81 |
-
|
| 82 |
-
[More Information Needed]
|
| 83 |
-
|
| 84 |
-
### Training Procedure
|
| 85 |
-
|
| 86 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
| 87 |
|
| 88 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
|
| 90 |
-
|
| 91 |
|
|
|
|
| 92 |
|
| 93 |
-
|
| 94 |
|
| 95 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
| 96 |
|
| 97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
-
|
| 100 |
|
| 101 |
-
|
| 102 |
|
| 103 |
-
|
|
|
|
|
|
|
| 104 |
|
| 105 |
-
|
| 106 |
|
| 107 |
-
|
| 108 |
|
| 109 |
-
##
|
| 110 |
|
| 111 |
-
|
| 112 |
|
| 113 |
-
|
| 114 |
|
| 115 |
-
|
| 116 |
|
| 117 |
-
|
| 118 |
|
| 119 |
-
|
| 120 |
|
| 121 |
-
|
|
|
|
|
|
|
| 122 |
|
| 123 |
-
|
| 124 |
|
| 125 |
-
[More Information Needed]
|
| 126 |
|
| 127 |
-
|
| 128 |
|
| 129 |
-
|
| 130 |
|
| 131 |
-
#### Summary
|
| 132 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
|
|
|
|
| 134 |
|
| 135 |
-
|
| 136 |
|
| 137 |
-
|
|
|
|
| 138 |
|
| 139 |
-
|
| 140 |
|
| 141 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
|
| 143 |
-
|
|
|
|
|
|
|
| 144 |
|
| 145 |
-
|
| 146 |
|
| 147 |
-
|
| 148 |
-
- **Hours used:** [More Information Needed]
|
| 149 |
-
- **Cloud Provider:** [More Information Needed]
|
| 150 |
-
- **Compute Region:** [More Information Needed]
|
| 151 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 152 |
|
| 153 |
-
|
| 154 |
|
| 155 |
-
|
| 156 |
|
| 157 |
-
[
|
| 158 |
|
| 159 |
-
|
| 160 |
|
| 161 |
-
|
| 162 |
|
| 163 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 164 |
|
| 165 |
-
|
| 166 |
|
| 167 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
|
| 169 |
-
|
| 170 |
|
| 171 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
|
| 173 |
-
|
| 174 |
|
| 175 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
|
| 177 |
-
|
| 178 |
|
| 179 |
-
|
| 180 |
|
| 181 |
-
|
| 182 |
|
| 183 |
-
|
| 184 |
|
| 185 |
-
|
| 186 |
|
| 187 |
-
[More Information Needed]
|
| 188 |
|
| 189 |
-
|
| 190 |
|
| 191 |
-
|
| 192 |
|
| 193 |
-
|
| 194 |
|
| 195 |
-
|
| 196 |
|
| 197 |
-
|
| 198 |
|
| 199 |
-
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
library_name: transformers
|
| 4 |
+
pipeline_tag: text-generation
|
| 5 |
+
tags:
|
| 6 |
+
- hunyuan
|
| 7 |
+
- hy3
|
| 8 |
+
- moe
|
| 9 |
+
- text-generation
|
| 10 |
+
- heretic
|
| 11 |
+
- uncensored
|
| 12 |
+
- decensored
|
| 13 |
+
- abliterated
|
| 14 |
---
|
| 15 |
+
# This is a decensored version of a model, made using [Heretic](https://github.com/p-e-w/heretic) v1.2.0+custom
|
| 16 |
|
| 17 |
+
## Abliteration parameters
|
| 18 |
|
| 19 |
+
| Parameter | Value |
|
| 20 |
+
| :-------- | :---: |
|
| 21 |
+
| **direction_index** | 36.95 |
|
| 22 |
+
| **attn.o_proj.max_weight** | 2.72 |
|
| 23 |
+
| **attn.o_proj.max_weight_position** | 62.94 |
|
| 24 |
+
| **attn.o_proj.min_weight** | 2.44 |
|
| 25 |
+
| **attn.o_proj.min_weight_distance** | 60.89 |
|
| 26 |
+
| **mlp.down_proj.max_weight** | 1.47 |
|
| 27 |
+
| **mlp.down_proj.max_weight_position** | 67.79 |
|
| 28 |
+
| **mlp.down_proj.min_weight** | 0.54 |
|
| 29 |
+
| **mlp.down_proj.min_weight_distance** | 31.09 |
|
| 30 |
|
| 31 |
+
## Performance
|
| 32 |
|
| 33 |
+
| Metric | This model | Original model (a model) |
|
| 34 |
+
| :----- | :--------: | :---------------------------: |
|
| 35 |
+
| **KL divergence** | 0.2398 | 0 *(by definition)* |
|
| 36 |
+
| **Refusals** | 1/100 | 99/100 |
|
| 37 |
|
| 38 |
+
-----
|
| 39 |
|
| 40 |
+
<p align="left">
|
| 41 |
+
<a href="https://huggingface.co/tencent/Hy3/blob/main/README_CN.md">中文</a> | English
|
| 42 |
+
</p>
|
| 43 |
+
<br>
|
| 44 |
|
| 45 |
+
<p align="center">
|
| 46 |
+
<img src="assets/logo-en.png" width="400"/> <br>
|
| 47 |
+
</p>
|
| 48 |
|
| 49 |
+
<div align="center" style="line-height: 1;">
|
| 50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
+
[](#license)
|
| 53 |
+
|
| 54 |
+
[](https://huggingface.co/tencent/Hy3)
|
| 55 |
+
|
| 56 |
+
[](https://modelscope.cn/models/Tencent-Hunyuan/Hy3)
|
| 57 |
+
|
| 58 |
+
[](https://cnb.cool/ai-models/tencent/Hy3)
|
| 59 |
+
|
| 60 |
+
[](https://ai.gitcode.com/tencent_hunyuan/Hy3)
|
| 61 |
|
| 62 |
+
</div>
|
| 63 |
|
| 64 |
+
<p align="center">
|
| 65 |
+
🖥️ <a href="https://aistudio.tencent.com/"><b>Official Website</b></a> |
|
| 66 |
+
💬 <a href="https://github.com/Tencent-Hunyuan/Hy3"><b>GitHub</b></a></p>
|
| 67 |
|
| 68 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
|
| 70 |
+
## Table of Contents
|
| 71 |
+
|
| 72 |
+
- [Model Introduction](#model-introduction)
|
| 73 |
+
- [Stronger Agent Capabilities](#stronger-agent-capabilities)
|
| 74 |
+
- [More Reliable Product Experiences](#more-reliable-product-experiences)
|
| 75 |
+
- [Benchmark Appendix](#benchmark-appendix)
|
| 76 |
+
- [News](#news)
|
| 77 |
+
- [Model Links](#model-links)
|
| 78 |
+
- [Quickstart](#quickstart)
|
| 79 |
+
- [Deployment](#deployment)
|
| 80 |
+
- [vLLM](#vllm)
|
| 81 |
+
- [SGLang](#sglang)
|
| 82 |
+
- [Finetuning](#finetuning)
|
| 83 |
+
- [Quantization](#quantization)
|
| 84 |
+
- [License](#license)
|
| 85 |
+
- [Contact Us](#contact-us)
|
| 86 |
|
| 87 |
+
---
|
| 88 |
|
| 89 |
+
## Model Introduction
|
| 90 |
|
| 91 |
+
**Hy3** is a 295B-parameter Mixture-of-Experts (MoE) model with 21B active parameters and 3.8B MTP layer parameters, developed by the Tencent Hy Team. Following the Hy3 Preview launch in late April, we gathered feedback from 50+ products and scaled up post-training with higher quality data. Today, we introduce Hy3, which outperforms similar-size models and rivals flagship open-source models with 2-5x parameters. It also shows significant gains in utility across various products and productivity tasks.
|
| 92 |
|
|
|
|
| 93 |
|
| 94 |
+
| Property | Value |
|
| 95 |
+
|:---|:---|
|
| 96 |
+
| Architecture | Mixture-of-Experts (MoE) |
|
| 97 |
+
| Total Parameters | 295B |
|
| 98 |
+
| Activated Parameters | 21B |
|
| 99 |
+
| MTP Layer Parameters | 3.8B |
|
| 100 |
+
| Number of Layers (excluding MTP layer) | 80 |
|
| 101 |
+
| Number of MTP Layers | 1 |
|
| 102 |
+
| Attention Heads | 64 (GQA, 8 KV heads, head dim 128) |
|
| 103 |
+
| Hidden Size | 4096 |
|
| 104 |
+
| Intermediate Size | 13312 |
|
| 105 |
+
| Context Length | 256K |
|
| 106 |
+
| Vocabulary Size | 120832 |
|
| 107 |
+
| Number of Experts | 192 experts, top-8 activated |
|
| 108 |
+
| Supported Precisions | BF16 |
|
| 109 |
|
| 110 |
+
## Stronger Agent Capabilities
|
| 111 |
|
| 112 |
+
Building on Hy3 Preview, we further improved the quality and diversity of post-training data while scaling up RL training. Hy3 shows solid gains across reasoning, agentic, and long-context tasks, competitive with much larger flagship models.
|
| 113 |
|
| 114 |
+
<p align="center">
|
| 115 |
+
<img src="assets/benchmark.png" width="100%"/>
|
| 116 |
+
</p>
|
| 117 |
|
| 118 |
+
In productivity scenarios such as coding, office work, financial modeling, frontend design, and game development, Hy3 has made remarkable progress and can now serve as a reliable, cost-effective model option.
|
| 119 |
|
| 120 |
+
We don't think public benchmark scores tell the full story. So we ran a blind evaluation with 270 experts using tasks from their work, and Hy3 scored 2.67/4, outperforming GLM-5.1 at 2.51/4. The advantage was most substantial in frontend development, data & storage, and CI/CD tasks.
|
| 121 |
|
| 122 |
+
## More Reliable Product Experiences
|
| 123 |
|
| 124 |
+
Model usefulness is not fully captured by benchmarks. Based on extensive product feedback, we identified and fixed the following issues, receiving consistently positive feedback from product teams.
|
| 125 |
|
| 126 |
+
**Stability of tool calls and output formats**: We fixed multiple baseline reliability issues, bringing the model to production-grade standards across tool configurations and output constraints. Tool-call error recovery and overall efficiency improved. Hy3 also generalizes across different agent scaffoldings. On SWE-Bench Verified, accuracy variance across scaffoldings like CodeBuddy, Cline, and KiloCode remains within 4%.
|
| 127 |
|
| 128 |
+
**Knowledge and anti-hallucination**: Guided by the ideal of "answer when grounded, state when evidence is missing, do not conflate sources or fabricate data," we implemented fine-grained data cleaning and training constraints. In internal evaluations based on real-world scenarios, Hy3's hallucination rate dropped from 12.5% to 5.4%, and commonsense error rates fell from 25.4% to 12.7%. These improvements materially reduce fact conflation, fabrication, and logical contradiction.
|
| 129 |
|
| 130 |
+
**Complex context retention and multi-turn intent tracking**: Through joint optimization of SFT and RL, Hy3 improved on operational pain points like coreference resolution, ellipsis recovery, and multi-turn constraint inheritance. On internal comprehensive multi-turn tests, the issue rate dropped from 17.4% to 7.9%. Hy3 also improved markedly on long-dialogue evals like MRCR. Its outputs are more concise while ensuring complex intents do not decay or drift over long-horizon interactions.
|
| 131 |
|
| 132 |
+
## Benchmark Appendix
|
| 133 |
|
| 134 |
+
<p align="center">
|
| 135 |
+
<img src="assets/benchmark-appendix.png" width="100%"/>
|
| 136 |
+
</p>
|
| 137 |
|
| 138 |
+
## News
|
| 139 |
|
|
|
|
| 140 |
|
| 141 |
+
* 🔥 We open-source **Hy3** and **Hy3-FP8** model weights on [Hugging Face](https://huggingface.co/tencent/Hy3), [ModelScope](https://modelscope.cn/models/Tencent-Hunyuan/Hy3), [GitCode](https://ai.gitcode.com/tencent_hunyuan/Hy3), and [CNB](https://cnb.cool/ai-models/tencent/Hy3).
|
| 142 |
|
| 143 |
+
## Model Links
|
| 144 |
|
|
|
|
| 145 |
|
| 146 |
+
| Model Name | Description | Hugging Face | ModelScope | GitCode | CNB |
|
| 147 |
+
|:---|:---|:---:|:---:|:---:|:---:|
|
| 148 |
+
| Hy3 | Instruct model | 🤗 [Model](https://huggingface.co/tencent/Hy3) | [Model](https://modelscope.cn/models/Tencent-Hunyuan/Hy3) | [Model](https://ai.gitcode.com/tencent_hunyuan/Hy3) | [Model](https://cnb.cool/ai-models/tencent/Hy3) |
|
| 149 |
+
| Hy3-FP8 | FP8 quantized instruct model | 🤗 [Model](https://huggingface.co/tencent/Hy3-FP8) | [Model](https://modelscope.cn/models/Tencent-Hunyuan/Hy3-FP8) | [Model](https://ai.gitcode.com/tencent_hunyuan/Hy3-FP8) | [Model](https://cnb.cool/ai-models/tencent/Hy3-FP8) |
|
| 150 |
|
| 151 |
+
## Quickstart
|
| 152 |
|
| 153 |
+
Deploy Hy3 with [vLLM](#vllm) or [SGLang](#sglang) first, then call the OpenAI-compatible API:
|
| 154 |
|
| 155 |
+
```python
|
| 156 |
+
from openai import OpenAI
|
| 157 |
|
| 158 |
+
client = OpenAI(base_url="http://127.0.0.1:8000/v1", api_key="EMPTY")
|
| 159 |
|
| 160 |
+
response = client.chat.completions.create(
|
| 161 |
+
model="hy3",
|
| 162 |
+
messages=[
|
| 163 |
+
{"role": "user", "content": "Hello! Can you briefly introduce yourself?"},
|
| 164 |
+
],
|
| 165 |
+
temperature=0.9,
|
| 166 |
+
top_p=1.0,
|
| 167 |
+
# reasoning_effort: "no_think" (default, direct response), "low", "high" (deep chain-of-thought)
|
| 168 |
+
extra_body={"chat_template_kwargs": {"reasoning_effort": "no_think"}},
|
| 169 |
+
)
|
| 170 |
+
print(response.choices[0].message.content)
|
| 171 |
+
```
|
| 172 |
|
| 173 |
+
> **Recommended parameters**: `temperature=0.9`, `top_p=1.0`.
|
| 174 |
+
>
|
| 175 |
+
> **Reasoning mode**: Set `reasoning_effort` to `"high"` for complex tasks (math, coding, reasoning) or `"no_think"` for direct responses.
|
| 176 |
|
| 177 |
+
See the [Deployment](#deployment) section below for how to start the API server.
|
| 178 |
|
| 179 |
+
## Deployment
|
|
|
|
|
|
|
|
|
|
|
|
|
| 180 |
|
| 181 |
+
Hy3 has 295B parameters in total. To serve it on 8 GPUs, we recommend using H20-3e or other GPUs with larger memory capacity.
|
| 182 |
|
| 183 |
+
For production serving, we recommend using vLLM or SGLang, both of which provide dedicated recipes for Hy3:
|
| 184 |
|
| 185 |
+
- [vLLM](https://github.com/vllm-project/vllm) - see [vLLM recipes](https://recipes.vllm.ai/tencent/Hy3)
|
| 186 |
|
| 187 |
+
- [SGLang](https://docs.sglang.io/) - see [SGLang cookbook](https://lmsysorg.mintlify.app/cookbook/autoregressive/Tencent/Hy3)
|
| 188 |
|
| 189 |
+
### vLLM
|
| 190 |
|
| 191 |
+
Build vLLM from source:
|
| 192 |
+
```bash
|
| 193 |
+
uv venv --python 3.12 --seed --managed-python
|
| 194 |
+
source .venv/bin/activate
|
| 195 |
+
git clone https://github.com/vllm-project/vllm.git
|
| 196 |
+
cd vllm
|
| 197 |
+
uv pip install --editable . --torch-backend=auto
|
| 198 |
+
```
|
| 199 |
|
| 200 |
+
Start the vLLM server with MTP enabled:
|
| 201 |
|
| 202 |
+
```bash
|
| 203 |
+
# Switch to trtllm backend to work-around mnnvl workspace size issue.
|
| 204 |
+
export VLLM_FLASHINFER_ALLREDUCE_BACKEND=trtllm
|
| 205 |
+
vllm serve tencent/Hy3 \
|
| 206 |
+
--tensor-parallel-size 8 \
|
| 207 |
+
--speculative-config.method mtp \
|
| 208 |
+
--speculative-config.num_speculative_tokens 2 \
|
| 209 |
+
--tool-call-parser hy_v3 \
|
| 210 |
+
--reasoning-parser hy_v3 \
|
| 211 |
+
--enable-auto-tool-choice \
|
| 212 |
+
--port 8000 \
|
| 213 |
+
--served-model-name hy3
|
| 214 |
+
```
|
| 215 |
|
| 216 |
+
### SGLang
|
| 217 |
|
| 218 |
+
Build SGLang from source:
|
| 219 |
+
```bash
|
| 220 |
+
git clone https://github.com/sgl-project/sglang
|
| 221 |
+
cd sglang
|
| 222 |
+
pip3 install pip --upgrade
|
| 223 |
+
pip3 install "transformers>=5.6.0"
|
| 224 |
+
pip3 install -e "python"
|
| 225 |
+
```
|
| 226 |
|
| 227 |
+
Launch SGLang server with MTP enabled:
|
| 228 |
|
| 229 |
+
```bash
|
| 230 |
+
python3 -m sglang.launch_server \
|
| 231 |
+
--model tencent/Hy3 \
|
| 232 |
+
--tp-size 8 \
|
| 233 |
+
--tool-call-parser hunyuan \
|
| 234 |
+
--reasoning-parser hunyuan \
|
| 235 |
+
--speculative-num-steps 2 \
|
| 236 |
+
--speculative-eagle-topk 1 \
|
| 237 |
+
--speculative-num-draft-tokens 3 \
|
| 238 |
+
--speculative-algorithm EAGLE \
|
| 239 |
+
--port 8000 \
|
| 240 |
+
--served-model-name hy3
|
| 241 |
+
```
|
| 242 |
|
| 243 |
+
## Finetuning
|
| 244 |
|
| 245 |
+
Hy3 provides a complete model finetuning pipeline. For detailed documentation, please refer to: [Finetuning Guide](https://huggingface.co/tencent/Hy3/blob/main/finetune/README.md)
|
| 246 |
|
| 247 |
+
## Quantization
|
| 248 |
|
| 249 |
+
We provide [AngelSlim](https://github.com/tencent/AngelSlim), a more accessible, comprehensive, and efficient toolkit for large model compression. AngelSlim supports a comprehensive suite of compression tools for large-scale multimodal models, including common quantization algorithms, low-bit quantization, and speculative sampling.
|
| 250 |
|
| 251 |
+
## License
|
| 252 |
|
|
|
|
| 253 |
|
| 254 |
+
Hy3 is released under the **Apache License 2.0**. See [LICENSE](https://huggingface.co/tencent/Hy3/blob/main/LICENSE) for details.
|
| 255 |
|
| 256 |
+
## Contact Us
|
| 257 |
|
| 258 |
+
If you would like to leave a message for our R&D and product teams, welcome to contact us. You can also reach us via email:
|
| 259 |
|
| 260 |
+
📧 **hunyuan_opensource@tencent.com**
|
| 261 |
|
| 262 |
+
---
|
| 263 |
|
| 264 |
+
<p align="center">
|
| 265 |
+
<i>Hy3 is developed by the Tencent Hy Team.</i>
|
| 266 |
+
</p>
|