Instructions to use sasa2000/cosmos-reason2-2b-text-only with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sasa2000/cosmos-reason2-2b-text-only with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sasa2000/cosmos-reason2-2b-text-only") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sasa2000/cosmos-reason2-2b-text-only") model = AutoModelForCausalLM.from_pretrained("sasa2000/cosmos-reason2-2b-text-only") 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]:])) - Cosmos
How to use sasa2000/cosmos-reason2-2b-text-only with Cosmos:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sasa2000/cosmos-reason2-2b-text-only with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sasa2000/cosmos-reason2-2b-text-only" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sasa2000/cosmos-reason2-2b-text-only", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sasa2000/cosmos-reason2-2b-text-only
- SGLang
How to use sasa2000/cosmos-reason2-2b-text-only 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 "sasa2000/cosmos-reason2-2b-text-only" \ --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": "sasa2000/cosmos-reason2-2b-text-only", "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 "sasa2000/cosmos-reason2-2b-text-only" \ --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": "sasa2000/cosmos-reason2-2b-text-only", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use sasa2000/cosmos-reason2-2b-text-only with Docker Model Runner:
docker model run hf.co/sasa2000/cosmos-reason2-2b-text-only
Cosmos-Reason2-2B Text-Only
This is a text-only extraction of nvidia/Cosmos-Reason2-2B.
Built on NVIDIA Cosmos.
The original model is a Qwen3-VL/Cosmos vision-language model. This repository keeps the language backbone and lm_head, removes the vision tower and projector weights, and saves the result as a standalone Hugging Face Qwen3ForCausalLM checkpoint.
What Changed
- Source model:
nvidia/Cosmos-Reason2-2B - Output architecture:
Qwen3ForCausalLM - Output
model_type:qwen3 - Kept tensors: 311
- Dropped tensors: 315
- Removed weight prefixes include
model.visual.*and other multimodal components - Output weights:
model.safetensors
The original nested text config used qwen3_vl_text. It was converted to a qwen3 CausalLM-compatible config because the tested Transformers environment did not expose qwen3_vl_text through AutoModelForCausalLM.
Validation
Validated locally with:
torch 2.12.1+cputransformers 5.12.1safetensors 0.8.0
Checks performed:
AutoConfig.from_pretrained(...)loads asQwen3ConfigAutoTokenizer.from_pretrained(...)loads asQwen2TokenizerAutoModelForCausalLM.from_pretrained(...)loads asQwen3ForCausalLM- Forward pass succeeds on a short text prompt
- Output logits shape:
(1, 7, 151936) - No
visual,vision,projector, orlanguage_modeltensor names remain in the exported checkpoint
Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "sasa2000/cosmos-reason2-2b-text-only"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype="auto",
device_map="auto",
)
inputs = tokenizer("Explain why objects fall toward Earth.", return_tensors="pt").to(model.device)
with torch.no_grad():
output_ids = model.generate(**inputs, max_new_tokens=128)
print(tokenizer.decode(output_ids[0], skip_special_tokens=True))
Limitations
This checkpoint is text-only. It does not include the original vision tower, video/image processor, or multimodal projector weights. Image and video inputs are not supported.
This is an unofficial derived checkpoint and is not released by NVIDIA.
License
The source model is released under the NVIDIA Open Model License. Use of this derived checkpoint must comply with the original model license and any applicable terms.
Licensed by NVIDIA Corporation under the NVIDIA Open Model License.
- Downloads last month
- 46