웹 사이트 | 문서 | 튜토리얼 | 놀이터 | 블로그 | 불화
NOS 는 클라우드 또는 AI HW에서 실행되는 빠르고 유연한 Pytorch 추론 서버입니다.
inf2 ) 런타임 소개.시작하려면 QuickStart 가이드로 이동하는 것이 좋습니다. NOS 클라이언트를 설치하려면 다음 명령을 실행할 수 있습니다.
conda create -n nos python=3.8 -y
conda activate nos
pip install torch-nos 클라이언트가 설치되면 NOS serve CLI를 통해 NOS 서버를 시작할 수 있습니다. 이것은 로컬 환경을 자동으로 감지하고 Docker 런타임 이미지를 다운로드하고 NOS 서버를 돌리게됩니다.
nos serve up --http --logging-level INFO 이제 NOS로 첫 번째 추론 요청을 실행할 준비가되었습니다! 다음 명령을 실행하여 시도해 볼 수 있습니다. 서버에서 더 자세한 정보를 원할 경우 로깅 레벨을 DEBUG 하도록 설정할 수 있습니다.
NOS는 스트리밍 지원 기능이있는 OpenAI 호환 서버를 제공하여 좋아하는 OpenAI 호환 LLM 클라이언트를 연결하여 NOS와 대화 할 수 있습니다.

GRPC API i
from nos . client import Client
client = Client ()
model = client . Module ( "TinyLlama/TinyLlama-1.1B-Chat-v1.0" )
response = model . chat ( message = "Tell me a story of 1000 words with emojis" , _stream = True )휴식 API
curl
-X POST http://localhost:8000/v1/chat/completions
-H " Content-Type: application/json "
-d ' {
"model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0",
"messages": [{
"role": "user",
"content": "Tell me a story of 1000 words with emojis"
}],
"temperature": 0.7,
"stream": true
} 'MidJourney Discord Bots를 몇 초 만에 구축하십시오.

GRPC API i
from nos . client import Client
client = Client ()
sdxl = client . Module ( "stabilityai/stable-diffusion-xl-base-1-0" )
image , = sdxl ( prompts = [ "hippo with glasses in a library, cartoon styling" ],
width = 1024 , height = 1024 , num_images = 1 )휴식 API
curl
-X POST http://localhost:8000/v1/infer
-H ' Content-Type: application/json '
-d ' {
"model_id": "stabilityai/stable-diffusion-xl-base-1-0",
"inputs": {
"prompts": ["hippo with glasses in a library, cartoon styling"],
"width": 1024, "height": 1024,
"num_images": 1
}
} '몇 분 안에 이미지/비디오의 확장 가능한 의미 론적 검색을 구축하십시오.

GRPC API i
from nos . client import Client
client = Client ()
clip = client . Module ( "openai/clip-vit-base-patch32" )
txt_vec = clip . encode_text ( texts = [ "fox jumped over the moon" ])휴식 API
curl
-X POST http://localhost:8000/v1/infer
-H ' Content-Type: application/json '
-d ' {
"model_id": "openai/clip-vit-base-patch32",
"method": "encode_text",
"inputs": {
"texts": ["fox jumped over the moon"]
}
} 'Whisper를 사용하여 실시간 오디오 전사를 수행하십시오.

GRPC API i
from pathlib import Path
from nos . client import Client
client = Client ()
model = client . Module ( "openai/whisper-small.en" )
with client . UploadFile ( Path ( "audio.wav" )) as remote_path :
response = model ( path = remote_path )
# {"chunks": ...}휴식 API
curl
-X POST http://localhost:8000/v1/infer/file
-H ' accept: application/json '
-H ' Content-Type: multipart/form-data '
-F ' model_id=openai/whisper-small.en '
-F ' [email protected] '2 줄의 코드로 클래식 컴퓨터 vision 작업을 실행하십시오.

GRPC API i
from pathlib import Path
from nos . client import Client
client = Client ()
model = client . Module ( "yolox/medium" )
response = model ( images = [ Image . open ( "image.jpg" )])휴식 API
curl
-X POST http://localhost:8000/v1/infer/file
-H ' accept: application/json '
-H ' Content-Type: multipart/form-data '
-F ' model_id=yolox/medium '
-F ' [email protected] 'NOS가 지원하지 않는 모델을 실행하고 싶습니까? NOS 놀이터의 예제에 따라 자신의 모델을 쉽게 추가 할 수 있습니다.
이 프로젝트는 Apache-2.0 라이센스에 따라 라이센스가 부여됩니다.
NOS는 Sentry를 사용하여 익명 사용 데이터를 수집합니다. 이는 커뮤니티가 NOS를 사용하는 방법을 이해하고 기능을 우선 순위를 정하는 데 도움이됩니다. NOS_TELEMETRY_ENABLED=0 설정하여 원격 측정을 거부 할 수 있습니다.
우리는 기여를 환영합니다! 자세한 내용은 기고 안내서를 참조하십시오.