For the complete documentation index, see llms.txt. This page is also available as Markdown.

모델 관리

inference-sdk 클라이언트로 Inference Server에서 모델을 미리 로드, 검사, 언로드하세요.

모델 가중치 다운로드

자가 호스팅 Inference Server를 사용할 때는 추론을 실행하기 전에 모델을 미리 로드하여 가중치를 다운로드하고 캐시할 수 있습니다:

from inference_sdk import InferenceHTTPClient, InferenceConfiguration

client = InferenceHTTPClient(
    api_url="http://localhost:9001",
    api_key="YOUR_ROBOFLOW_API_KEY"
).configure(InferenceConfiguration(api_key_transport="header"))

# 모델 미리 로드하기(가중치를 서버 캐시에 다운로드)
client.load_model(model_id="rfdetr-base")

대신, 첫 추론을 실행하면 다운로드가 자동으로 시작됩니다.

Workflows의 경우, Workflow에서 사용되는 모든 모델도 미리 로드하고 Workflow를 한 번 실행하여 해당 정의를 캐시해야 합니다.

서버에 어떤 모델이 로드되어 있는지 확인할 수 있습니다:

loaded_models = client.list_loaded_models()
print(f"Loaded models: {loaded_models}")

자세히 알아보기 가중치 캐싱, 영구 저장소 및 Docker 구성.

Inference Server를 제어하는 방법

서버 정보 가져오기

로드된 모델 목록 보기

비동기 대응: list_loaded_models_async()

특정 모델 설명 가져오기

만약 allow_loading 가 True로 설정되어 있으면, 모델이 아직 로드되지 않았다면 부가 효과로 로드됩니다. 기본값: True.

비동기 대응: get_model_description_async()

모델 로드하기

지정한 모델이 로드됩니다. 만약 set_as_default 가 True가 성공적으로 로드된 후 해당 모델이 클라이언트의 기본 모델로 사용됩니다. 기본값: False.

비동기 대응: load_model_async()

모델 언로드하기

때로는 서버 측 OOM을 방지하기 위해 모델 언로드가 필요합니다.

비동기 대응: unload_model_async()

모든 모델 언로드하기

비동기 대응: unload_all_models_async()

마지막 업데이트

도움이 되었나요?