Image-Text-to-Text
Transformers
English
vision-language-model
vlm
surveillance
iot
gemma
vl-jepa
multimodal
object-detection
video-analytics
Instructions to use hardiksa/arcisvlm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hardiksa/arcisvlm with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="hardiksa/arcisvlm")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("hardiksa/arcisvlm", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use hardiksa/arcisvlm with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "hardiksa/arcisvlm" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hardiksa/arcisvlm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/hardiksa/arcisvlm
- SGLang
How to use hardiksa/arcisvlm 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 "hardiksa/arcisvlm" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hardiksa/arcisvlm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "hardiksa/arcisvlm" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hardiksa/arcisvlm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use hardiksa/arcisvlm with Docker Model Runner:
docker model run hf.co/hardiksa/arcisvlm
| """ | |
| ArcisVLM API — FastAPI application entry point. | |
| Start with: | |
| uvicorn api.main:app --host 0.0.0.0 --port 8000 --reload | |
| For production: | |
| uvicorn api.main:app --host 0.0.0.0 --port 8000 --workers 1 | |
| Note: --workers 1 because the model is loaded in-process. For multi-worker, | |
| use a separate model server with gRPC. | |
| """ | |
| from __future__ import annotations | |
| import os | |
| import logging | |
| from contextlib import asynccontextmanager | |
| from fastapi import FastAPI, WebSocket | |
| from fastapi.middleware.cors import CORSMiddleware | |
| from api.models import HealthResponse | |
| from api.deps import get_model_manager, configure_model_manager | |
| logger = logging.getLogger(__name__) | |
| # Configure logging | |
| logging.basicConfig( | |
| level=logging.INFO, | |
| format="%(asctime)s %(levelname)s %(name)s: %(message)s", | |
| ) | |
| async def lifespan(app: FastAPI): | |
| """Initialize model and agents on startup, clean up on shutdown.""" | |
| # Allow override via env vars | |
| config_path = os.environ.get("ARCISVLM_CONFIG", "configs/scale_1.3b.yaml") | |
| checkpoint_path = os.environ.get("ARCISVLM_CHECKPOINT", None) | |
| device = os.environ.get("ARCISVLM_DEVICE", "cpu") | |
| manager = configure_model_manager( | |
| config_path=config_path, | |
| checkpoint_path=checkpoint_path, | |
| device=device, | |
| ) | |
| # Don't block startup if model fails to load — allow health checks to report status | |
| try: | |
| manager.initialize() | |
| except Exception as e: | |
| logger.error("Model initialization failed: %s", e) | |
| logger.info("ArcisVLM API started (model_loaded=%s)", manager.model is not None) | |
| yield | |
| manager.shutdown() | |
| logger.info("ArcisVLM API shutdown") | |
| app = FastAPI( | |
| title="ArcisVLM API", | |
| description="Agentic Vision-Language Model for real-time video analytics. " | |
| "VL-JEPA + MoE architecture with 8 expert agents for VQA, detection, " | |
| "alerting, counting, OCR, and reasoning across 1000+ IP cameras.", | |
| version="1.0.0", | |
| lifespan=lifespan, | |
| ) | |
| # CORS — allow dashboard and external clients | |
| app.add_middleware( | |
| CORSMiddleware, | |
| allow_origins=["*"], # Tighten in production | |
| allow_credentials=True, | |
| allow_methods=["*"], | |
| allow_headers=["*"], | |
| ) | |
| # --------------------------------------------------------------------------- | |
| # Health check (top-level, no prefix) | |
| # --------------------------------------------------------------------------- | |
| async def health(): | |
| """Health check — returns model and agent status.""" | |
| manager = get_model_manager() | |
| return HealthResponse( | |
| status="ok" if manager.is_initialized else "starting", | |
| model_loaded=manager.model is not None, | |
| agents_ready=manager.orchestrator is not None, | |
| ) | |
| # --------------------------------------------------------------------------- | |
| # Include route modules | |
| # --------------------------------------------------------------------------- | |
| from api.routes import inference, agents, alerts, streams, metrics # noqa: E402 | |
| app.include_router(inference.router, prefix="/api/v1") | |
| app.include_router(agents.router, prefix="/api/v1") | |
| app.include_router(alerts.router, prefix="/api/v1") | |
| app.include_router(streams.router, prefix="/api/v1") | |
| app.include_router(metrics.router, prefix="/api/v1") | |
| # --------------------------------------------------------------------------- | |
| # WebSocket endpoints | |
| # --------------------------------------------------------------------------- | |
| from api.ws import feed_websocket, chat_websocket # noqa: E402 | |
| async def ws_feed(ws: WebSocket, camera_id: str): | |
| """Live detection results stream for a camera.""" | |
| await feed_websocket(ws, camera_id) | |
| async def ws_chat(ws: WebSocket): | |
| """Interactive VQA chat.""" | |
| await chat_websocket(ws) | |