Instructions to use Veda-Labs/Vedika-Vyom-31B-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Veda-Labs/Vedika-Vyom-31B-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Veda-Labs/Vedika-Vyom-31B-v2") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoModelForSeq2SeqLM model = AutoModelForSeq2SeqLM.from_pretrained("Veda-Labs/Vedika-Vyom-31B-v2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Veda-Labs/Vedika-Vyom-31B-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Veda-Labs/Vedika-Vyom-31B-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Veda-Labs/Vedika-Vyom-31B-v2", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/Veda-Labs/Vedika-Vyom-31B-v2
- SGLang
How to use Veda-Labs/Vedika-Vyom-31B-v2 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 "Veda-Labs/Vedika-Vyom-31B-v2" \ --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": "Veda-Labs/Vedika-Vyom-31B-v2", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "Veda-Labs/Vedika-Vyom-31B-v2" \ --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": "Veda-Labs/Vedika-Vyom-31B-v2", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use Veda-Labs/Vedika-Vyom-31B-v2 with Docker Model Runner:
docker model run hf.co/Veda-Labs/Vedika-Vyom-31B-v2
Vedika-Vyom-31B-v2
A powerful multimodal AI model developed by Veda Labs in India.
Hugging Face |
GitHub |
Website |
X (Twitter)
License: Apache 2.0 | Developed by: Veda Labs
Overview
Vedika-Vyom-31B-v2 is a state-of-the-art multimodal AI model developed by Veda Labs in India. This model is capable of handling text and image inputs, generating high-quality text outputs with advanced reasoning capabilities. Built on a robust architecture, Vedika-Vyom-31B-v2 delivers exceptional performance across a wide range of tasks including text generation, coding, reasoning, and multimodal understanding.
Key Features
- Advanced Reasoning – Configurable thinking modes for complex problem-solving and step-by-step reasoning.
- Multimodal Capabilities – Processes text and images with variable aspect ratio and resolution support.
- Extended Context Window – Supports up to 256K tokens for deep context understanding.
- Multilingual Support – Capable of understanding and generating content in over 140 languages.
- Optimized Architecture – Hybrid attention mechanism with sliding window and full global attention layers.
- Function Calling – Native support for structured tool use and agentic workflows.
- Code Generation – Advanced capabilities for code generation, completion, and debugging.
Model Specifications
| Property | Value |
|---|---|
| Model Name | Vedika-Vyom-31B-v2 |
| Total Parameters | 30.7B |
| Architecture | Dense Transformer with Hybrid Attention |
| Layers | 60 |
| Sliding Window | 1024 tokens |
| Context Length | 256K tokens |
| Vocabulary Size | 262K |
| Supported Modalities | Text, Image |
| Vision Encoder | ~550M parameters |
Core Capabilities
Vedika-Vyom-31B-v2 handles a broad range of tasks across text and vision:
- Thinking Mode – Built-in reasoning mode that enables step-by-step thinking before answering.
- Long Context Understanding – Process documents and conversations up to 256K tokens.
- Image Understanding – Object detection, document/PDF parsing, chart comprehension, OCR (including multilingual), and handwriting recognition.
- Interleaved Multimodal Input – Freely mix text and images in any order within a single prompt.
- Function Calling – Native support for structured tool use, enabling autonomous agent workflows.
- Coding – Code generation, completion, debugging, and explanation.
- Multilingual – Support for 35+ languages out-of-the-box, pre-trained on 140+ languages.
Getting Started
Installation
To use Vedika-Vyom-31B-v2, install the required dependencies:
pip install -U transformers torch accelerate
Basic Usage
Loading the Model
from transformers import AutoProcessor, AutoModelForMultimodalLM
MODEL_ID = "vedalabs-tech/Vedika-Vyom-31B-v2"
# Load model and processor
processor = AutoProcessor.from_pretrained(MODEL_ID)
model = AutoModelForMultimodalLM.from_pretrained(
MODEL_ID,
dtype="auto",
device_map="auto"
)
Text Generation
# Create conversation messages
messages = [
{"role": "system", "content": "You are Vedika-Vyom-31B-v2, an AI developed by Veda Labs in India."},
{"role": "user", "content": "Write a short joke about programming."},
]
# Process input
inputs = processor.apply_chat_template(
messages,
tokenize=True,
return_dict=True,
return_tensors="pt",
add_generation_prompt=True,
enable_thinking=False
).to(model.device)
input_len = inputs["input_ids"].shape[-1]
# Generate output
outputs = model.generate(**inputs, max_new_tokens=1024)
response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)
# Parse and print response
parsed = processor.parse_response(response, prefix=inputs["input_ids"])
print(parsed)
Enabling Thinking Mode
To enable reasoning/thinking mode, set enable_thinking=True:
inputs = processor.apply_chat_template(
messages,
tokenize=True,
return_dict=True,
return_tensors="pt",
add_generation_prompt=True,
enable_thinking=True # Enable thinking mode
).to(model.device)
Image Processing
from transformers import AutoProcessor, AutoModelForMultimodalLM
MODEL_ID = "vedalabs-tech/Vedika-Vyom-31B-v2"
# Load model
processor = AutoProcessor.from_pretrained(MODEL_ID)
model = AutoModelForMultimodalLM.from_pretrained(
MODEL_ID,
dtype="auto",
device_map="auto"
)
# Prompt with image
messages = [
{
"role": "user",
"content": [
{"type": "image", "url": "https://example.com/image.png"},
{"type": "text", "text": "What is shown in this image?"}
]
}
]
# Process input
inputs = processor.apply_chat_template(
messages,
tokenize=True,
return_dict=True,
return_tensors="pt",
add_generation_prompt=True,
).to(model.device)
input_len = inputs["input_ids"].shape[-1]
# Generate output
outputs = model.generate(**inputs, max_new_tokens=512)
response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)
# Parse output
processor.parse_response(response, prefix=inputs["input_ids"])
Video Processing
from transformers import AutoProcessor, AutoModelForMultimodalLM
MODEL_ID = "vedalabs-tech/Vedika-Vyom-31B-v2"
# Load model
processor = AutoProcessor.from_pretrained(MODEL_ID)
model = AutoModelForMultimodalLM.from_pretrained(
MODEL_ID,
dtype="auto",
device_map="auto"
)
# Prompt with video
messages = [
{
'role': 'user',
'content': [
{"type": "video", "video": "https://example.com/video.mp4"},
{'type': 'text', 'text': 'Describe this video.'}
]
}
]
# Process input
inputs = processor.apply_chat_template(
messages,
tokenize=True,
return_dict=True,
return_tensors="pt",
add_generation_prompt=True,
).to(model.device)
input_len = inputs["input_ids"].shape[-1]
# Generate output
outputs = model.generate(**inputs, max_new_tokens=512)
response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)
# Parse output
processor.parse_response(response, prefix=inputs["input_ids"])
Best Practices
Sampling Parameters
For optimal performance, use the following sampling configuration:
temperature=1.0top_p=0.95top_k=64
Thinking Mode Configuration
Control the thinking process using these tokens:
- Enable Thinking: Include the
<|think|>token at the start of the system prompt. - Disable Thinking: Remove the
<|think|>token from the prompt.
When thinking is enabled, the model outputs internal reasoning followed by the final answer:
<|channel>thought
[Internal reasoning steps]
<channel|>[Final answer]
Image Resolution Control
Vedika-Vyom-31B-v2 supports variable image resolution through configurable visual token budgets:
- Higher token budget: Preserves more visual detail (slower inference)
- Lower token budget: Faster inference for simpler tasks
System Prompt Identity
The model is configured with a concise system prompt to maintain its identity:
You are Vedika-Vyom-31B-v2, an AI developed by Veda Labs in India.
This ensures the model maintains consistent identity without hallucinating previous identities.
Safety & Responsibility
Vedika-Vyom-31B-v2 was developed with safety as a priority. The model undergoes rigorous evaluations to prevent harmful content generation, including:
- Hate speech and harassment prevention
- Sexually explicit content filtering
- Dangerous content mitigation
- Medical misinformation reduction
- PII (Personally Identifiable Information) protection
Connect with Us
Stay connected with Veda Labs and explore more of our work:
| Platform | Link |
|---|---|
| Website | vedalabs.online |
| Hugging Face | vedalabs-tech |
| GitHub | vedalabs-tech |
| X (Twitter) | VedaLabsAI |
| vedalabs.veda@gmail.com |
Citation
If you use Vedika-Vyom-31B-v2 in your research, please cite:
@misc{vedalabs2024vedikavyom,
title={Vedika-Vyom-31B-v2: A Multimodal AI Model},
author={Veda Labs AI Team},
year={2024},
publisher={Veda Labs}
}
License
This model is released under the Apache 2.0 License. See the LICENSE file for details.
© 2024 Veda Labs. All rights reserved. | Developed in India 🇮🇳
- Downloads last month
- -