Text Generation
Transformers
Safetensors
English
Japanese
gemma4
image-text-to-text
decision-engine
system-one
text-classification
gemma
fp8
compressed-tensors
llm-compressor
conversational
Instructions to use shisa-ai/shisa-de-2-FP8-dynamic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use shisa-ai/shisa-de-2-FP8-dynamic with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="shisa-ai/shisa-de-2-FP8-dynamic") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("shisa-ai/shisa-de-2-FP8-dynamic") model = AutoModelForMultimodalLM.from_pretrained("shisa-ai/shisa-de-2-FP8-dynamic", device_map="auto") 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use shisa-ai/shisa-de-2-FP8-dynamic with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "shisa-ai/shisa-de-2-FP8-dynamic" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shisa-ai/shisa-de-2-FP8-dynamic", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/shisa-ai/shisa-de-2-FP8-dynamic
- SGLang
How to use shisa-ai/shisa-de-2-FP8-dynamic 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 "shisa-ai/shisa-de-2-FP8-dynamic" \ --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": "shisa-ai/shisa-de-2-FP8-dynamic", "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 "shisa-ai/shisa-de-2-FP8-dynamic" \ --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": "shisa-ai/shisa-de-2-FP8-dynamic", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use shisa-ai/shisa-de-2-FP8-dynamic with Docker Model Runner:
docker model run hf.co/shisa-ai/shisa-de-2-FP8-dynamic
Shisa DE-2 FP8-Dynamic
An FP8-dynamic quantization of shisa-ai/shisa-de-2,
at 27.2 GB against 49 GB for the original. The readout contract, inference policy, usage and
benchmarks are the same as the original model's; see its card.
Quantization
| Scheme | FP8_DYNAMIC: 8-bit float weights with per-channel scales, dynamic per-token activation scales |
| Method | Data-free, with llm-compressor 0.13.0 model_free_ptq |
| Quantized | The Linear layers inside the transformer blocks |
| Kept in BF16 | Vision tower, audio tower, token embeddings, output head, MoE router, normalization layers |
recipe.yaml has the equivalent recipe.
Readout test
The 231 public JevBench items, read through the Shisa DE SDK from vLLM 0.30.0 on one RTX PRO 6000, raw probabilities, against the original model on the same server setup:
| Original (BF16) | FP8-dynamic | |
|---|---|---|
| Single read, easy / medium / hard | 48 / 72 / 83 | 48 / 72 / 84 |
| Adaptive policy, easy / medium / hard | 48 / 72 / 86 | 48 / 72 / 85 |
| Same answer as the original, single read | 224 of 231 | |
| Same answer as the original, adaptive policy | 224 of 231 | |
| Mean change in top probability, single read | 0.026 |
Serving
vllm serve shisa-ai/shisa-de-2-FP8-dynamic
from shisa_de import DecisionModel
de = DecisionModel.from_endpoint(
"http://127.0.0.1:8000/v1",
model="shisa-ai/shisa-de-2-FP8-dynamic",
tokenizer="shisa-ai/shisa-de-2", # also applies the original model's calibration
api_key="",
)
de.classify({"ticket": "I was charged twice."}, {"intent": ["refund", "cancel"]})
- Downloads last month
- 118