--- license: other tags: - qwerky - mamba - hybrid - causal-lm - text-generation language: - en library_name: transformers pipeline_tag: text-generation --- # QRe Llama 3 8B Instruct - QDistill This is a hybrid Mamba-Transformer model based on the Llama 3.1 architecture, distilled from Llama 3.3 70B into a 8B parameter model using Qwerky's proprietary distillation method. The model uses MAMBA layers interleaved with attention layers for efficient sequence modeling. The results are a 8B parameter model comparable in quality to Llama's 3.1 8B but running at speeds as fast or faster than Llama's 3.2 3B model. ## Requirements - CUDA-compatible GPU - Python 3.8+ - PyTorch 2.0+ - transformers, safetensors, mamba-ssm, causal-conv1d, flash-attn ## Installation ```bash pip install transformers torch safetensors pip install flash-attn mamba-ssm causal-conv1d --no-build-isolation ``` ## Usage - Transformers ```python import torch from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("QwerkyAI/QRe-Llama-3-8B-Instruct-QDistill") model = AutoModelForCausalLM.from_pretrained( "QwerkyAI/QRe-Llama-3-8B-Instruct-QDistill", torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=True ) inputs = tokenizer("Hello, how are you?", return_tensors="pt").to("cuda") outputs = model.generate(**inputs, max_new_tokens=50) print(tokenizer.decode(outputs[0])) ``` ## Usage - vLLM ```bash pip install vllm qwerky-vllm-models vllm serve QwerkyAI/QRe-Llama-3-8B-Instruct-QDistill ``` ## Model Files - `config.json` - Model configuration with `auto_map` - `modeling_qwerky_llama_mamba_hybrid.py` - Custom modeling class - `configuration_qwerky_llama_mamba_hybrid.py` - Custom configuration class - `model.safetensors` - Model weights ## License See LICENSE file for details.