Image-Text-to-Text
Transformers
Joblib
Safetensors
nemotron_parse
text-generation
document-parsing
ocr
tables
charts
ground-truth-sft
grpo
verifiable-rewards
routed-refinement
thrisul
conversational
custom_code
Instructions to use sandeeprdy1729/thrisul-parser with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sandeeprdy1729/thrisul-parser with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="sandeeprdy1729/thrisul-parser", trust_remote_code=True) 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("sandeeprdy1729/thrisul-parser", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sandeeprdy1729/thrisul-parser with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sandeeprdy1729/thrisul-parser" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sandeeprdy1729/thrisul-parser", "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/sandeeprdy1729/thrisul-parser
- SGLang
How to use sandeeprdy1729/thrisul-parser 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 "sandeeprdy1729/thrisul-parser" \ --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": "sandeeprdy1729/thrisul-parser", "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 "sandeeprdy1729/thrisul-parser" \ --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": "sandeeprdy1729/thrisul-parser", "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 sandeeprdy1729/thrisul-parser with Docker Model Runner:
docker model run hf.co/sandeeprdy1729/thrisul-parser
File size: 3,295 Bytes
37fb2b9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: OpenMDW-1.1
"""vLLM general-plugin entry point for Nemotron 3.5 Parse.
Installing this repository registers the target visual-prefix model and its
one-step MTP proposer in every vLLM process. This replaces the implicit
``sitecustomize``/``PYTHONPATH`` startup hook with vLLM's documented plugin
lifecycle while preserving the validated vLLM 0.26 compatibility patches.
"""
from __future__ import annotations
from importlib.metadata import PackageNotFoundError, version
from packaging.specifiers import SpecifierSet
_SUPPORTED_RUNTIME = {
"vllm": ">=0.25.0,<0.33",
"transformers": ">=5.14.1,<5.20",
"huggingface-hub": ">=1.24.0,<2",
}
def _validate_runtime_versions() -> None:
"""Reject unsupported serving versions before applying internal hooks."""
mismatches = []
for package, expected in _SUPPORTED_RUNTIME.items():
try:
actual = version(package)
except PackageNotFoundError:
actual = "not installed"
if actual == "not installed" or not SpecifierSet(expected).contains(actual, prereleases=False):
mismatches.append(f"{package}=={actual} (requires {expected})")
if mismatches:
raise RuntimeError(
"Nemotron 3.5 Parse vLLM plugin requires a supported runtime: "
+ ", ".join(f"{name}{value}" for name, value in _SUPPORTED_RUNTIME.items())
+ ". Found: "
+ ", ".join(mismatches)
)
def _register_mtp() -> None:
from vllm.config.speculative import SpeculativeConfig
from vllm.model_executor.models import ModelRegistry
if "ParseAuxMTPModel" not in ModelRegistry.get_supported_archs():
ModelRegistry.register_model(
"ParseAuxMTPModel",
"vllm_tied_patch.vllm_radio_mbart_mtp:ParseAuxMTPModel",
)
original_override = SpeculativeConfig.hf_config_override
if getattr(original_override, "_np_parse_aux_mtp", False):
return
def parse_mtp_override(hf_config):
architectures = getattr(hf_config, "architectures", []) or []
if "RadioMBartPrefixForCausalLM" in architectures:
hf_config.model_type = "mtp"
hf_config.update(
{
"architectures": ["ParseAuxMTPModel"],
"n_predict": 1,
"num_nextn_predict_layers": 1,
}
)
return hf_config
return original_override(hf_config)
parse_mtp_override._np_parse_aux_mtp = True
SpeculativeConfig.hf_config_override = staticmethod(parse_mtp_override)
def register() -> None:
"""Register 3.5 Parse target and draft models in the current process."""
_validate_runtime_versions()
# Importing the compatibility module applies the pinned vLLM 0.26 SO400M,
# NaViT, GQA, target-model registration, and optional FA3 compatibility
# hooks. Unlike top-level sitecustomize discovery, this is invoked by
# vLLM's explicit general-plugin loader in every process.
from . import compatibility as _compat # noqa: F401
_register_mtp()
from .defaults import register_serving_defaults
register_serving_defaults()
|