# (Legacy) Serverless Hosted API

{% hint style="info" %}
हम **सिफ़ारिश करते हैं** कि हमारे Serverless Hosted API के V2 का उपयोग करें। V2 API तेज़ है।\
\
[नई API के साथ शुरुआत करने के लिए Serverless Hosted API V2 के दस्तावेज़ देखें।](/roboflow/roboflow-hi/deploy/serverless-hosted-api-v2.md)
{% endhint %}

## Model Support

{% hint style="warning" %}
नए मॉडल आर्किटेक्चर (जैसे Florence-2, SAM 3, और अन्य) केवल Serverless Hosted API V2 पर उपलब्ध हैं। Legacy workspaces जिन्होंने credit-based plan में migrate नहीं किया है, उन्हें एक `402` इन मॉडलों का उपयोग करने का प्रयास करते समय error मिलेगा। [अपना plan अपग्रेड करें](/roboflow/roboflow-hi/billing/plans/purchase-a-plan.md) ताकि आप के माध्यम से समर्थित मॉडलों के पूरे सेट तक पहुँच सकें [Serverless Hosted API V2](/roboflow/roboflow-hi/deploy/serverless-hosted-api-v2.md).
{% endhint %}

निम्नलिखित model types को Serverless Hosted API (v1) द्वारा support किया जाता है:

| Task Type                                                                                                       | Hosted API (v1) द्वारा समर्थित |
| --------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| [Object Detection](/roboflow/roboflow-hi/deploy/serverless/object-detection.md)                                 | ✅                              |
| [Classification](/roboflow/roboflow-hi/deploy/serverless/classification.md)                                     | ✅                              |
| [Instance Segmentation](/roboflow/roboflow-hi/deploy/serverless/instance-segmentation.md)                       | ✅                              |
| [Semantic Segmentation](/roboflow/roboflow-hi/deploy/serverless/instance-segmentation/semantic-segmentation.md) | ✅                              |
| [Keypoint Detection](/roboflow/roboflow-hi/deploy/serverless/keypoint-detection.md)                             | ✅                              |

## Latency comparison (v1 vs v2)

Serverless Hosted API पर भेजे गए requests की end-to-end latency कई कारकों पर निर्भर करती है:

1. Model architecture, जिसका execution time पर प्रभाव पड़ता है
2. Images का size और resolution, जो upload time और execution के दौरान model inference time को प्रभावित करते हैं
3. Network latency और bandwidth, जो request upload time और response download time को प्रभावित करती है।
4. Service subscription और किसी भी विशिष्ट समय पर अन्य users द्वारा उपयोग, जिसके परिणामस्वरूप queueing latency हो सकती है

<figure><img src="/files/9ecda490ba5d9f82b4de821c04b5f68183cd0ab1" alt=""><figcaption></figcaption></figure>

नीचे दी गई तालिका में हम v1 बनाम v2 Serverless Hosted API के कुछ प्रतिनिधि benchmarks दिखाते हैं। इसमें end-to-end latency (E2E) के साथ-साथ execution time (Exec) भी दिखाया गया है। ये संख्याएँ केवल जानकारी के लिए हैं; हम users को प्रोत्साहित करते हैं कि वे अपने स्वयं के benchmarks का उपयोग करके अपना परीक्षण करें [हमारे inference benchmark tools](https://inference.roboflow.com/inference_helpers/cli_commands/benchmark/) या अपने स्वयं के custom benchmarks।

<table><thead><tr><th width="176.14410400390625">Model</th><th>V2 (E2E)</th><th>V2 (Exec)</th><th>V1 (E2E)</th><th>V1 (Exec)</th></tr></thead><tbody><tr><td>yolov8x-640</td><td>401 ms</td><td>29 ms</td><td>4084 ms</td><td>821 ms</td></tr><tr><td>yolov8m-640</td><td>757 ms</td><td>21 ms</td><td>572 ms</td><td>265 ms</td></tr><tr><td>yolov8n-640</td><td>384 ms</td><td>17 ms</td><td>312 ms</td><td>63 ms</td></tr><tr><td>yolov8x-1280</td><td>483 ms</td><td>97 ms</td><td>6431 ms</td><td>3032 ms</td></tr><tr><td>yolov8m-1280</td><td>416 ms</td><td>52 ms</td><td>1841 ms</td><td>1006 ms</td></tr><tr><td>yolov8n-1280</td><td>428 ms</td><td>35 ms</td><td>464 ms</td><td>157 ms</td></tr></tbody></table>

हम users को प्रोत्साहित करते हैं कि वे अपने model inferences और workflows के लिए अपने स्वयं के benchmarks चलाएँ, ताकि अपने विशिष्ट usecases के लिए वास्तविक metrics प्राप्त कर सकें।

## Limits

Serverless Hosted API (v1), विशिष्ट task type की परवाह किए बिना, 5MB तक की files स्वीकार करता है। इस limit में image file size के साथ-साथ संलग्न किसी भी request information को भी शामिल किया जाता है, लेकिन यह इन्हीं तक सीमित नहीं है।

{% hint style="info" %}
जिन मामलों में requests बहुत बड़ी होती हैं, हम संलग्न images का size कम करने की सिफ़ारिश करते हैं। इससे आमतौर पर performance खराब नहीं होगी, क्योंकि images हमारे servers पर प्राप्त होने के बाद वैसे भी model architecture द्वारा स्वीकार किए जाने वाले input size तक downsized कर दी जाती हैं.\
\
हमारे कुछ SDKs, जैसे Python SDK, API को भेजने से पहले images को model architecture के input size तक automatically downsized कर देते हैं।
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.roboflow.com/roboflow/roboflow-hi/deploy/serverless.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
