Zasób InferenceService
Zadeklaruj wdrożenie modelu w jednym manifeście
Zasób InferenceService to bezpłatna lekcja MLOps Academy na CoddyKit. To lekcja 1 z 4. Możesz przeczytać całą lekcję poniżej za darmo — a potem ćwiczyć ją interaktywnie w przeglądarce z wbudowanym edytorem kodu i tutorem AI dostępnym 24/7. To część ścieżki edukacyjnej MLOps Academy, a Twój postęp synchronizuje się między webem a aplikacją CoddyKit. Kurs MLOps Academy zawiera 4 lekcji w sumie.
Części tej lekcji nie zostały jeszcze przetłumaczone i są wyświetlane po angielsku.
Meet KServe
KServe turns a trained model into a production endpoint on Kubernetes. You describe what you want, and it handles serving, scaling, and routing for you. KServe is your serving layer. 🚀
One Resource to Rule Them
Instead of writing raw Deployments and Services by hand, you create a single custom resource. The InferenceService is the one object that defines your whole serving setup.
It Is Just YAML
You declare an InferenceService in a small YAML manifest, then apply it with kubectl. KServe reads that manifest and builds everything underneath.
apiVersion: serving.kserve.io/v1beta1
kind: InferenceService
metadata:
name: sklearn-irisThe Predictor Block
The core of the spec is the predictor, which says how to load and run your model. It points KServe at the model and the runtime that should serve it.
spec:
predictor:
model:
modelFormat:
name: sklearn
storageUri: gs://kfserving-examples/models/sklearn/1.0/modelWhere Your Model Lives
The storageUri tells KServe where to pull the model from, like a GCS or S3 bucket. KServe downloads it into the serving container at startup.
Model Format Picks the Runtime
The modelFormat field, such as sklearn or pytorch, lets KServe choose a matching serving runtime automatically. No custom server code needed for common frameworks.
Apply It Like Any Resource
You ship the manifest to the cluster with a normal kubectl command. KServe sees the new object and starts reconciling it into a running service. kubectl apply kicks it off.
kubectl apply -f sklearn-iris.yamlWatch It Become Ready
After applying, you check status until the service reports READY. The READY column flips to True once the model is loaded and accepting traffic.
kubectl get inferenceservice sklearn-irisYou Get a URL
A ready InferenceService exposes a stable URL for predictions. Clients send requests there, and KServe routes them to your model behind the scenes.
Sending a Prediction
You POST your input as JSON to the predict path of that URL. KServe forwards it to the model and returns the prediction in the response body.
curl -X POST $URL/v1/models/sklearn-iris:predict \
-d '{"instances": [[5.1, 3.5, 1.4, 0.2]]}'Transformer and Explainer Too
Beyond predictor, the spec can add a transformer for pre and post processing and an explainer for insight. Each is optional and chains automatically.
Quick Check
You want KServe to serve a model. Which single object do you declare?
Recap
You learned that the InferenceService is KServe's single declarative resource. Set a predictor with a storageUri and format, apply it, and get a ready prediction URL. Nice work! 🎉
Często zadawane pytania
Czy lekcja „Zasób InferenceService” jest bezpłatna?
Tak — pełny tekst „Zasób InferenceService” jest dostępny za darmo tutaj w sieci. Aby ćwiczyć ją interaktywnie (wbudowany edytor kodu i tutor AI dostępny 24/7) i odblokować resztę kursu MLOps Academy, przejdź na CoddyKit PRO. Kurs MLOps Academy zawiera 4 lekcji w sumie.
Co nauczysz się w „Zasób InferenceService”?
Zadeklaruj wdrożenie modelu w jednym manifeście Ćwiczysz MLOps Academy z praktycznym kodem, który uruchamiasz bezpośrednio w przeglądarce, a tutor AI dostępny 24/7 odpowiada na Twoje pytania podczas pracy nad lekcją.
Czy potrzebuję doświadczenia, aby zacząć MLOps Academy?
Nie wymagamy żadnego doświadczenia. MLOps Academy w CoddyKit jest strukturyzowany dla początkujących i zaawansowanych użytkowników, więc możesz zacząć tutaj lub od początku i uczyć się w swoim tempie. To lekcja 1 z 4.
Ile czasu zajmuje lekcja „Zasób InferenceService”?
Większość lekcji CoddyKit trwa około 5–10 minut. Każda lekcja to mały, interaktywny krok, dzięki czemu robisz systematyczne postępy i zawsze wracasz dokładnie do tego samego miejsca — na webie i w aplikacji.
Czy mogę pisać i uruchamiać kod w tej lekcji MLOps Academy?
Tak. Każda lekcja MLOps Academy zawiera wbudowany edytor kodu, więc piszesz i uruchamiasz prawdziwy kod bezpośrednio w przeglądarce i od razu otrzymujesz sprzężenie zwrotne od AI — bez konfiguracji na komputerze.
Wszystkie lekcje w tym kursie
- Zasób InferenceService
- Skalowanie do zera i z powrotem
- Pisanie własnego predyktora
- KServe a Seldon Core