0Pricing
MLOps Academy · Aula

Divida o tráfego entre versões do modelo

Direcione uma porcentagem das requisições para um modelo desafiante.

Divida o tráfego entre versões do modelo é uma aula grátis de MLOps Academy no CoddyKit. Esta é a aula 1 de 4. Você pode ler a aula completa abaixo gratuitamente — depois pratica ao vivo no navegador com um editor de código integrado e um tutor de IA 24/7. Faz parte do caminho de aprendizado de MLOps Academy, e seu progresso é sincronizado entre a web e o app CoddyKit. O curso de MLOps Academy inclui 4 aulas no total.

Partes desta aula ainda não foram traduzidas e aparecem em inglês.

Two Models, One Live Test

You have a new model you believe is better. Instead of guessing, you let real traffic decide. An A/B test runs both models side by side on live users. 🔬

Champion and Challenger

The current model in production is your champion. The new candidate you want to prove is the challenger. The test sees if the challenger truly beats the champion.

Splitting the Traffic

The core idea is simple: send a slice of requests to each model. A common start is 90/10, keeping most users safe on the champion while the challenger proves itself.

A Tiny Router

A basic split just rolls a random number per request and routes by the cutoff. Here ten percent of traffic reaches the challenger.

import random

def pick_model(challenger_share=0.1):
    return "challenger" if random.random() < challenger_share else "champion"

Keep Each User Consistent

Random per request flips a user between models on every visit. Instead, hash the user id so the same person always lands on the same model.

Hashing for Sticky Splits

Hashing the user id gives a stable bucket. The same id maps to the same model every time, which keeps the test clean.

import hashlib

def bucket(user_id, challenger_share=0.1):
    h = int(hashlib.md5(user_id.encode()).hexdigest(), 16)
    return "challenger" if (h % 100) < challenger_share * 100 else "champion"

Log Which Model Served

For every prediction, record which model handled it. Without this assignment log, you can never compare the two groups fairly later on. 📝

Start Small, Then Ramp

Begin with a tiny challenger share to limit risk. As confidence grows, you raise the percentage gradually instead of flipping everyone over at once.

Control the Split with Config

Hard-coding the share means a redeploy to change it. Read the split ratio from config so you can dial traffic up or down without shipping code.

Same Inputs, Fair Fight

Both models must see the same kind of requests and the same features. If the groups differ in who they serve, any winner you find may be an illusion.

It Is Just Routing

At its heart, an A/B test is a routing layer plus careful logging. Get the split sticky and recorded, and you have the foundation for a trustworthy comparison. ✅

Quick Check

Let us check how to keep your split clean.

Recap

An A/B test pits a champion against a challenger by splitting live traffic. Hash users for sticky buckets, log every assignment, and start small. 🎯

Perguntas Frequentes

A aula “Divida o tráfego entre versões do modelo” é grátis?

Sim — o texto completo de “Divida o tráfego entre versões do modelo” é grátis para ler aqui na web. Para praticá-la interativamente (um editor de código integrado e um tutor de IA 24/7) e desbloquear o restante do curso de MLOps Academy, atualize para CoddyKit PRO. O curso de MLOps Academy inclui 4 aulas no total.

O que vou aprender em “Divida o tráfego entre versões do modelo”?

Direcione uma porcentagem das requisições para um modelo desafiante. Você pratica MLOps Academy com código prático que executa diretamente no navegador, e um tutor de IA 24/7 responde suas dúvidas enquanto trabalha na aula.

Preciso ter experiência prévia para começar MLOps Academy?

Nenhuma experiência prévia é necessária. MLOps Academy no CoddyKit é estruturado para alunos iniciantes até avançados, então você pode começar aqui ou desde o início e aprender no seu ritmo. Esta é a aula 1 de 4.

Quanto tempo leva a aula “Divida o tráfego entre versões do modelo”?

A maioria das aulas CoddyKit leva cerca de 5–10 minutos. Cada uma é compacta e interativa, então você faz progresso constante e retoma exatamente de onde parou entre web e app.

Posso escrever e executar código nesta aula de MLOps Academy?

Sim. Cada aula de MLOps Academy inclui um editor de código integrado, então você escreve e executa código real direto no navegador e recebe feedback de IA instantaneamente — nenhuma configuração local necessária.

Todas as aulas deste curso

  1. Divida o tráfego entre versões do modelo
  2. Escolha as métricas que importam
  3. Interprete a significância sem se enganar
  4. Promova ou reverta o vencedor
← Voltar para MLOps Academy