# (Legacy) Serverless Hosted API

{% hint style="info" %}
저희는 **권장합니다** Serverless Hosted API의 V2를 사용하는 것을 권장합니다. V2 API가 더 빠릅니다.\
\
[새 API를 시작하려면 Serverless Hosted API V2 문서를 참고하세요.](https://docs.roboflow.com/roboflow/roboflow-ko/deploy/serverless-hosted-api-v2)
{% endhint %}

## 모델 지원

다음 모델 유형은 Serverless Hosted API (v1)에서 지원됩니다:

| 작업 유형                                                                                                                   | Hosted API (v1)에서 지원됨 |
| ----------------------------------------------------------------------------------------------------------------------- | --------------------- |
| [Object Detection](https://docs.roboflow.com/roboflow/roboflow-ko/deploy/serverless/object-detection)                   | ✅                     |
| [분류](https://docs.roboflow.com/roboflow/roboflow-ko/deploy/serverless/classification)                                   | ✅                     |
| [인스턴스 세분화](https://docs.roboflow.com/roboflow/roboflow-ko/deploy/serverless/instance-segmentation)                      | ✅                     |
| [시맨틱 세분화](https://docs.roboflow.com/roboflow/roboflow-ko/deploy/serverless/instance-segmentation/semantic-segmentation) | ✅                     |
| [Keypoint Detection](https://docs.roboflow.com/roboflow/roboflow-ko/deploy/serverless/keypoint-detection)               | ✅                     |

## 지연 시간 비교 (v1 vs v2)

Serverless Hosted API로 전송된 요청의 엔드투엔드 지연 시간은 여러 요인에 따라 달라집니다:

1. 모델 아키텍처, 실행 시간에 영향을 미침
2. 업로드 시간과 실행 중 모델 추론 시간에 영향을 주는 이미지의 크기와 해상도
3. 요청 업로드 시간과 응답 다운로드 시간에 영향을 주는 네트워크 지연 시간과 대역폭.
4. 특정 시점의 서비스 구독 상태와 다른 사용자들의 사용량으로 인해 대기열 지연이 발생할 수 있음

<figure><img src="https://3958014485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M6S9nPJhEX9FYH6clfW%2Fuploads%2FqMum7HkzyWoxLnOpbVGx%2Fserverless-img.png?alt=media&#x26;token=e075c90c-32a9-4691-9afc-54ec9831251b" alt=""><figcaption></figcaption></figure>

아래 표에는 v1과 v2 Serverless Hosted API의 대표적인 벤치마크가 일부 표시되어 있습니다. 여기에는 엔드투엔드 지연 시간(E2E)과 실행 시간(Exec) 모두가 포함되어 있습니다. 이 수치는 참고용이며, 사용자가 직접 [우리의 추론 벤치마크 도구를 사용하거나](https://inference.roboflow.com/inference_helpers/cli_commands/benchmark/) 자체 커스텀 벤치마크를 수행해 보시기를 권장합니다.

<table><thead><tr><th width="176.14410400390625">모델</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>

사용자분들이 각자의 모델 추론과 워크플로우에 대해 자체 벤치마크를 실행하여 특정 사용 사례에 대한 실제 지표를 확인해 보시기를 권장합니다.

## 제한 사항

Serverless Hosted API (v1)는 특정 작업 유형과 관계없이 최대 5MB의 파일을 허용합니다. 이 제한에는 이미지 파일 크기와 첨부된 요청 정보가 포함되며, 이에 국한되지는 않습니다.

{% hint style="info" %}
요청이 너무 큰 경우, 첨부된 이미지를 더 작게 조정하는 것을 권장합니다. 이미지는 서버에서 수신된 후 모델 아키텍처가 허용하는 입력 크기로 다시 조정되므로, 일반적으로 성능 저하로 이어지지 않습니다.\
\
Python SDK와 같은 일부 SDK는 API로 전송되기 전에 이미지를 자동으로 모델 아키텍처의 입력 크기로 축소합니다.
{% endhint %}
