[JFMGC-8] Build failover solution for model serving infrastructure - #8
Conversation
There was a problem hiding this comment.
This is an awesome contribution Yahor, thanks! Could we maybe make one small conceptual change?
Say I request 10K samples but the model has a capacity of 5K, then we were requesting 5K and then again 5K from the same instance. With several models, we not only have failover but we can speed up operations. Say we have 2 instances that can generate 5K samples, we can now run the requests in parallel, using both instances at the same time. Would that be possible?
mariusvilkas
left a comment
There was a problem hiding this comment.
I am not very familiar with the jointfm-client, but code does make sense to me.
Is there a way to call client to just get a status on the pool instances - like instance is offline or not reachable or something like that. Otherwise,
LGTM
@mariusvilkas thank you for the review. I'm currently working on Stefan's suggestion above, so the PR will be updated a bit. But in any case, if you want to check the deployment status, the easiest way is to run |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit cbad794. Configure here.
@shackmann I have added parallel execution in 4415f53 The solution doesn’t look architecturally sound, and this kind of separation would be better handled in the API rather than in the clients. However, I hope it will be useful as a temporary solution. I tested it on a small random dataset against (6a80af033a75b0a67a4df8ab, 6a7f76b43a393b6b724e0819), and the script ran about 1.5x faster. |
|
LGTM |

How it works:
JOINTFM_DEPLOYMENT_IDS.470,502/503/504):Note
Medium Risk
Changes how all hosted predict/health traffic is routed (round-robin, failover, threading) and adds a new required-env contract for pool mode; behavior is heavily tested but affects production inference paths.
Overview
Adds multi-deployment hosted inference via
JOINTFM_DEPLOYMENT_IDS(comma-separated, ≥2 unique IDs, mutually exclusive with other selectors). Settings build a peerinstancespool; docs andconfig.sample.yamldocument the new env/YAML wiring.Introduces
JointFMInstancePoolwith round-robin routing, per-peer health probes (skip bad peers; require matchingmodel_version/checkpoint_version; use minimummax_sample_count), retryable failover (network errors and configured 5xx/470), and short peer cooldowns after transient failures.JointFMClientrouteshealth(),predict(), and forecasts through the pool when multiple instances are configured. Sample-batch splitting can run in parallel across peers viaThreadPoolExecutor, with one fail-fast transport per peer in production. Public exports includeJointFMInstancePoolandJointFMInstanceSettings.Reviewed by Cursor Bugbot for commit 34ac5ad. Bugbot is set up for automated code reviews on this repo. Configure here.