Text Generation
Transformers
Safetensors
English
gemma4
image-text-to-text
gemma-4-31b
cipher
kin
creative-coding
web-design
html
css
javascript
three.js
gsap
unsloth
qlora
lora
sft
single-file-html
conversational
Instructions to use Auroraventures/cipher-sft-merged with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Auroraventures/cipher-sft-merged with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Auroraventures/cipher-sft-merged") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Auroraventures/cipher-sft-merged") model = AutoModelForMultimodalLM.from_pretrained("Auroraventures/cipher-sft-merged") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Auroraventures/cipher-sft-merged with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Auroraventures/cipher-sft-merged" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Auroraventures/cipher-sft-merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Auroraventures/cipher-sft-merged
- SGLang
How to use Auroraventures/cipher-sft-merged 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 "Auroraventures/cipher-sft-merged" \ --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": "Auroraventures/cipher-sft-merged", "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 "Auroraventures/cipher-sft-merged" \ --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": "Auroraventures/cipher-sft-merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use Auroraventures/cipher-sft-merged with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Auroraventures/cipher-sft-merged to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Auroraventures/cipher-sft-merged to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Auroraventures/cipher-sft-merged to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="Auroraventures/cipher-sft-merged", max_seq_length=2048, ) - Docker Model Runner
How to use Auroraventures/cipher-sft-merged with Docker Model Runner:
docker model run hf.co/Auroraventures/cipher-sft-merged
Upload cipher-host-colab.ipynb with huggingface_hub
Browse files- cipher-host-colab.ipynb +148 -0
cipher-host-colab.ipynb
ADDED
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Hosted on Colab Pro+ A100\n",
|
| 8 |
+
"\n",
|
| 9 |
+
"Spins up Cipher (kin-cipher) on this Colab GPU and exposes it via cloudflared tunnel.\n",
|
| 10 |
+
"Use the printed URL from your laptop for fast generation.\n",
|
| 11 |
+
"\n",
|
| 12 |
+
"**Runtime needed:** A100 (Colab Pro+). At T4 it'll work but slower (~5-10 t/s)."
|
| 13 |
+
]
|
| 14 |
+
},
|
| 15 |
+
{
|
| 16 |
+
"cell_type": "code",
|
| 17 |
+
"metadata": {},
|
| 18 |
+
"execution_count": null,
|
| 19 |
+
"outputs": [],
|
| 20 |
+
"source": [
|
| 21 |
+
"# Cell 1 — install Ollama + cloudflared + curl\n",
|
| 22 |
+
"import os, subprocess, time\n",
|
| 23 |
+
"\n",
|
| 24 |
+
"print('Installing Ollama...')\n",
|
| 25 |
+
"subprocess.run('curl -fsSL https://ollama.com/install.sh | sh', shell=True, check=True)\n",
|
| 26 |
+
"\n",
|
| 27 |
+
"print('Downloading cloudflared...')\n",
|
| 28 |
+
"subprocess.run('wget -qq https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -O /usr/local/bin/cloudflared && chmod +x /usr/local/bin/cloudflared', shell=True, check=True)\n",
|
| 29 |
+
"\n",
|
| 30 |
+
"print('Done.')"
|
| 31 |
+
]
|
| 32 |
+
},
|
| 33 |
+
{
|
| 34 |
+
"cell_type": "code",
|
| 35 |
+
"metadata": {},
|
| 36 |
+
"execution_count": null,
|
| 37 |
+
"outputs": [],
|
| 38 |
+
"source": [
|
| 39 |
+
"# Cell 2 — start Ollama serve in background\n",
|
| 40 |
+
"import subprocess, time, os\n",
|
| 41 |
+
"\n",
|
| 42 |
+
"# kill any existing\n",
|
| 43 |
+
"subprocess.run('pkill -f ollama 2>/dev/null', shell=True)\n",
|
| 44 |
+
"time.sleep(2)\n",
|
| 45 |
+
"\n",
|
| 46 |
+
"# start Ollama with GPU support\n",
|
| 47 |
+
"subprocess.Popen('OLLAMA_FLASH_ATTENTION=1 OLLAMA_KEEP_ALIVE=24h nohup ollama serve > /tmp/ollama.log 2>&1 &', shell=True)\n",
|
| 48 |
+
"time.sleep(8)\n",
|
| 49 |
+
"\n",
|
| 50 |
+
"# verify\n",
|
| 51 |
+
"import urllib.request\n",
|
| 52 |
+
"print(urllib.request.urlopen('http://localhost:11434/api/version').read().decode())"
|
| 53 |
+
]
|
| 54 |
+
},
|
| 55 |
+
{
|
| 56 |
+
"cell_type": "code",
|
| 57 |
+
"metadata": {},
|
| 58 |
+
"execution_count": null,
|
| 59 |
+
"outputs": [],
|
| 60 |
+
"source": [
|
| 61 |
+
"# Cell 3 — pull Cipher GGUF (public — no auth needed)\n",
|
| 62 |
+
"import subprocess\n",
|
| 63 |
+
"print('Pulling Cipher GGUF (~18GB, 5-10 min on Colab fast network)...')\n",
|
| 64 |
+
"result = subprocess.run('ollama pull hf.co/Auroraventures/cipher-sft-merged-Q4_K_M-GGUF', shell=True, capture_output=True, text=True)\n",
|
| 65 |
+
"print(result.stdout)\n",
|
| 66 |
+
"print(result.stderr)\n",
|
| 67 |
+
"\n",
|
| 68 |
+
"# Tag as kin-cipher\n",
|
| 69 |
+
"subprocess.run('ollama cp hf.co/Auroraventures/cipher-sft-merged-Q4_K_M-GGUF kin-cipher', shell=True)\n",
|
| 70 |
+
"print('---')\n",
|
| 71 |
+
"subprocess.run('ollama list', shell=True)"
|
| 72 |
+
]
|
| 73 |
+
},
|
| 74 |
+
{
|
| 75 |
+
"cell_type": "code",
|
| 76 |
+
"metadata": {},
|
| 77 |
+
"execution_count": null,
|
| 78 |
+
"outputs": [],
|
| 79 |
+
"source": [
|
| 80 |
+
"# Cell 4 — quick test (no tunnel yet, just verify model works on this GPU)\n",
|
| 81 |
+
"import urllib.request, json, time\n",
|
| 82 |
+
"\n",
|
| 83 |
+
"prompt = '<start_of_turn>user\\nIn 30 words, describe yourself.<end_of_turn>\\n<start_of_turn>model\\n'\n",
|
| 84 |
+
"body = json.dumps({\n",
|
| 85 |
+
" 'model': 'kin-cipher',\n",
|
| 86 |
+
" 'prompt': prompt,\n",
|
| 87 |
+
" 'raw': True,\n",
|
| 88 |
+
" 'stream': False,\n",
|
| 89 |
+
" 'options': {'temperature': 0.7, 'num_predict': 100, 'stop': ['<end_of_turn>']},\n",
|
| 90 |
+
"}).encode()\n",
|
| 91 |
+
"\n",
|
| 92 |
+
"t0 = time.time()\n",
|
| 93 |
+
"req = urllib.request.Request('http://localhost:11434/api/generate', data=body, headers={'Content-Type': 'application/json'})\n",
|
| 94 |
+
"data = json.loads(urllib.request.urlopen(req, timeout=300).read())\n",
|
| 95 |
+
"elapsed = time.time() - t0\n",
|
| 96 |
+
"print(f'Time: {elapsed:.1f}s | tokens: {data.get(\"eval_count\")} | speed: {data.get(\"eval_count\",0)/(data.get(\"eval_duration\",1)/1e9):.1f} t/s')\n",
|
| 97 |
+
"print('---')\n",
|
| 98 |
+
"print(data['response'])"
|
| 99 |
+
]
|
| 100 |
+
},
|
| 101 |
+
{
|
| 102 |
+
"cell_type": "code",
|
| 103 |
+
"metadata": {},
|
| 104 |
+
"execution_count": null,
|
| 105 |
+
"outputs": [],
|
| 106 |
+
"source": [
|
| 107 |
+
"# Cell 5 — start cloudflared tunnel and print public URL\n",
|
| 108 |
+
"import subprocess, time, re, os\n",
|
| 109 |
+
"\n",
|
| 110 |
+
"subprocess.run('pkill -f cloudflared 2>/dev/null', shell=True)\n",
|
| 111 |
+
"time.sleep(2)\n",
|
| 112 |
+
"\n",
|
| 113 |
+
"subprocess.Popen('nohup cloudflared tunnel --url http://localhost:11434 > /tmp/tunnel.log 2>&1 &', shell=True)\n",
|
| 114 |
+
"\n",
|
| 115 |
+
"# Wait for tunnel URL to appear in log\n",
|
| 116 |
+
"url = None\n",
|
| 117 |
+
"for _ in range(30):\n",
|
| 118 |
+
" time.sleep(2)\n",
|
| 119 |
+
" try:\n",
|
| 120 |
+
" log = open('/tmp/tunnel.log').read()\n",
|
| 121 |
+
" m = re.search(r'https://[a-z0-9-]+\\.trycloudflare\\.com', log)\n",
|
| 122 |
+
" if m:\n",
|
| 123 |
+
" url = m.group(0)\n",
|
| 124 |
+
" break\n",
|
| 125 |
+
" except: pass\n",
|
| 126 |
+
"\n",
|
| 127 |
+
"if url:\n",
|
| 128 |
+
" print(f'\\n========================================')\n",
|
| 129 |
+
" print(f'CIPHER PUBLIC URL: {url}')\n",
|
| 130 |
+
" print(f'========================================')\n",
|
| 131 |
+
" print(f'\\nTest it:')\n",
|
| 132 |
+
" print(f'curl {url}/api/version')\n",
|
| 133 |
+
" print(f'\\nFrom your laptop, set CIPHER_API_URL to use it.')\n",
|
| 134 |
+
"else:\n",
|
| 135 |
+
" print('Tunnel URL not found - check /tmp/tunnel.log')\n",
|
| 136 |
+
" print(open('/tmp/tunnel.log').read())"
|
| 137 |
+
]
|
| 138 |
+
}
|
| 139 |
+
],
|
| 140 |
+
"metadata": {
|
| 141 |
+
"kernelspec": {"display_name": "Python 3", "language": "python", "name": "python3"},
|
| 142 |
+
"language_info": {"name": "python", "version": "3.10"},
|
| 143 |
+
"accelerator": "GPU",
|
| 144 |
+
"colab": {"gpuType": "A100"}
|
| 145 |
+
},
|
| 146 |
+
"nbformat": 4,
|
| 147 |
+
"nbformat_minor": 4
|
| 148 |
+
}
|