> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 서빙

> Weave Op와 모델을 API 엔드포인트로 노출하여 예측을 서빙하고 프로덕션에서 추론을 실행하세요.

이 가이드에서는 `weave serve`을 사용하여 W\&B Weave Model을 FastAPI 엔드포인트로 노출하는 방법을 보여주므로, 모델을 대화형으로 쿼리하고 프로덕션 추론 워크플로에 통합할 수 있습니다.

Weave Model에 FastAPI 서버를 시작하려면 Weave ref를 `weave serve`에 전달하세요. `[REF]`를 Weave Model ref로 교체하세요.

```bash theme={"system"}
weave serve [REF]
```

모델을 대화형으로 쿼리하려면 `http://0.0.0.0:9996/docs`에서 Swagger UI를 여십시오.

<h2 id="install-fastapi">
  FastAPI 설치
</h2>

`weave serve`는 FastAPI와 Uvicorn을 사용하여 모델을 호스팅하므로, 서빙하기 전에 두 패키지를 모두 설치해야 합니다.

```bash theme={"system"}
pip install fastapi uvicorn
```

<h2 id="serve-model">
  모델 서빙
</h2>

의존성을 설치한 후, 터미널에서 서버를 시작하세요. `[YOUR-MODEL-REF]`를 Weave Model ref로 교체하세요.

```bash theme={"system"}
weave serve [YOUR-MODEL-REF]
```

UI에서 모델로 이동하여 ref를 복사해 모델 ref를 조회하세요. 다음과 같이 표시되어야 하며, 여기서 `[ENTITY]`는 W\&B entity, `[PROJECT-NAME]`는 프로젝트 이름, `[MODEL-NAME]`은 모델 이름, `[HASH]`는 모델 버전 hash입니다:

```text theme={"system"}
weave://[ENTITY]/[PROJECT-NAME]/[MODEL-NAME]:[HASH]
```

엔드포인트를 테스트하려면 Swagger UI를 열고 `predict` 엔드포인트를 클릭한 다음 **Try it out**을 클릭하세요. 이제 Weave Model의 예측을 제공하는 로컬 FastAPI 엔드포인트가 있습니다.
