Text Generation
Transformers
Safetensors
English
qwen3
code
agent
Merge
uncensored
Rhea
multi-pass
reasoning
Claude
Mythos
max
xhigh
conversational
text-generation-inference
Instructions to use roskosmos19/Rhea-4B-Coding-max with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use roskosmos19/Rhea-4B-Coding-max with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="roskosmos19/Rhea-4B-Coding-max") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("roskosmos19/Rhea-4B-Coding-max") model = AutoModelForCausalLM.from_pretrained("roskosmos19/Rhea-4B-Coding-max", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use roskosmos19/Rhea-4B-Coding-max with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "roskosmos19/Rhea-4B-Coding-max" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "roskosmos19/Rhea-4B-Coding-max", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/roskosmos19/Rhea-4B-Coding-max
- SGLang
How to use roskosmos19/Rhea-4B-Coding-max 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 "roskosmos19/Rhea-4B-Coding-max" \ --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": "roskosmos19/Rhea-4B-Coding-max", "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 "roskosmos19/Rhea-4B-Coding-max" \ --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": "roskosmos19/Rhea-4B-Coding-max", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use roskosmos19/Rhea-4B-Coding-max with Docker Model Runner:
docker model run hf.co/roskosmos19/Rhea-4B-Coding-max
Update config.json
Browse files- config.json +10 -37
config.json
CHANGED
|
@@ -12,42 +12,15 @@
|
|
| 12 |
"initializer_range": 0.02,
|
| 13 |
"intermediate_size": 9728,
|
| 14 |
"layer_types": [
|
| 15 |
-
"full_attention",
|
| 16 |
-
"full_attention",
|
| 17 |
-
"full_attention",
|
| 18 |
-
"full_attention",
|
| 19 |
-
"full_attention",
|
| 20 |
-
"full_attention",
|
| 21 |
-
"full_attention",
|
| 22 |
-
"full_attention",
|
| 23 |
-
"full_attention",
|
| 24 |
-
"full_attention",
|
| 25 |
-
"full_attention",
|
| 26 |
-
"full_attention",
|
| 27 |
-
"full_attention",
|
| 28 |
-
"full_attention",
|
| 29 |
-
"full_attention",
|
| 30 |
-
"full_attention",
|
| 31 |
-
"full_attention",
|
| 32 |
-
"full_attention",
|
| 33 |
-
"full_attention",
|
| 34 |
-
"full_attention",
|
| 35 |
-
"full_attention",
|
| 36 |
-
"full_attention",
|
| 37 |
-
"full_attention",
|
| 38 |
-
"full_attention",
|
| 39 |
-
"full_attention",
|
| 40 |
-
"full_attention",
|
| 41 |
-
"full_attention",
|
| 42 |
-
"full_attention",
|
| 43 |
-
"full_attention",
|
| 44 |
-
"full_attention",
|
| 45 |
-
"full_attention",
|
| 46 |
-
"full_attention",
|
| 47 |
-
"full_attention",
|
| 48 |
-
"full_attention",
|
| 49 |
-
"full_attention",
|
| 50 |
-
"full_attention"
|
| 51 |
],
|
| 52 |
"max_position_embeddings": 262144,
|
| 53 |
"max_window_layers": 36,
|
|
@@ -62,7 +35,7 @@
|
|
| 62 |
"sliding_window": null,
|
| 63 |
"tie_word_embeddings": true,
|
| 64 |
"transformers_version": "4.56.2",
|
| 65 |
-
"use_cache":
|
| 66 |
"use_sliding_window": false,
|
| 67 |
"vocab_size": 151936
|
| 68 |
}
|
|
|
|
| 12 |
"initializer_range": 0.02,
|
| 13 |
"intermediate_size": 9728,
|
| 14 |
"layer_types": [
|
| 15 |
+
"full_attention", "full_attention", "full_attention", "full_attention",
|
| 16 |
+
"full_attention", "full_attention", "full_attention", "full_attention",
|
| 17 |
+
"full_attention", "full_attention", "full_attention", "full_attention",
|
| 18 |
+
"full_attention", "full_attention", "full_attention", "full_attention",
|
| 19 |
+
"full_attention", "full_attention", "full_attention", "full_attention",
|
| 20 |
+
"full_attention", "full_attention", "full_attention", "full_attention",
|
| 21 |
+
"full_attention", "full_attention", "full_attention", "full_attention",
|
| 22 |
+
"full_attention", "full_attention", "full_attention", "full_attention",
|
| 23 |
+
"full_attention", "full_attention", "full_attention", "full_attention"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
],
|
| 25 |
"max_position_embeddings": 262144,
|
| 26 |
"max_window_layers": 36,
|
|
|
|
| 35 |
"sliding_window": null,
|
| 36 |
"tie_word_embeddings": true,
|
| 37 |
"transformers_version": "4.56.2",
|
| 38 |
+
"use_cache": true,
|
| 39 |
"use_sliding_window": false,
|
| 40 |
"vocab_size": 151936
|
| 41 |
}
|