> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/models/ko/supported-models/vit.md).

# ViT

Roboflow에서 학습된 Vision Transformer(ViT) 분류 모델을 다음을 통해 사용하세요 [서버리스 호스티드 API](https://docs.roboflow.com/deployment/roboflow-cloud/serverless-api).

## 코드 샘플

{% stepper %}
{% step %}

### API 키 받기

Roboflow 계정을 만들고, 다음에서 키를 찾으세요 [Roboflow API 설정 페이지](https://app.roboflow.com/settings/api) 그리고 셸에서 사용할 수 있도록 설정하세요:

```bash
export ROBOFLOW_API_KEY="your-key-here"
```

{% endstep %}

{% step %}

### 의존성 설치하기

이 패키지는 다음 모델을 호출합니다:

```bash
pip install -U inference-sdk supervision
```

{% endstep %}

{% step %}

### 모델 실행하기

학습된 ViT 분류기를 그 `{workspace}/{model-slug}` ID (참조 [버전, 학습, 및 모델](/models/ko/versions-trainings-and-models.md)).

```python
import os
import supervision as sv
from inference_sdk import InferenceHTTPClient

image = sv.load_image_from_url("https://media.roboflow.com/notebooks/examples/dog.jpeg")

client = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key=os.environ["ROBOFLOW_API_KEY"],
)
# 사전 학습된 별칭 없음: 직접 모델을 학습하고 "your-project/1"을 모델 ID로 바꾸세요.
results = client.infer(image, model_id="your-project/1")
print(results)
```

{% endstep %}
{% endstepper %}

{% hint style="info" %}
설정하세요 `api_url` 배포 대상에 맞게 설정하세요:

* `https://serverless.roboflow.com` Serverless Hosted API용입니다.
* `http://localhost:9001` 로컬 [Inference](https://docs.roboflow.com/deployment/self-hosted/self-hosted) 서버.
* 사용자 [전용 배포](https://docs.roboflow.com/deployment/roboflow-cloud/dedicated-deployments) 비공개 엔드포인트용 URL.
  {% endhint %}

자체 호스팅 배포 및 추가 세부 정보는 다음을 참조하세요. [추론 문서](https://docs.roboflow.com/deployment/self-hosted/self-hosted).
