Instructions to use prithivMLmods/Calcium-Opus-20B-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/Calcium-Opus-20B-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="prithivMLmods/Calcium-Opus-20B-v1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("prithivMLmods/Calcium-Opus-20B-v1") model = AutoModelForCausalLM.from_pretrained("prithivMLmods/Calcium-Opus-20B-v1") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use prithivMLmods/Calcium-Opus-20B-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/Calcium-Opus-20B-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/Calcium-Opus-20B-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/prithivMLmods/Calcium-Opus-20B-v1
- SGLang
How to use prithivMLmods/Calcium-Opus-20B-v1 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 "prithivMLmods/Calcium-Opus-20B-v1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/Calcium-Opus-20B-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "prithivMLmods/Calcium-Opus-20B-v1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/Calcium-Opus-20B-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use prithivMLmods/Calcium-Opus-20B-v1 with Docker Model Runner:
docker model run hf.co/prithivMLmods/Calcium-Opus-20B-v1
Calcium-Opus-20B-v1
Calcium-Opus-20B-v1 is based on the Qwen 2.5 modality architecture, designed to enrich the reasoning capabilities of 20B-parameter models. These models have proven highly effective for context understanding, reasoning, and mathematical problem-solving.
Key improvements include:
- Enhanced Knowledge and Expertise: The model demonstrates significantly more knowledge and greatly improved capabilities in coding and mathematics, thanks to specialized expert models in these domains.
- Improved Instruction Following: It shows significant advancements in following instructions, generating long texts (over 8K tokens), understanding structured data (e.g., tables), and producing structured outputs, especially in JSON format.
- Better Adaptability: The model is more resilient to diverse system prompts, enabling enhanced role-playing implementations and condition-setting for chatbots.
- Long-Context Support: It offers long-context support of up to 128K tokens and can generate up to 8K tokens in a single output.
- Multilingual Proficiency: The model supports over 29 languages, including Chinese, English, French, Spanish, Portuguese, German, Italian, Russian, Japanese, Korean, Vietnamese, Thai, Arabic, and more.
Quickstart with Transformers
Here provides a code snippet with apply_chat_template to show you how to load the tokenizer and model and how to generate contents.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "prithivMLmods/Calcium-Opus-20B-v1"
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
prompt = "Give me a short introduction to large language model."
messages = [
{"role": "system", "content": "You are Qwen, created by Alibaba Cloud. You are a helpful 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=512
)
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]
Intended Use
Reasoning and Context Understanding:
Designed to assist with complex reasoning tasks, contextual understanding, and solving problems requiring logical deduction and critical thinking.Mathematical Problem-Solving:
Specialized for performing advanced mathematical reasoning and calculations, making it suitable for educational, scientific, and research-oriented applications.Code Generation and Debugging:
Offers robust support for coding tasks, including writing, debugging, and optimizing code in various programming languages, ideal for developers and software engineers.Structured Data Analysis:
Excels in processing and analyzing structured data, such as tables and JSON, and generating structured outputs, which is useful for data analysts and automation workflows.Multilingual Applications:
Supports over 29 languages, making it versatile for global applications like multilingual chatbots, content generation, and translations.Extended Content Generation:
Capable of generating long-form content (over 8K tokens), useful for writing reports, articles, and creating detailed instructional guides.Interactive Role-Playing and Chatbots:
Enhanced capabilities for role-playing and condition-setting, making it ideal for interactive chatbots, virtual assistants, and entertainment purposes.Large-Context Tasks:
With a context window of up to 128K tokens, it is ideal for analyzing or generating large documents, books, or datasets in a single session.
Limitations
Hardware Requirements:
Due to its 20B parameter size and support for long-context inputs, running the model requires significant computational resources, including high-memory GPUs or TPUs.Potential Bias in Multilingual Outputs:
While it supports 29 languages, the quality and accuracy of outputs may vary depending on the language, especially for less-resourced languages.Inconsistent Outputs for Creative Tasks:
The model may occasionally produce inconsistent or repetitive results in creative writing, storytelling, or highly subjective tasks.Limited Real-World Awareness:
It lacks real-time knowledge of current events beyond its training cutoff, which may limit its ability to respond accurately to the latest information.Error Propagation in Long-Text Outputs:
In generating long texts, minor errors in early outputs can sometimes propagate, reducing the overall coherence and accuracy of the response.Dependency on High-Quality Prompts:
Performance may depend on the quality and specificity of the input prompt, requiring users to carefully design queries for optimal results.Sensitivity to Adversarial Inputs:
The model may struggle with adversarial or ambiguous inputs, leading to incorrect or irrelevant outputs.Ethical and Safety Concerns:
Potential misuse in generating misleading, harmful, or offensive content remains a concern, and guardrails must be implemented to ensure responsible use.
Open LLM Leaderboard Evaluation Results
Detailed results can be found here! Summarized results can be found here!
| Metric | Value (%) |
|---|---|
| Average | 26.85 |
| IFEval (0-Shot) | 30.93 |
| BBH (3-Shot) | 41.81 |
| MATH Lvl 5 (4-Shot) | 11.03 |
| GPQA (0-shot) | 13.76 |
| MuSR (0-shot) | 22.09 |
| MMLU-PRO (5-shot) | 41.49 |
- Downloads last month
- 12
Model tree for prithivMLmods/Calcium-Opus-20B-v1
Collection including prithivMLmods/Calcium-Opus-20B-v1
Evaluation results
- averaged accuracy on IFEval (0-Shot)Open LLM Leaderboard30.930
- normalized accuracy on BBH (3-Shot)test set Open LLM Leaderboard41.810
- exact match on MATH Lvl 5 (4-Shot)test set Open LLM Leaderboard11.030
- acc_norm on GPQA (0-shot)Open LLM Leaderboard13.760
- acc_norm on MuSR (0-shot)Open LLM Leaderboard22.090
- accuracy on MMLU-PRO (5-shot)test set Open LLM Leaderboard41.490
