--- language: - ko - en license: cc-by-nc-sa-4.0 base_model: yanolja/EEVE-Korean-Instruct-10.8B-v1.0 tags: - korean - instruction-tuning - lora - merged - quantized - 8-bit - bitsandbytes - production library_name: transformers pipeline_tag: text-generation --- # EEVE-VSS-SMH-BNB-8bit > **8-bit Quantized Version (Production-Ready)** | **8-bit 양자화 버전 (프로덕션용)** --- ## English ### Model Description This model is a **BitsAndBytes 8-bit quantized** version of [MyeongHo0621/eeve-vss-smh](https://huggingface.co/MyeongHo0621/eeve-vss-smh), optimized for production deployment. #### Key Features - ✅ **Production-Ready**: Near-FP16 quality with 50% memory reduction - ✅ **8-bit Quantization**: Minimal quality loss (<0.5%) - ✅ **High Stability**: More stable than 4-bit for production services - ✅ **Optimal Balance**: Best quality-performance trade-off ### Quick Start #### Installation ```bash pip install transformers torch bitsandbytes accelerate ``` **Required**: `bitsandbytes` library is mandatory! #### Basic Usage ```python from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig import torch # 8-bit configuration bnb_config = BitsAndBytesConfig( load_in_8bit=True, llm_int8_threshold=6.0 ) # Load model model = AutoModelForCausalLM.from_pretrained( "MyeongHo0621/eeve-vss-smh-bnb-8bit", quantization_config=bnb_config, device_map="auto", trust_remote_code=True ) tokenizer = AutoTokenizer.from_pretrained("MyeongHo0621/eeve-vss-smh-bnb-8bit") # Prompt template def create_prompt(user_input): return f"""A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. Human: {user_input} Assistant: """ # Generate user_input = "Explain quantum computing" prompt = create_prompt(user_input) inputs = tokenizer(prompt, return_tensors="pt").to(model.device) outputs = model.generate( **inputs, max_new_tokens=512, temperature=0.3, top_p=0.85, repetition_penalty=1.0, do_sample=True, pad_token_id=tokenizer.eos_token_id ) response = tokenizer.decode(outputs[0][inputs['input_ids'].shape[1]:], skip_special_tokens=True) print(response) ``` #### Alternative: Using torch.dtype Directly ```python from transformers import AutoModelForCausalLM, AutoTokenizer import torch # Load with explicit dtype model = AutoModelForCausalLM.from_pretrained( "MyeongHo0621/eeve-vss-smh-bnb-8bit", device_map="auto", torch_dtype=torch.float16, trust_remote_code=True ) tokenizer = AutoTokenizer.from_pretrained("MyeongHo0621/eeve-vss-smh-bnb-8bit") ``` #### Simplified Method (Auto-load quantization config) ```python from transformers import AutoModelForCausalLM, AutoTokenizer # Automatically loads saved quantization settings model = AutoModelForCausalLM.from_pretrained( "MyeongHo0621/eeve-vss-smh-bnb-8bit", device_map="auto", trust_remote_code=True ) tokenizer = AutoTokenizer.from_pretrained("MyeongHo0621/eeve-vss-smh-bnb-8bit") ``` ### System Requirements #### Minimum Specifications | Component | Minimum | Recommended | |-----------|---------|-------------| | **GPU** | RTX 3060 (12GB) | RTX 4090 (24GB) | | **VRAM** | 10GB | 12GB+ | | **RAM** | 16GB | 32GB+ | | **CUDA** | 11.0+ | 12.0+ | #### Tested Environments - ✅ RTX 3060 (12GB VRAM) - Works well - ✅ RTX 3090 (24GB VRAM) - Excellent - ✅ RTX 4090 (24GB VRAM) - Perfect - ✅ H100 (80GB VRAM) - Overkill but excellent ### Quantization Details #### BitsAndBytes 8-bit ```yaml Quantization Type: INT8 Bits: 8-bit Outlier Threshold: 6.0 Method: LLM.int8() with outlier detection Quality: 99.5% of FP16 ``` #### Performance Comparison | Version | Model Size | VRAM Usage | Quality Loss | Inference Speed | Production | |---------|-----------|------------|--------------|-----------------|------------| | **FP16 Original** | ~21GB | ~21GB | 0% | ⚡⚡⚡⚡ | ⭐⭐⭐⭐⭐ | | **BNB 8-bit** | ~10.5GB | ~10GB | <0.5% | ⚡⚡⚡⚡ | ⭐⭐⭐⭐⭐ | | **BNB 4-bit** | ~5.5GB | ~3.5GB | 1-2% | ⚡⚡⚡ | ⭐⭐⭐ | ### Recommended Generation Parameters ```python generation_config = { "max_new_tokens": 512, "temperature": 0.3, "top_p": 0.85, "repetition_penalty": 1.0, "do_sample": True, "pad_token_id": tokenizer.pad_token_id, "eos_token_id": tokenizer.eos_token_id, } ``` #### Parameter Guide by Use Case | Use Case | Temperature | Top P | Notes | |----------|-------------|-------|-------| | **Factual Answers** | 0.1-0.3 | 0.8-0.9 | Fact-based questions | | **Balanced** | 0.5-0.7 | 0.85-0.95 | General usage | | **Creative** | 0.8-1.0 | 0.9-1.0 | Stories, poems | ### Production Deployment #### Why 8-bit for Production? - **Quality**: <0.5% loss compared to FP16 (vs 1-2% for 4-bit) - **Stability**: More consistent outputs - **Cost-Effective**: 50% memory reduction vs FP16 - **Battle-Tested**: LLM.int8() algorithm widely used in production #### Deployment Architecture ``` Load Balancer ↓ ┌─────────────┬─────────────┬─────────────┐ │ Server 1 │ Server 2 │ Server 3 │ │ RTX 4090 │ RTX 4090 │ RTX 4090 │ │ 8-bit │ 8-bit │ 8-bit │ └─────────────┴─────────────┴─────────────┘ Cost: ~60% of FP16 deployment Quality: 99.5% of FP16 ``` ### Example Outputs #### Korean Response Quality **Input**: ``` WMS 시스템의 핵심 기능 3가지를 설명해주세요 ``` **Output**: ``` WMS(Warehouse Management System) 시스템의 핵심 기능 3가지는 다음과 같습니다: 1. 재고 관리 (Inventory Management) - 실시간 재고 추적 및 가시성 제공 - 입출고 자동화 및 정확도 향상 - 재고 회전율 최적화 2. 주문 처리 (Order Fulfillment) - 피킹, 패킹, 배송 프로세스 자동화 - 주문 우선순위 관리 - 배송 정확도 향상 3. 창고 최적화 (Warehouse Optimization) - 공간 활용 극대화 - 동선 최적화 - 작업 생산성 향상 이러한 기능들을 통해 물류 효율성을 크게 개선할 수 있습니다. ``` ### Original Model Information This is a quantized version of: - **Original Model**: [MyeongHo0621/eeve-vss-smh](https://huggingface.co/MyeongHo0621/eeve-vss-smh) - **Base Model**: [yanolja/EEVE-Korean-Instruct-10.8B-v1.0](https://huggingface.co/yanolja/EEVE-Korean-Instruct-10.8B-v1.0) - **Training Data**: 100K+ high-quality Korean instruction data - **LoRA Config**: r=64, alpha=128, dropout=0.05 For detailed training process, see [original model page](https://huggingface.co/MyeongHo0621/eeve-vss-smh). ### Troubleshooting #### CUDA Out of Memory ```python # Reduce max_new_tokens generation_config = { "max_new_tokens": 256, # 512 → 256 ... } ``` #### bitsandbytes Installation Error ```bash # Check CUDA version nvidia-smi # CUDA 11.x pip install bitsandbytes # CUDA 12.x pip install bitsandbytes --upgrade ``` ### Use Cases #### ✅ Ideal For - Production deployments - API services with SLA requirements - High-throughput applications - Cost-sensitive deployments - Quality-critical applications #### ⚠️ Consider Alternatives If - Ultra-low VRAM (<10GB) → Use [4-bit version](https://huggingface.co/MyeongHo0621/eeve-vss-smh-bnb-4bit) - Maximum quality needed → Use [FP16 original](https://huggingface.co/MyeongHo0621/eeve-vss-smh) ### Limitations - Requires **~10GB VRAM** (vs 3.5GB for 4-bit) - **<0.5% quality loss** compared to FP16 - Requires `bitsandbytes` library - Windows may require additional setup ### License - **Model License**: CC-BY-NC-SA-4.0 - **Base Model**: [EEVE-Korean-Instruct-10.8B-v1.0](https://huggingface.co/yanolja/EEVE-Korean-Instruct-10.8B-v1.0) - **Commercial Use**: Limited (see license) ### Citation ```bibtex @misc{eeve-vss-smh-bnb-8bit-2025, author = {MyeongHo0621}, title = {EEVE-VSS-SMH-BNB-8bit: 8-bit Quantized Korean Model for Production}, year = {2025}, publisher = {Hugging Face}, howpublished = {\url{https://huggingface.co/MyeongHo0621/eeve-vss-smh-bnb-8bit}}, note = {8-bit quantized version using BitsAndBytes LLM.int8()} } ``` ### Acknowledgments - **Original Model**: [MyeongHo0621/eeve-vss-smh](https://huggingface.co/MyeongHo0621/eeve-vss-smh) - **Base Model**: [Yanolja EEVE](https://huggingface.co/yanolja/EEVE-Korean-Instruct-10.8B-v1.0) - **Quantization Library**: [BitsAndBytes](https://github.com/TimDettmers/bitsandbytes) - **Framework**: Hugging Face Transformers ### Related Models | Model | Size | VRAM | Quality | Use Case | |-------|------|------|---------|----------| | [eeve-vss-smh](https://huggingface.co/MyeongHo0621/eeve-vss-smh) | 21GB | 21GB | 100% | High-end GPUs | | **eeve-vss-smh-bnb-8bit** | 10.5GB | 10GB | 99.5% | Production ⭐ | | [eeve-vss-smh-bnb-4bit](https://huggingface.co/MyeongHo0621/eeve-vss-smh-bnb-4bit) | 5.5GB | 3.5GB | 98% | Low-VRAM | ### Contact - **Original Model**: [eeve-vss-smh](https://huggingface.co/MyeongHo0621/eeve-vss-smh) --- **Quantization Date**: 2025-10-11 **Method**: BitsAndBytes LLM.int8() **Status**: Production-Ready 🚀 --- ## 한국어 ### 모델 소개 이 모델은 [MyeongHo0621/eeve-vss-smh](https://huggingface.co/MyeongHo0621/eeve-vss-smh)를 **BitsAndBytes 8-bit**로 양자화한 프로덕션용 버전입니다. #### 주요 특징 - ✅ **프로덕션 최적화**: FP16과 거의 동일한 품질로 메모리 50% 절감 - ✅ **8-bit 양자화**: 품질 손실 최소 (<0.5%) - ✅ **높은 안정성**: 4-bit보다 프로덕션 서비스에 안정적 - ✅ **최적 균형**: 품질과 성능의 최고 조합 ### 빠른 시작 #### 설치 ```bash pip install transformers torch bitsandbytes accelerate ``` **필수**: `bitsandbytes` 라이브러리가 반드시 필요합니다! #### 기본 사용 ```python from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig import torch # 8-bit 설정 bnb_config = BitsAndBytesConfig( load_in_8bit=True, llm_int8_threshold=6.0 ) # 모델 로드 model = AutoModelForCausalLM.from_pretrained( "MyeongHo0621/eeve-vss-smh-bnb-8bit", quantization_config=bnb_config, device_map="auto", trust_remote_code=True ) tokenizer = AutoTokenizer.from_pretrained("MyeongHo0621/eeve-vss-smh-bnb-8bit") # 프롬프트 템플릿 def create_prompt(user_input): return f"""A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. Human: {user_input} Assistant: """ # 대화 user_input = "양자 컴퓨팅에 대해 설명해주세요" prompt = create_prompt(user_input) inputs = tokenizer(prompt, return_tensors="pt").to(model.device) outputs = model.generate( **inputs, max_new_tokens=512, temperature=0.3, top_p=0.85, repetition_penalty=1.0, do_sample=True, pad_token_id=tokenizer.eos_token_id ) response = tokenizer.decode(outputs[0][inputs['input_ids'].shape[1]:], skip_special_tokens=True) print(response) ``` #### 대안: torch.dtype 직접 사용 ```python from transformers import AutoModelForCausalLM, AutoTokenizer import torch # dtype 명시적 지정 model = AutoModelForCausalLM.from_pretrained( "MyeongHo0621/eeve-vss-smh-bnb-8bit", device_map="auto", torch_dtype=torch.float16, trust_remote_code=True ) tokenizer = AutoTokenizer.from_pretrained("MyeongHo0621/eeve-vss-smh-bnb-8bit") ``` #### 간단한 방법 (저장된 설정 자동 로드) ```python from transformers import AutoModelForCausalLM, AutoTokenizer # 저장된 양자화 설정을 자동으로 로드 model = AutoModelForCausalLM.from_pretrained( "MyeongHo0621/eeve-vss-smh-bnb-8bit", device_map="auto", trust_remote_code=True ) tokenizer = AutoTokenizer.from_pretrained("MyeongHo0621/eeve-vss-smh-bnb-8bit") ``` ### 시스템 요구사항 #### 최소 사양 | 구성 요소 | 최소 사양 | 추천 사양 | |---------|---------|---------| | **GPU** | RTX 3060 (12GB) | RTX 4090 (24GB) | | **VRAM** | 10GB | 12GB+ | | **RAM** | 16GB | 32GB+ | | **CUDA** | 11.0+ | 12.0+ | #### 테스트된 환경 - ✅ RTX 3060 (12GB VRAM) - 원활하게 작동 - ✅ RTX 3090 (24GB VRAM) - 훌륭함 - ✅ RTX 4090 (24GB VRAM) - 완벽함 - ✅ H100 (80GB VRAM) - 오버킬이지만 완벽 ### 양자화 세부사항 #### BitsAndBytes 8-bit ```yaml Quantization Type: INT8 Bits: 8-bit Outlier Threshold: 6.0 Method: LLM.int8() with outlier detection Quality: FP16의 99.5% ``` #### 성능 비교 | 버전 | 모델 크기 | VRAM 사용 | 품질 손실 | 추론 속도 | 프로덕션 | |------|----------|-----------|----------|----------|----------| | **FP16 원본** | ~21GB | ~21GB | 0% | ⚡⚡⚡⚡ | ⭐⭐⭐⭐⭐ | | **BNB 8-bit** | ~10.5GB | ~10GB | <0.5% | ⚡⚡⚡⚡ | ⭐⭐⭐⭐⭐ | | **BNB 4-bit** | ~5.5GB | ~3.5GB | 1-2% | ⚡⚡⚡ | ⭐⭐⭐ | ### 추천 생성 파라미터 ```python generation_config = { "max_new_tokens": 512, "temperature": 0.3, "top_p": 0.85, "repetition_penalty": 1.0, "do_sample": True, "pad_token_id": tokenizer.pad_token_id, "eos_token_id": tokenizer.eos_token_id, } ``` #### 용도별 파라미터 | 용도 | Temperature | Top P | 설명 | |------|-------------|-------|------| | **정확한 답변** | 0.1-0.3 | 0.8-0.9 | 사실 기반 질문 | | **균형 답변** | 0.5-0.7 | 0.85-0.95 | 일반적 사용 | | **창의적 답변** | 0.8-1.0 | 0.9-1.0 | 스토리, 시 등 | ### 프로덕션 배포 #### 프로덕션에 8-bit를 선택하는 이유? - **품질**: FP16 대비 <0.5% 손실 (4-bit는 1-2%) - **안정성**: 더 일관된 출력 - **비용 효율**: FP16 대비 50% 메모리 절감 - **검증된 기술**: LLM.int8() 알고리즘은 프로덕션에서 널리 사용됨 #### 배포 아키텍처 ``` 로드 밸런서 ↓ ┌─────────────┬─────────────┬─────────────┐ │ 서버 1 │ 서버 2 │ 서버 3 │ │ RTX 4090 │ RTX 4090 │ RTX 4090 │ │ 8-bit │ 8-bit │ 8-bit │ └─────────────┴─────────────┴─────────────┘ 비용: FP16 배포의 ~60% 품질: FP16의 99.5% ``` ### 성능 예시 #### 한국어 응답 품질 **입력**: ``` WMS 시스템의 핵심 기능 3가지를 설명해주세요 ``` **출력**: ``` WMS(Warehouse Management System) 시스템의 핵심 기능 3가지는 다음과 같습니다: 1. 재고 관리 (Inventory Management) - 실시간 재고 추적 및 가시성 제공 - 입출고 자동화 및 정확도 향상 - 재고 회전율 최적화 2. 주문 처리 (Order Fulfillment) - 피킹, 패킹, 배송 프로세스 자동화 - 주문 우선순위 관리 - 배송 정확도 향상 3. 창고 최적화 (Warehouse Optimization) - 공간 활용 극대화 - 동선 최적화 - 작업 생산성 향상 이러한 기능들을 통해 물류 효율성을 크게 개선할 수 있습니다. ``` ### 원본 모델 정보 이 모델은 다음 모델의 양자화 버전입니다: - **원본 모델**: [MyeongHo0621/eeve-vss-smh](https://huggingface.co/MyeongHo0621/eeve-vss-smh) - **베이스 모델**: [yanolja/EEVE-Korean-Instruct-10.8B-v1.0](https://huggingface.co/yanolja/EEVE-Korean-Instruct-10.8B-v1.0) - **훈련 데이터**: 100K+ 고품질 한국어 instruction 데이터 - **LoRA 설정**: r=64, alpha=128, dropout=0.05 자세한 훈련 과정은 [원본 모델 페이지](https://huggingface.co/MyeongHo0621/eeve-vss-smh)를 참조하세요. ### 문제 해결 #### CUDA Out of Memory ```python # max_new_tokens 줄이기 generation_config = { "max_new_tokens": 256, # 512 → 256 ... } ``` #### bitsandbytes 설치 오류 ```bash # CUDA 버전 확인 nvidia-smi # CUDA 11.x pip install bitsandbytes # CUDA 12.x pip install bitsandbytes --upgrade ``` ### 사용 사례 #### ✅ 적합한 경우 - 프로덕션 배포 - SLA 요구사항이 있는 API 서비스 - 높은 처리량 애플리케이션 - 비용에 민감한 배포 - 품질이 중요한 애플리케이션 #### ⚠️ 대안 고려 사항 - 초저VRAM (<10GB) → [4-bit 버전](https://huggingface.co/MyeongHo0621/eeve-vss-smh-bnb-4bit) 사용 - 최고 품질 필요 → [FP16 원본](https://huggingface.co/MyeongHo0621/eeve-vss-smh) 사용 ### 제한사항 - **~10GB VRAM** 필요 (4-bit는 3.5GB) - FP16 대비 **<0.5% 품질 손실** - `bitsandbytes` 라이브러리 필수 - Windows에서 추가 설정 필요할 수 있음 ### 라이선스 - **모델 라이선스**: CC-BY-NC-SA-4.0 - **베이스 모델**: [EEVE-Korean-Instruct-10.8B-v1.0](https://huggingface.co/yanolja/EEVE-Korean-Instruct-10.8B-v1.0) - **상업적 사용**: 제한적 (라이선스 참조) ### Citation ```bibtex @misc{eeve-vss-smh-bnb-8bit-2025, author = {MyeongHo0621}, title = {EEVE-VSS-SMH-BNB-8bit: 8-bit Quantized Korean Model for Production}, year = {2025}, publisher = {Hugging Face}, howpublished = {\url{https://huggingface.co/MyeongHo0621/eeve-vss-smh-bnb-8bit}}, note = {8-bit quantized version using BitsAndBytes LLM.int8()} } ``` ### Acknowledgments - **원본 모델**: [MyeongHo0621/eeve-vss-smh](https://huggingface.co/MyeongHo0621/eeve-vss-smh) - **베이스 모델**: [Yanolja EEVE](https://huggingface.co/yanolja/EEVE-Korean-Instruct-10.8B-v1.0) - **양자화 라이브러리**: [BitsAndBytes](https://github.com/TimDettmers/bitsandbytes) - **프레임워크**: Hugging Face Transformers ### 관련 모델 | 모델 | 크기 | VRAM | 품질 | 용도 | |------|------|------|------|------| | [eeve-vss-smh](https://huggingface.co/MyeongHo0621/eeve-vss-smh) | 21GB | 21GB | 100% | 고사양 GPU | | **eeve-vss-smh-bnb-8bit** | 10.5GB | 10GB | 99.5% | 프로덕션 ⭐ | | [eeve-vss-smh-bnb-4bit](https://huggingface.co/MyeongHo0621/eeve-vss-smh-bnb-4bit) | 5.5GB | 3.5GB | 98% | 저VRAM | ### Contact - **원본 모델**: [eeve-vss-smh](https://huggingface.co/MyeongHo0621/eeve-vss-smh) - **Github** : [tuned_solar](https://github.com/EnzoMH/tuned_solar/tree/main/eeve) --- **양자화 일자**: 2025-10-11 **방법**: BitsAndBytes LLM.int8() **상태**: 프로덕션 준비 완료 🚀