Instructions to use MatteoKhan/TinyStable-Hybrid-1.6B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MatteoKhan/TinyStable-Hybrid-1.6B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MatteoKhan/TinyStable-Hybrid-1.6B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MatteoKhan/TinyStable-Hybrid-1.6B") model = AutoModelForCausalLM.from_pretrained("MatteoKhan/TinyStable-Hybrid-1.6B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MatteoKhan/TinyStable-Hybrid-1.6B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MatteoKhan/TinyStable-Hybrid-1.6B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MatteoKhan/TinyStable-Hybrid-1.6B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/MatteoKhan/TinyStable-Hybrid-1.6B
- SGLang
How to use MatteoKhan/TinyStable-Hybrid-1.6B 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 "MatteoKhan/TinyStable-Hybrid-1.6B" \ --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": "MatteoKhan/TinyStable-Hybrid-1.6B", "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 "MatteoKhan/TinyStable-Hybrid-1.6B" \ --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": "MatteoKhan/TinyStable-Hybrid-1.6B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use MatteoKhan/TinyStable-Hybrid-1.6B with Docker Model Runner:
docker model run hf.co/MatteoKhan/TinyStable-Hybrid-1.6B
🚀 TinyStable-Hybrid-1.6B: Merging Efficiency & Power
📌 Overview
TinyStable-Hybrid-1.6B is an experimental hybrid language model that merges the capabilities of TinyLlama and StableLM. Built using MergeKit, this model is designed to balance performance and efficiency while offering strong text generation capabilities.
🔗 Created by: Matteo Khan
🎓 Affiliation: Apprentice at TW3 Partners (Generative AI Research)
📍 License: MIT
🔗 Connect with me on LinkedIn
🔍 Model on Hugging Face
🧠 Model Details
- Model Type: Hybrid Language Model (Merged)
- Parent Models:
- Merging Technique: Linear Merge (MergeKit)
🎯 Intended Use
This model is primarily intended for research and experimentation in hybrid model optimization. Potential use cases include:
- ✅ Text Generation
- ✅ Conversational AI
- ✅ Creative Writing Assistance
- ✅ Exploration of Model Merging Effects
⚠️ Limitations & Considerations
While TinyStable-Hybrid-1.6B offers enhanced capabilities, it also inherits certain limitations from its parent models:
- ❌ May generate inaccurate or misleading information
- ⚠️ Potential for biased, offensive, or harmful content
- 🔄 Merging may introduce unpredictable behaviors
- 📉 Performance may vary across different tasks
🔬 Merging Process & Configuration
This is not a newly trained model, but rather a merge of existing models using the following configuration:
merge_method: linear
dtype: float16
models:
- model: "TinyLlama/TinyLlama-1.1B-Chat-v1.0"
parameters:
t: 1.0
weight: 0.5
- model: "TinyLlama/TinyLlama-1.1B-intermediate-step-1431k-3T"
parameters:
t: 1.0
weight: 0.5
parameters:
normalize: true
int8_mask: false
layers:
- pattern: "model.*"
📊 No formal evaluation has been conducted yet. Users are encouraged to benchmark and share feedback!
🌍 Environmental Impact
By utilizing model merging rather than training from scratch, TinyStable-Hybrid-1.6B significantly reduces computational and environmental costs.
🚀 How to Use
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "MatteoKhan/TinyStable-Hybrid-1.6B"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
# Example usage
prompt = "Write a short poem about artificial intelligence."
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_length=200)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
📝 TinyLlama
@misc{zhang2024tinyllama,
title={TinyLlama: An Open-Source Small Language Model},
author={Jiayu Zhang and others},
year={2024},
eprint={2401.02385},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
📩 Feedback & Contact: Reach out via Hugging Face.
🎉 Happy Experimenting! 🚀
- Downloads last month
- 18