Downloads · 30 days
50
2% of all-time downloads
Kirim-ai/Kirim-V1-Base
Kirim-V1-Base is a text generation model from Kirim-ai. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
Downloads · 30 days
50
2% of all-time downloads
All-time downloads
2.1K
Public
Parameters
12.3B
9.6 GB on disk
Likes
3
Public
Click a slice to open those files.
.safetensors9.6 GB · 100%
From the Hugging Face model README
A high-performance bilingual language model optimized for Chinese understanding with English interface
</div>This release of Kirim-V1-Base is designed to deliver exceptional Chinese language understanding while maintaining strong English capabilities. The model addresses several key areas based on community feedback:
The model employs an efficient architecture with Grouped Query Attention (GQA) and YaRN RoPE scaling, enabling superior performance while maintaining computational efficiency. Kirim-V1-Base excels at natural conversations, technical discussions, creative writing, and code generation in both Chinese and English.
First, install the required dependencies:
pip install -r requirements.txt
Or install manually:
pip install torch>=2.0.0 transformers>=4.36.0 accelerate sentencepiece
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load model and tokenizer
model = AutoModelForCausalLM.from_pretrained(
"Kirim-ai/Kirim-V1-base",
torch_dtype="auto",
device_map="auto",
trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained(
"Kirim-ai/Kirim-V1-base",
trust_remote_code=True
)
# Prepare conversation
messages = [
{"role": "system", "content": "You are Kirim, a helpful AI assistant proficient in both Chinese and English."},
{"role": "user", "content": "介绍一下深度学习的基本原理"}
]
# Apply chat template
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
# Tokenize and generate
inputs = tokenizer([text], return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=2048,
temperature=0.7,
top_p=0.9,
top_k=50,
repetition_penalty=1.1,
do_sample=True
)
# Decode response
response = tokenizer.decode(outputs[0][inputs['input_ids'].shape[1]:], skip_special_tokens=True)
print(response)
We provide a convenient inference script for easy interaction:
# Interactive chat mode
python inference.py --model_path Kirim-ai/Kirim-V1-base --chat
# Single prompt generation
python inference.py --prompt "Explain quantum computing in simple terms"
# With 4-bit quantization (requires 12GB+ VRAM)
python inference.py --load_in_4bit --chat
# With 8-bit quantization (requires 16GB+ VRAM)
python inference.py --load_in_8bit --chat
Full Precision (BF16)
model = AutoModelForCausalLM.from_pretrained(
"Kirim-ai/Kirim-V1-base",
torch_dtype=torch.bfloat16,
device_map="auto"
)
8-bit Quantization
model = AutoModelForCausalLM.from_pretrained(
"Kirim-ai/Kirim-V1-base",
load_in_8bit=True,
device_map="auto"
)
4-bit Quantization
model = AutoModelForCausalLM.from_pretrained(
"Kirim-ai/Kirim-V1-base",
load_in_4bit=True,
device_map="auto"
)
The model uses the following chat template format:
<|begin_of_text|><|system|>
{system_message}
<|user|>
{user_message}
<|assistant|>
{assistant_response}
You can customize the system prompt to adjust the model's behavior:
messages = [
{"role": "system", "content": "你是一个专业的Python编程助手,请用中文回答问题。"},
{"role": "user", "content": "如何优化这段代码?"}
]
| Parameter | Value |
|---|---|
| Model Type | Causal Language Model |
| Architecture | Decoder-only Transformer |
| Hidden Size | 4096 |
| Layers | 32 |
| Attention Heads | 32 |
| KV Heads | 8 (Grouped Query Attention) |
| Vocabulary Size | 102,400 |
| Context Length | 32,768 tokens |
| Activation Function | SiLU |
| Position Encoding | RoPE with YaRN scaling (factor: 2.0) |
| Normalization | RMSNorm (eps: 1e-6) |
| Precision | BFloat16 |
| Total Parameters | ~13B |
This model is released under the Apache License 2.0. See LICENSE for full details.
You are free to:
With the following conditions:
If you use Kirim-V1-Base in your research or applications, please cite:
@misc{kirim2025v1base,
title={Kirim-V1-Base: A High-Performance Bilingual Language Model},
author={Kirim AI Team},
year={2025},
url={https://huggingface.co/Kirim-ai/Kirim-V1}
}