| from __future__ import annotations | |
| from pathlib import Path | |
| import httpx | |
| from app.config import Settings | |
| from backends.base import OCRResult | |
| from backends.openai_compat import OpenAICompatEmbed, OpenAICompatLLM | |
| class NvidiaLLM(OpenAICompatLLM): | |
| """vLLM Qwen3.8-27B ADay777 (or other NVIDIA VLM). Thinking off.""" | |
| def __init__(self, settings: Settings, *, client: httpx.Client | None = None) -> None: | |
| super().__init__( | |
| settings, | |
| name="nvidia-vllm", | |
| accepts_images=settings.llm_accepts_images, | |
| extra_body={"chat_template_kwargs": {"enable_thinking": False}}, | |
| client=client, | |
| ) | |
| class NvidiaEmbed(OpenAICompatEmbed): | |
| def __init__(self, settings: Settings, *, client: httpx.Client | None = None) -> None: | |
| super().__init__(settings, name="nemotron-embed", client=client) | |
| class NvidiaOCR: | |
| name = "nvidia-ocr" | |
| def ocr(self, path: Path) -> OCRResult: | |
| raise NotImplementedError( | |
| "Nemotron OCR v2 is not in this skill. Use Gemma/Qwen vision extract " | |
| f"(path={path})." | |
| ) | |