Instructions to use LucidityAI/Astral-4B-Preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LucidityAI/Astral-4B-Preview with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LucidityAI/Astral-4B-Preview") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("LucidityAI/Astral-4B-Preview") model = AutoModelForCausalLM.from_pretrained("LucidityAI/Astral-4B-Preview") 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
- vLLM
How to use LucidityAI/Astral-4B-Preview with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LucidityAI/Astral-4B-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": "LucidityAI/Astral-4B-Preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LucidityAI/Astral-4B-Preview
- SGLang
How to use LucidityAI/Astral-4B-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 "LucidityAI/Astral-4B-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": "LucidityAI/Astral-4B-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 "LucidityAI/Astral-4B-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": "LucidityAI/Astral-4B-Preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use LucidityAI/Astral-4B-Preview with Docker Model Runner:
docker model run hf.co/LucidityAI/Astral-4B-Preview
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("LucidityAI/Astral-4B-Preview")
model = AutoModelForCausalLM.from_pretrained("LucidityAI/Astral-4B-Preview")
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]:]))Astral-4B-Preview
Astral-4B is a specialized reasoning-focused language model developed as part of the Astral series, designed to deliver high-fidelity, step-by-step reasoning with configurable depth. Built upon the Qwen3-4b-thinking-2507 foundation, this variant has been fine-tuned on the nvidia/AceReason-1.1-SFT dataset to enhance logical coherence, problem-solving capability, and structured thinking.
This model is currently in preview and intended for research, evaluation, and development use. Feedback is encouraged to guide future iterations.
Usage Instructions
To invoke the model correctly, include a reasoning-level indicator in the system prompt using the Reasoning-level: directive. The available levels are:
| Level | Behavior |
|---|---|
none |
No reasoning trace generated, direct response only. |
low |
Minimal internal reasoning |
medium |
Creates a reasoning trace thats not too long nor too short |
high |
Second highest reasoning depth |
ultra |
Maximum depth reasoning |
Note: The absence of a valid reasoning level will result in undefined behavior. Always specify one.
Example Prompt (ChatML Format):
<|im_start|>system
Reasoning-level: high
<|im_end|>
<|im_start|>user
What is the capital of France?
<|im_end|>
<|im_start|>assistant
<think>
Important Notes
- This is a preview release. Performance may vary across edge cases or non-standard inputs.
- For production applications, please wait for the official release.
- Downloads last month
- 7
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LucidityAI/Astral-4B-Preview") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)