Text Generation
Transformers
Safetensors
English
sky-crest
sky
crest
adaptive-depth
0labs
reasoning
code-generation
made-in-india
conversational
custom_code
Instructions to use 0labs-in/Sky-v2.0-11B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use 0labs-in/Sky-v2.0-11B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="0labs-in/Sky-v2.0-11B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("0labs-in/Sky-v2.0-11B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use 0labs-in/Sky-v2.0-11B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "0labs-in/Sky-v2.0-11B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "0labs-in/Sky-v2.0-11B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/0labs-in/Sky-v2.0-11B
- SGLang
How to use 0labs-in/Sky-v2.0-11B 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 "0labs-in/Sky-v2.0-11B" \ --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": "0labs-in/Sky-v2.0-11B", "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 "0labs-in/Sky-v2.0-11B" \ --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": "0labs-in/Sky-v2.0-11B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use 0labs-in/Sky-v2.0-11B with Docker Model Runner:
docker model run hf.co/0labs-in/Sky-v2.0-11B
Upload modeling_sky_crest.py with huggingface_hub
Browse files- modeling_sky_crest.py +23 -5
modeling_sky_crest.py
CHANGED
|
@@ -1,22 +1,40 @@
|
|
| 1 |
"""
|
| 2 |
Sky CREST Model — 0labs
|
| 3 |
-
|
| 4 |
"""
|
| 5 |
-
import copy
|
| 6 |
import torch
|
| 7 |
import torch.nn as nn
|
| 8 |
-
|
| 9 |
from .configuration_sky_crest import SkyCRESTConfig
|
| 10 |
from .crest_block import CRESTBlock
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
config_class = SkyCRESTConfig
|
| 15 |
|
| 16 |
def __init__(self, config):
|
| 17 |
super().__init__(config)
|
| 18 |
max_steps = getattr(config, "crest_max_steps", 4)
|
| 19 |
-
# Retrofit every MLP with CREST
|
| 20 |
hidden_size = config.hidden_size
|
| 21 |
for layer in self.model.layers:
|
| 22 |
orig_mlp = layer.mlp
|
|
|
|
| 1 |
"""
|
| 2 |
Sky CREST Model — 0labs
|
| 3 |
+
SkyCRESTForCausalLM: Adaptive-depth language model architecture.
|
| 4 |
"""
|
|
|
|
| 5 |
import torch
|
| 6 |
import torch.nn as nn
|
| 7 |
+
import transformers
|
| 8 |
from .configuration_sky_crest import SkyCRESTConfig
|
| 9 |
from .crest_block import CRESTBlock
|
| 10 |
|
| 11 |
+
# Dynamically resolve base architecture (internal, not user-facing)
|
| 12 |
+
_BASE_CLASSES = [
|
| 13 |
+
"Qwen3_5ForCausalLM",
|
| 14 |
+
"Qwen2ForCausalLM",
|
| 15 |
+
"LlamaForCausalLM",
|
| 16 |
+
]
|
| 17 |
|
| 18 |
+
_BaseClass = None
|
| 19 |
+
for _name in _BASE_CLASSES:
|
| 20 |
+
_BaseClass = getattr(transformers, _name, None)
|
| 21 |
+
if _BaseClass is not None:
|
| 22 |
+
break
|
| 23 |
+
|
| 24 |
+
if _BaseClass is None:
|
| 25 |
+
raise ImportError(
|
| 26 |
+
"Sky v2.0 requires transformers>=4.51.0. "
|
| 27 |
+
"Run: pip install --upgrade transformers"
|
| 28 |
+
)
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
class SkyCRESTForCausalLM(_BaseClass):
|
| 32 |
+
"""Sky v2.0 — Adaptive-depth language model with CREST architecture by 0labs."""
|
| 33 |
config_class = SkyCRESTConfig
|
| 34 |
|
| 35 |
def __init__(self, config):
|
| 36 |
super().__init__(config)
|
| 37 |
max_steps = getattr(config, "crest_max_steps", 4)
|
|
|
|
| 38 |
hidden_size = config.hidden_size
|
| 39 |
for layer in self.model.layers:
|
| 40 |
orig_mlp = layer.mlp
|