Instructions to use ai9stars/G9v3-39A5B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ai9stars/G9v3-39A5B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ai9stars/G9v3-39A5B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("ai9stars/G9v3-39A5B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ai9stars/G9v3-39A5B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ai9stars/G9v3-39A5B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ai9stars/G9v3-39A5B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ai9stars/G9v3-39A5B
- SGLang
How to use ai9stars/G9v3-39A5B 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 "ai9stars/G9v3-39A5B" \ --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": "ai9stars/G9v3-39A5B", "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 "ai9stars/G9v3-39A5B" \ --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": "ai9stars/G9v3-39A5B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ai9stars/G9v3-39A5B with Docker Model Runner:
docker model run hf.co/ai9stars/G9v3-39A5B
G9v3-39A5B
⚠️ Preview Release
This is a preview release. G9v3-39A5B is under active development — expect continued updates with improved performance and additional capabilities in the near future.
Introduction
G9v3-39A5B is a Mixture-of-Experts (MoE) causal language model from the AI9Stars team, with 39B total parameters and 5B activated per token. The sparse design keeps inference cost close to a small dense model while retaining the capacity of a much larger one, making it a practical choice for local and self-hosted deployment.
It targets everyday assistant use, coding, tool-use workflows, and reasoning tasks, and supports both Think / No Think modes through the same checkpoint.
Model Information
- Type: Causal Language Model (Mixture-of-Experts)
- Total Parameters: ~39B
- Activated Parameters: ~5B per token
- Context Length: 131,072
Quickstart
vLLM
pip install "vllm>=0.21"
vllm serve ai9stars/G9v3-39A5B --port 8000
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "ai9stars/G9v3-39A5B",
"messages": [{"role": "user", "content": "Who are you?"}],
"max_tokens": 128,
"temperature": 0.7
}'
SGLang
pip install "sglang[srt]>=0.5.12"
python -m sglang.launch_server --model-path ai9stars/G9v3-39A5B --port 30000
curl http://localhost:30000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "ai9stars/G9v3-39A5B",
"messages": [{"role": "user", "content": "Who are you?"}],
"max_tokens": 128,
"temperature": 0.7
}'
Transformers
pip install -U "transformers>=5.6" accelerate torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "ai9stars/G9v3-39A5B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype="auto",
device_map="auto",
)
messages = [{"role": "user", "content": "Who are you?"}]
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
enable_thinking=False,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=128)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
Recommended sampling parameters:
| Mode | Recommended params | Enable |
|---|---|---|
| Think | temperature=1.0, top_p=0.95 |
enable_thinking=True |
| No Think | temperature=0.7, top_p=0.95 |
enable_thinking=False |
Limitations and Responsible Use
G9v3-39A5B is a language model that generates content based on learned statistical patterns from training data. It may produce inaccurate, biased, or unsafe outputs, and generated content should be reviewed and verified before use in high-stakes settings. As a preview release, its behavior may change between versions. Users are responsible for evaluating outputs, applying appropriate safeguards, and complying with applicable laws, regulations, and platform policies.
License
This repository and the G9v3 model weights are released under the Apache-2.0 License.
- Downloads last month
- 3