Text Generation
Transformers
Safetensors
English
Hindi
Sanskrit
llama
ayurveda
medical
biology
llama-3.2
conversational
Eval Results (legacy)
text-generation-inference
Instructions to use Vivekdas/VaidhLLaMA-3.2-3B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Vivekdas/VaidhLLaMA-3.2-3B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Vivekdas/VaidhLLaMA-3.2-3B-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Vivekdas/VaidhLLaMA-3.2-3B-Instruct") model = AutoModelForCausalLM.from_pretrained("Vivekdas/VaidhLLaMA-3.2-3B-Instruct") 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 Vivekdas/VaidhLLaMA-3.2-3B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Vivekdas/VaidhLLaMA-3.2-3B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Vivekdas/VaidhLLaMA-3.2-3B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Vivekdas/VaidhLLaMA-3.2-3B-Instruct
- SGLang
How to use Vivekdas/VaidhLLaMA-3.2-3B-Instruct 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 "Vivekdas/VaidhLLaMA-3.2-3B-Instruct" \ --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": "Vivekdas/VaidhLLaMA-3.2-3B-Instruct", "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 "Vivekdas/VaidhLLaMA-3.2-3B-Instruct" \ --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": "Vivekdas/VaidhLLaMA-3.2-3B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Vivekdas/VaidhLLaMA-3.2-3B-Instruct with Docker Model Runner:
docker model run hf.co/Vivekdas/VaidhLLaMA-3.2-3B-Instruct
| language: | |
| - en | |
| - hi | |
| - sa | |
| license: llama3.2 | |
| library_name: transformers | |
| tags: | |
| - ayurveda | |
| - medical | |
| - biology | |
| - llama-3.2 | |
| - text-generation | |
| base_model: meta-llama/Llama-3.2-3B-Instruct | |
| pipeline_tag: text-generation | |
| model-index: | |
| - name: VaidhLLaMA-3.2-3B-Instruct | |
| results: | |
| - task: | |
| type: text-generation | |
| name: Text Generation | |
| dataset: | |
| name: BhashaBench-Ayur | |
| type: evaluation-suite | |
| metrics: | |
| - name: Accuracy (Zero-Shot) | |
| type: accuracy | |
| value: 41.91 | |
| verified: false | |
| # VaidhLLaMA-3.2-3B-Instruct | |
| **VaidhLLaMA-3.2-3B-Instruct** is a specialized Large Language Model fine-tuned for the domain of **Ayurveda**. It is built upon the Llama-3.2-3B-Instruct architecture and has been optimized to understand and reason with Ayurvedic concepts, physiology (*Sharir Kriya*), and clinical applications. | |
| ## Model Details | |
| * **Model Name:** VaidhLLaMA-3.2-3B-Instruct | |
| * **Base Model:** [meta-llama/Llama-3.2-3B-Instruct](https://huggingface.co/meta-llama/Llama-3.2-3B-Instruct) | |
| * **Developed By:** Vivekdas | |
| * **Language:** English, Hindi, Sanskrit (Domain-specific terminology) | |
| * **License:** Llama 3.2 Community License | |
| * **Architecture:** Transformer-based Auto-Regressive Language Model | |
| ## Performance | |
| VaidhLLaMA demonstrates strong performance on the **BhashaBench-Ayur** benchmark, outperforming its base model and other similarly sized models in domain-specific tasks. | |
| | Model | Accuracy (%) | Note | | |
| | :--- | :--- | :--- | | |
| | **VaidhLLaMA-3.2-3B** | **41.91%** | **Fine-tuned Ayurveda Specialist** | | |
| | Llama-3.2-3B-Instruct | 40.74% | Base Model | | |
| | Llama-3.2-1B | 27.58% | Tiny Model | | |
| ## Intended Use | |
| This model is designed for: | |
| * Answering questions related to Ayurvedic medical science. | |
| * Explaining concepts from classical Ayurvedic texts (*Samhitas*). | |
| * Assisting researchers and students in the field of Ayurveda. | |
| **Disclaimer:** This model is for **educational and research purposes only**. It should not be used as a substitute for professional medical advice, diagnosis, or treatment. | |
| ## Usage | |
| You can run this model using the `transformers` library: | |
| ```python | |
| import torch | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| model_id = "Vivekdas/VaidhLLaMA-3.2-3B-Instruct" | |
| tokenizer = AutoTokenizer.from_pretrained(model_id) | |
| model = AutoModelForCausalLM.from_pretrained( | |
| model_id, | |
| torch_dtype=torch.bfloat16, | |
| device_map="auto" | |
| ) | |
| messages = [ | |
| {"role": "system", "content": "You are VaidhLLaMA, an expert AI assistant for Ayurveda."}, | |
| {"role": "user", "content": "Explain the concept of Tridosha in Ayurveda."} | |
| ] | |
| input_ids = tokenizer.apply_chat_template( | |
| messages, | |
| add_generation_prompt=True, | |
| return_tensors="pt" | |
| ).to(model.device) | |
| outputs = model.generate( | |
| input_ids, | |
| max_new_tokens=512, | |
| do_sample=True, | |
| temperature=0.6, | |
| top_p=0.9 | |
| ) | |
| response = tokenizer.decode(outputs[0][input_ids.shape[-1]:], skip_special_tokens=True) | |
| print(response) | |
| ``` | |
| ## Citation | |
| If you use this model in your research, please cite: | |
| ```bibtex | |
| @misc{vaidhllama2024, | |
| author = {Vivekdas}, | |
| title = {VaidhLLaMA: A Fine-Tuned LLM for Ayurveda}, | |
| year = {2024}, | |
| publisher = {Hugging Face}, | |
| journal = {Hugging Face Repository}, | |
| howpublished = {\url{https://huggingface.co/Vivekdas/VaidhLLaMA-3.2-3B-Instruct}} | |
| } | |
| ``` | |