Text Generation
Transformers
Safetensors
English
qwen2
chat
instruct
conversational
fine-tuned
leechanrx
assistant
text-generation-inference
Instructions to use LeeChanRX/LeeChanRX-3B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LeeChanRX/LeeChanRX-3B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LeeChanRX/LeeChanRX-3B-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("LeeChanRX/LeeChanRX-3B-Instruct") model = AutoModelForCausalLM.from_pretrained("LeeChanRX/LeeChanRX-3B-Instruct") 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 LeeChanRX/LeeChanRX-3B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LeeChanRX/LeeChanRX-3B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LeeChanRX/LeeChanRX-3B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LeeChanRX/LeeChanRX-3B-Instruct
- SGLang
How to use LeeChanRX/LeeChanRX-3B-Instruct 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 "LeeChanRX/LeeChanRX-3B-Instruct" \ --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": "LeeChanRX/LeeChanRX-3B-Instruct", "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 "LeeChanRX/LeeChanRX-3B-Instruct" \ --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": "LeeChanRX/LeeChanRX-3B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use LeeChanRX/LeeChanRX-3B-Instruct with Docker Model Runner:
docker model run hf.co/LeeChanRX/LeeChanRX-3B-Instruct
| license: apache-2.0 | |
| language: | |
| - en | |
| library_name: transformers | |
| pipeline_tag: text-generation | |
| tags: | |
| - chat | |
| - instruct | |
| - conversational | |
| - fine-tuned | |
| - leechanrx | |
| - assistant | |
| # 🧠 LeeChan-3B-Instruct | |
| LeeChan-3B-Instruct is a conversational AI assistant model created and fine-tuned by LeeChanRX. | |
| Built on top of Qwen2.5-3B-Instruct, this model is designed to provide natural conversations, helpful responses, coding assistance, and instruction-following behavior with a friendly and stable personality. | |
| The model has been customized to act as “LeeChan”, an intelligent and conversational AI assistant focused on clarity, reliability, and user-friendly interaction. | |
| --- | |
| # ✨ Features | |
| - Conversational AI assistant | |
| - Instruction-following optimized | |
| - Coding and programming support | |
| - Friendly and natural responses | |
| - Stable chat behavior | |
| - Fine-tuned personality alignment | |
| - Lightweight 3B parameter architecture | |
| - Transformers compatible | |
| - Standalone merged model | |
| --- | |
| # 🏗️ Base Model | |
| This model is fine-tuned from: | |
| Qwen/Qwen2.5-3B-Instruct | |
| Credits and appreciation go to the original Qwen team for providing the open-source foundation model. | |
| --- | |
| # 🚀 Usage | |
| ## Transformers | |
| ```python | |
| from transformers import AutoTokenizer, AutoModelForCausalLM | |
| model_name = "LeeChanRX/LeeChan-3B-Instruct" | |
| tokenizer = AutoTokenizer.from_pretrained(model_name) | |
| model = AutoModelForCausalLM.from_pretrained( | |
| model_name, | |
| torch_dtype="auto", | |
| device_map="auto" | |
| ) | |
| messages = [ | |
| { | |
| "role": "system", | |
| "content": "You are LeeChan, a helpful AI assistant." | |
| }, | |
| { | |
| "role": "user", | |
| "content": "Hello" | |
| } | |
| ] | |
| text = tokenizer.apply_chat_template( | |
| messages, | |
| tokenize=False, | |
| add_generation_prompt=True | |
| ) | |
| inputs = tokenizer( | |
| text, | |
| return_tensors="pt" | |
| ).to(model.device) | |
| outputs = model.generate( | |
| **inputs, | |
| max_new_tokens=128, | |
| temperature=0.7, | |
| repetition_penalty=1.1 | |
| ) | |
| print(tokenizer.decode(outputs[0], skip_special_tokens=True)) |