Text Generation
Transformers
Safetensors
Chinese
English
bailing_moe_linear
conversational
custom_code
Instructions to use inclusionAI/Ring-lite-linear-preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use inclusionAI/Ring-lite-linear-preview with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="inclusionAI/Ring-lite-linear-preview", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("inclusionAI/Ring-lite-linear-preview", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use inclusionAI/Ring-lite-linear-preview with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "inclusionAI/Ring-lite-linear-preview" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "inclusionAI/Ring-lite-linear-preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/inclusionAI/Ring-lite-linear-preview
- SGLang
How to use inclusionAI/Ring-lite-linear-preview 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 "inclusionAI/Ring-lite-linear-preview" \ --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": "inclusionAI/Ring-lite-linear-preview", "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 "inclusionAI/Ring-lite-linear-preview" \ --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": "inclusionAI/Ring-lite-linear-preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use inclusionAI/Ring-lite-linear-preview with Docker Model Runner:
docker model run hf.co/inclusionAI/Ring-lite-linear-preview
Update README.md
Browse files
README.md
CHANGED
|
@@ -12,7 +12,7 @@ pipeline_tag: text-generation
|
|
| 12 |
# Ring-lite-linear-preview
|
| 13 |
|
| 14 |
<p align="center">
|
| 15 |
-
<img src="https://huggingface.co/inclusionAI/Ring-lite-
|
| 16 |
<p>
|
| 17 |
|
| 18 |
<p align="center">
|
|
@@ -52,12 +52,12 @@ In terms of the evaluation of reasoning ability, Ring-lite-linear-preview achi
|
|
| 52 |
To evaluate the generation throughput, we deploy Ring-lite-linear and the softmax-attention-based Ring-lite based on vLLM on a single NVIDIA A100 GPU. Specifically, the input sequence length is fixed to 1. The end-to-end (E2E) generation time required for generating output sequences of varying lengths is illustrated below. It is shown in the figure that at 32k output length, Ring-lite-linear-preview achieves 2.2× throughput of Ring-lite.
|
| 53 |
|
| 54 |
<p align="center">
|
| 55 |
-
<img src="https://
|
| 56 |
<p>
|
| 57 |
|
| 58 |
Additionally, to illustrate the advantage in inference speed, we present a comparison between Ring-lite-linear-preview and softmax-attention-based Ring-lite under a batch size of 64 and an output length of 16k (60x speedup). It can be observed that the KV cache usage of Ring-lite-linear-preview is nearly 1/6 that of Ring-lite, and the E2E time is reduced by 27.24% compared with Ring-lite.
|
| 59 |
<p align="center">
|
| 60 |
-
<img src="https://
|
| 61 |
<p>
|
| 62 |
|
| 63 |
More details will be reported in our technical report [TBD]
|
|
|
|
| 12 |
# Ring-lite-linear-preview
|
| 13 |
|
| 14 |
<p align="center">
|
| 15 |
+
<img src="https://huggingface.co/inclusionAI/Ring-lite-linear-preview/blob/main/ant-bailing.png" width="100"/>
|
| 16 |
<p>
|
| 17 |
|
| 18 |
<p align="center">
|
|
|
|
| 52 |
To evaluate the generation throughput, we deploy Ring-lite-linear and the softmax-attention-based Ring-lite based on vLLM on a single NVIDIA A100 GPU. Specifically, the input sequence length is fixed to 1. The end-to-end (E2E) generation time required for generating output sequences of varying lengths is illustrated below. It is shown in the figure that at 32k output length, Ring-lite-linear-preview achieves 2.2× throughput of Ring-lite.
|
| 53 |
|
| 54 |
<p align="center">
|
| 55 |
+
<img src="https://huggingface.co/inclusionAI/Ring-lite-linear-preview/blob/main/throughput.png" width="600"/>
|
| 56 |
<p>
|
| 57 |
|
| 58 |
Additionally, to illustrate the advantage in inference speed, we present a comparison between Ring-lite-linear-preview and softmax-attention-based Ring-lite under a batch size of 64 and an output length of 16k (60x speedup). It can be observed that the KV cache usage of Ring-lite-linear-preview is nearly 1/6 that of Ring-lite, and the E2E time is reduced by 27.24% compared with Ring-lite.
|
| 59 |
<p align="center">
|
| 60 |
+
<img src="https://huggingface.co/inclusionAI/Ring-lite-linear-preview/blob/main/inference_speed.gif" width="600"/>
|
| 61 |
<p>
|
| 62 |
|
| 63 |
More details will be reported in our technical report [TBD]
|