Instructions to use itsalxgg/Nushy-5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use itsalxgg/Nushy-5 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="itsalxgg/Nushy-5", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("itsalxgg/Nushy-5", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use itsalxgg/Nushy-5 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "itsalxgg/Nushy-5" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "itsalxgg/Nushy-5", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/itsalxgg/Nushy-5
- SGLang
How to use itsalxgg/Nushy-5 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 "itsalxgg/Nushy-5" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "itsalxgg/Nushy-5", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "itsalxgg/Nushy-5" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "itsalxgg/Nushy-5", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use itsalxgg/Nushy-5 with Docker Model Runner:
docker model run hf.co/itsalxgg/Nushy-5
Nushy5 π
Nushy5 is a 321,696-parameter decoder-only transformer. It reads a text prompt,
picks one of ten dog moods, and generates a short bark in that mood. Output is a
mood tag followed by bark tokens such as woof, *tail wag*, and *low growl*.
It does not answer questions.
Nushy5 uses standard transformer components in a custom overall architecture, so
it loads through transformers with trust_remote_code=True. transformers
requires the bundled tokenizer
(tokenizer_nushy5.py) and mood router (router.py) to load and run the weights.
Run it
Download the repo so the tokenizer and router are importable, then install the dependencies:
hf download itsalxgg/nushy-5 --local-dir nushy5 && cd nushy5
pip install torch transformers numpy safetensors
import torch
from transformers import AutoModelForCausalLM
from tokenizer_nushy5 import NushyTokenizer, END
from router import SemanticRouter
model = AutoModelForCausalLM.from_pretrained(".", trust_remote_code=True).eval()
tok, router = NushyTokenizer(), SemanticRouter()
prompt = "who's the best boy?"
mood = router.route(prompt) # "affectionate"
head = f"<|system|>\nNushy\n<|user|>\n{prompt}\n<|assistant|>\n"
ids = torch.tensor([tok.encode(head) + [tok.stoi[f'<|mood:{mood}|>']]])
out = model.generate(ids, max_new_tokens=24, do_sample=True, top_k=12,
temperature=0.8, eos_token_id=tok.stoi[END], pad_token_id=0)
print(tok.decode(out[0].tolist()[len(tok.encode(head)):]))
# <|mood:affectionate|> *nose boop* *wag wag* *tail wag* woof!
onnx/nushy5.int8.onnx runs the same weights under ONNX Runtime, using
tokenizer_nushy5.py and router.py for encoding and mood selection.
Architecture
| Field | Value |
|---|---|
| Layers | 3 |
| Attention | grouped-query, 4 query heads, 2 KV heads |
| Embedding width | 96 |
| Positional | rotary (RoPE), theta 10000, scalable via PI, NTK, YaRN |
| Context | 128 tokens trained |
| Vocab | 154, expandable (novel *action tags* cost 0 new ids) |
Measured
| Metric | Value | Source |
|---|---|---|
| Prompt to mood routing | 100%, 64 of 64 held-out gold | eval_routing_hard.py |
| Mood legibility (probe) | 81% against 10% chance | eval_expressiveness.py |
| KV-cache vs full forward | 3.3e-7 max abs diff | model.py |
| torch vs ONNX Runtime | 1e-5 max abs diff | export_onnx.py |
| int8 ONNX size | 0.36 MB | on disk |
Mood selection lives in a separate numpy router. The generator classifies prompt intent at about 40%, so the router picks the mood and the generator maps that mood to a bark.
Limits
- No GGUF build. ollama and llama.cpp support a fixed set of architectures and reject this custom one. Run Nushy5 through transformers or ONNX Runtime.
- The router misses a small tail of idioms such as "hit the hay".
- Greedy decoding repeats barks. Keep
do_sample=True.
License
MIT.
- Downloads last month
- 10