MCPcopy Create free account
hub / github.com/OpenPipe/ART / test_serverless_backend

Function test_serverless_backend

tests/integration/test_multi_checkpoint_training.py:175–201  ·  view source on GitHub ↗

Test multi-checkpoint inference with ServerlessBackend.

()

Source from the content-addressed store, hash-verified

173 reason="WANDB_API_KEY not set - skipping ServerlessBackend test",
174)
175async def test_serverless_backend():
176 """Test multi-checkpoint inference with ServerlessBackend."""
177 model_name = f"test-multi-ckpt-serverless-{uuid.uuid4().hex[:8]}"
178 backend = art.ServerlessBackend()
179 model = art.TrainableModel(
180 name=model_name,
181 project="integration-tests",
182 base_model="meta-llama/Llama-3.1-8B-Instruct",
183 )
184 try:
185 await model.register(backend)
186 results = await run_training_loop(
187 model, backend, num_steps=1, rollouts_per_step=2
188 )
189 # Verify TrainResult structure
190 assert len(results) == 1
191 assert isinstance(results[0], ServerlessTrainResult)
192 assert results[0].step > 0
193 assert results[0].artifact_name is not None
194 await _run_inference_on_step(model, step=results[-1].step)
195 await _run_inference_on_step(model, step=0)
196 finally:
197 try:
198 await backend.delete(model)
199 except Exception:
200 pass
201 await backend.close()

Callers

nothing calls this directly

Calls 5

registerMethod · 0.95
deleteMethod · 0.95
closeMethod · 0.95
run_training_loopFunction · 0.85
_run_inference_on_stepFunction · 0.85

Tested by

no test coverage detected