Kanana Safeguard Siren 8B - 4bit ์–‘์žํ™” ๋ฒ„์ „

๋ชจ๋ธ ๊ฐœ์š”

  • ์›๋ณธ ๋ชจ๋ธ: kakaocorp/kanana-safeguard-8b
  • ์–‘์žํ™” ๋ฐฉ๋ฒ•: BitsAndBytes 4bit (NF4)
  • ์–‘์žํ™” ๋„๊ตฌ: bitsandbytes + transformers
  • ์••์ถ•๋ฅ : ์›๋ณธ ๋Œ€๋น„ ์•ฝ 75% ํฌ๊ธฐ ๊ฐ์†Œ (์ถ”์ •)

๋ชจ๋ธ ์„ธ๋ถ€์ •๋ณด

์›๋ณธ ๋ชจ๋ธ ์ •๋ณด

  • ๋ชจ๋ธ ์•„ํ‚คํ…์ฒ˜: Safeguard model based on transformer architecture
  • ํŒŒ๋ผ๋ฏธํ„ฐ ์ˆ˜: 8B parameters
  • ์ฃผ์š” ์šฉ๋„: ์•ˆ์ „์„ฑ ๊ฒ€์ฆ, ์œ ํ•ด ์ฝ˜ํ…์ธ  ํƒ์ง€
  • ์–ธ์–ด: ํ•œ๊ตญ์–ด ์ค‘์‹ฌ
  • ์›๋ณธ ๋ชจ๋ธ ๋ผ์ด์„ ์Šค: Apache 2.0

์–‘์žํ™” ์ •๋ณด

  • ์–‘์žํ™” ํƒ€์ž…: 4bit NormalFloat (NF4)
  • ์ •๋ฐ€๋„: 4bit weights, 16bit activations

์„ฑ๋Šฅ ๋ฐ ๋ฒค์น˜๋งˆํฌ

๋ชจ๋ธ ํฌ๊ธฐ ๋น„๊ต

  • ์›๋ณธ ๋ชจ๋ธ: ~16GB (์ถ”์ •)
  • ์–‘์žํ™” ๋ชจ๋ธ: ~4GB (์ถ”์ •)
  • ์••์ถ•๋ฅ : ์•ฝ 75% ๊ฐ์†Œ

๋ฉ”๋ชจ๋ฆฌ ์‚ฌ์šฉ๋Ÿ‰

  • ๋กœ๋”ฉ ์‹œ VRAM: ์•ฝ 4-5GB
  • ์ถ”๋ก  ์‹œ VRAM: ์•ฝ 6-8GB (๋ฐฐ์น˜ ํฌ๊ธฐ์— ๋”ฐ๋ผ ๋ณ€๋™)
  • ์‹œ์Šคํ…œ RAM: ์ตœ์†Œ 8GB ๊ถŒ์žฅ

์‚ฌ์šฉ๋ฒ•

์„ค์น˜

pip install transformers accelerate bitsandbytes torch

์ฝ”๋“œ ์˜ˆ์‹œ

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig

model_name = "nxtcloud-org/kanana-safeguard-siren-8b-4bit"

# BitsAndBytesConfig ์„ค์ •
bnb_config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_use_double_quant=True,
    bnb_4bit_quant_type="nf4",
    bnb_4bit_compute_dtype=torch.bfloat16
)

# ๋ชจ๋ธ๊ณผ ํ† ํฌ๋‚˜์ด์ € ๋กœ๋“œ
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    quantization_config=bnb_config,
    device_map="auto",
    trust_remote_code=True
)

# ์‚ฌ์šฉ ์˜ˆ์‹œ - ์•ˆ์ „์„ฑ ๊ฒ€์ฆ
text = "์ด๊ฒƒ์€ ๊ฒ€์ฆํ•  ํ…์ŠคํŠธ์ž…๋‹ˆ๋‹ค."
inputs = tokenizer(text, return_tensors="pt")

with torch.no_grad():
    outputs = model.generate(
        **inputs,
        max_length=512,
        temperature=0.7,
        do_sample=True,
        pad_token_id=tokenizer.eos_token_id
    )

result = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(result)

์‹œ์Šคํ…œ ์š”๊ตฌ์‚ฌํ•ญ

  • ์ตœ์†Œ RAM: 8GB
  • ๊ถŒ์žฅ RAM: 16GB
  • GPU ๋ฉ”๋ชจ๋ฆฌ: 6GB VRAM (RTX 3060 ์ด์ƒ)
  • ์ง€์› ํ”Œ๋žซํผ: Linux, Windows (CUDA ์ง€์› GPU)
  • Python: 3.8+
  • CUDA: 11.1+

์ œํ•œ์‚ฌํ•ญ ๋ฐ ๊ณ ๋ ค์‚ฌํ•ญ

์„ฑ๋Šฅ ์ œํ•œ์‚ฌํ•ญ

  • 4bit ์–‘์žํ™”๋กœ ์ธํ•œ ๋ฏธ๋ฏธํ•œ ์„ฑ๋Šฅ ์ €ํ•˜ ๊ฐ€๋Šฅ
  • ์›๋ณธ ๋ชจ๋ธ ๋Œ€๋น„ ์ถ”๋ก  ํ’ˆ์งˆ์ด ์•ฝ๊ฐ„ ๊ฐ์†Œํ•  ์ˆ˜ ์žˆ์Œ
  • ๋ณต์žกํ•œ ์•ˆ์ „์„ฑ ํŒ๋‹จ์—์„œ ๋” ํฐ ์˜ํ–ฅ์„ ๋ฐ›์„ ์ˆ˜ ์žˆ์Œ

์‚ฌ์šฉ ๊ถŒ์žฅ์‚ฌํ•ญ

  • GPU ๋ฉ”๋ชจ๋ฆฌ ์ œ์•ฝ์ด ์žˆ๋Š” ํ™˜๊ฒฝ์—์„œ ์‚ฌ์šฉ ๊ถŒ์žฅ
  • ์‹ค์‹œ๊ฐ„ ์•ˆ์ „์„ฑ ๊ฒ€์ฆ์ด ํ•„์š”ํ•œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์— ์ ํ•ฉ
  • ํ”„๋กœ๋•์…˜ ํ™˜๊ฒฝ ์‚ฌ์šฉ ์ „ ์ถฉ๋ถ„ํ•œ ๊ฒ€์ฆ ํ•„์š”

์ฃผ์˜์‚ฌํ•ญ

  • ์ด ๋ชจ๋ธ์€ ์•ˆ์ „์„ฑ ๊ฒ€์ฆ ๋ชฉ์ ์˜ safeguard ๋ชจ๋ธ์ž…๋‹ˆ๋‹ค
  • ์›๋ณธ ๋ชจ๋ธ์˜ ์„ฑ๋Šฅ๊ณผ ์•ˆ์ „์„ฑ ํŠน์„ฑ์„ ์–‘์žํ™” ํ›„์—๋„ ์œ ์ง€ํ•˜๋„๋ก ๋…ธ๋ ฅํ–ˆ์œผ๋‚˜, ์™„์ „ํžˆ ๋™์ผํ•˜์ง€ ์•Š์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค
  • ์ค‘์š”ํ•œ ์•ˆ์ „์„ฑ ํŒ๋‹จ์—๋Š” ์›๋ณธ ๋ชจ๋ธ๊ณผ์˜ ๊ต์ฐจ ๊ฒ€์ฆ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค

์œค๋ฆฌ์  ๊ณ ๋ ค์‚ฌํ•ญ

  • ์›๋ณธ Kakao Corp์˜ safeguard ๋ชจ๋ธ์˜ ์œค๋ฆฌ์  ๊ฐ€์ด๋“œ๋ผ์ธ์„ ์ค€์ˆ˜ํ•ฉ๋‹ˆ๋‹ค
  • ์ด ๋ชจ๋ธ์€ ์œ ํ•ด ์ฝ˜ํ…์ธ  ํƒ์ง€ ๋ฐ ์•ˆ์ „์„ฑ ๊ฒ€์ฆ ๋ชฉ์ ์œผ๋กœ๋งŒ ์‚ฌ์šฉ๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค
  • ์–‘์žํ™”๋กœ ์ธํ•œ ์˜ˆ์ƒ์น˜ ๋ชปํ•œ ํŽธํ–ฅ์ด๋‚˜ ์•ˆ์ „์„ฑ ์ด์Šˆ๊ฐ€ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ ์ฃผ์˜๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค

๋ผ์ด์„ ์Šค

์ด ์–‘์žํ™” ๋ชจ๋ธ์€ ์›๋ณธ ๋ชจ๋ธ๊ณผ ๋™์ผํ•œ Apache License 2.0์„ ๋”ฐ๋ฆ…๋‹ˆ๋‹ค.

Copyright 2025 Kakao Corp. (Original model)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

ํฌ๋ ˆ๋”ง ๋ฐ ์ธ์šฉ

์›๋ณธ ๋ชจ๋ธ ํฌ๋ ˆ๋”ง

@misc{kakao-kanana-safeguard-siren-8b,
  title={Kanana Safeguard Siren 8B},
  author={Kakao Corp},
  year={2024},
  publisher={Hugging Face},
  url={https://huggingface.co/kakaocorp/kanana-safeguard-8b}
}
Downloads last month
11
Safetensors
Model size
4.65B params
Tensor type
F16
ยท
F32
ยท
U8
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for nxtcloud-org/kanana-safeguard-8b-bitsandbytes-4bit

Quantized
(4)
this model

Collection including nxtcloud-org/kanana-safeguard-8b-bitsandbytes-4bit