Session 12: split the bot into MLflow, classifier, LLM and orchestrator services#4
Open
mkhlndrv wants to merge 1 commit into
Open
Session 12: split the bot into MLflow, classifier, LLM and orchestrator services#4mkhlndrv wants to merge 1 commit into
mkhlndrv wants to merge 1 commit into
Conversation
Turn the single echo-bot app into four containers wired with Docker Compose: - mlflow: tracking server + model registry - classifier: registers the zero-shot bot detector in MLflow as the champion, loads it from the registry and serves POST /predict - llm: llama.cpp OpenAI-compatible server (Qwen2.5-0.5B) on port 11434 - orchestrator: public gateway, forwards /predict to the classifier and /get_message to the llm, runs no model itself Services talk to each other by compose service name. Also drop the committed SSH key and the old tunnel scripts, and add a microservice README.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Session 12 homework: turned the quick-start into a small microservice setup. The
whole thing starts with
docker compose up --build.Services
detector in MLflow as
youarebot-classifier@champion, then loads that championfrom the registry and serves
POST /predict.11434,exposing
POST /v1/chat/completions./predictto theclassifier and
/get_messageto the llm. It runs no model itself.Each service is its own folder under
services/with its own Dockerfile andrequirements. Inside the compose network they call each other by service name
(
classifier:8000,llm:11434,mlflow:5000), neverlocalhost.How to run and test
Full instructions and example responses are in the README.
Checks
I ran the whole stack locally and confirmed:
/predictreturns a real probability in[0,1](0.28 for a human-like line,0.75 for an "as an AI language model" line, so the model actually discriminates).
/get_messagereturns a real LLM answer.classifier:8000andllm:11434,it does not run any model.
youarebot-classifierexperiment and thechampionregistered model.
Notes
GGUF weights (~400 MB).
5001(host5000is taken by AirPlayon macOS); internally it is still
mlflow:5000.portforward_key(an SSHprivate key that was in the repo) and the SSH-tunnel run scripts that used it.
Since it was committed before, that key should be rotated regardless.