Kapteyn-500M is a lightweight, general-purpose micro language model based on the LlamaForCausalLM architecture and trained on the Llama2 Group of models. This compact 500M parameter model is designed for simple chats and responses, making it ideal for conversational AI applications where efficiency and quick response times are prioritized over complex reasoning tasks.
Compact & Efficient Architecture Built on the proven LlamaForCausalLM architecture with only 500M parameters, ensuring fast inference and low memory footprint for resource-constrained environments.
General-Purpose Conversational AI Optimized for natural dialogue, casual conversations, and simple Q&A tasks—perfect for chatbots, virtual assistants, and interactive applications.
Llama2-Based Training Leverages the robust foundation of the Llama2 Group of models, inheriting their conversational capabilities while maintaining ultra-lightweight deployment requirements.
Fast Response Generation Designed for quick inference with minimal latency, making it suitable for real-time chat applications and interactive user experiences.
Versatile Deployment Options Runs efficiently on CPUs, entry-level GPUs, mobile devices, and edge computing platforms with minimal resource requirements.
Simple Integration Easy to integrate into existing applications with standard transformer interfaces and minimal setup requirements.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "prithivMLmods/Kapteyn-500M"
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
prompt = "Hello! How are you doing today?"
messages = [
{"role": "system", "content": "You are a helpful and friendly assistant."},
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
generated_ids = model.generate(
**model_inputs,
max_new_tokens=256,
do_sample=True,
temperature=0.7,
top_p=0.9
)
generated_ids = [
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)