Text Generation
Transformers
Safetensors
PyTorch
Indonesian
English
cali
causal-lm
transformer
indonesian
english
custom-architecture
conversational
custom_code
Instructions to use Sandroeth/cali-0.1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Sandroeth/cali-0.1B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Sandroeth/cali-0.1B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Sandroeth/cali-0.1B", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Sandroeth/cali-0.1B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Sandroeth/cali-0.1B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Sandroeth/cali-0.1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Sandroeth/cali-0.1B
- SGLang
How to use Sandroeth/cali-0.1B 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 "Sandroeth/cali-0.1B" \ --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": "Sandroeth/cali-0.1B", "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 "Sandroeth/cali-0.1B" \ --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": "Sandroeth/cali-0.1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Sandroeth/cali-0.1B with Docker Model Runner:
docker model run hf.co/Sandroeth/cali-0.1B
| from transformers import PretrainedConfig | |
| class CALIConfig(PretrainedConfig): | |
| model_type = "cali" | |
| def __init__( | |
| self, | |
| vocab_size: int = 32000, | |
| hidden_dim: int = 768, | |
| num_layers: int = 11, | |
| num_heads: int = 4, | |
| num_kv_heads: int = 1, | |
| head_dim: int = 192, | |
| seq_len: int = 1024, | |
| ffn_multiplier: float = 3.0, | |
| dropout: float = 0.0, | |
| tie_embeddings: bool = True, | |
| rope_theta: float = 10000.0, | |
| rms_norm_eps: float = 1e-6, | |
| initializer_range: float = 0.02, | |
| use_cache: bool = True, | |
| pad_token_id: int = None, | |
| bos_token_id: int = 1, | |
| eos_token_id: int = 2, | |
| **kwargs, | |
| ): | |
| self.vocab_size = vocab_size | |
| self.hidden_dim = hidden_dim | |
| self.num_layers = num_layers | |
| self.num_heads = num_heads | |
| self.num_kv_heads = num_kv_heads | |
| self.head_dim = head_dim | |
| self.seq_len = seq_len | |
| self.ffn_multiplier = ffn_multiplier | |
| self.dropout = dropout | |
| self.tie_embeddings = tie_embeddings | |
| self.rope_theta = rope_theta | |
| self.rms_norm_eps = rms_norm_eps | |
| self.initializer_range = initializer_range | |
| self.use_cache = use_cache | |
| super().__init__( | |
| pad_token_id=pad_token_id, | |
| bos_token_id=bos_token_id, | |
| eos_token_id=eos_token_id, | |
| **kwargs, | |
| ) | |