ModelProxy supports the "jobType" field of inference jobs - #118
Merged
Conversation
zhogu
requested review from
Copilot,
Rui Gao (hippogr) and
Yuting Jiang (yukirora)
November 5, 2025 11:37
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the model proxy service to improve parallel processing, code reusability, and job filtering. The main changes include introducing concurrent job processing with goroutines, extracting common HTTP GET logic into a reusable function, and transitioning from tag-based job filtering to API-based job type filtering.
Key changes:
- Introduced parallel processing of inference jobs using goroutines with semaphore-based concurrency control
- Refactored HTTP GET logic into a reusable
GETRequestfunction to eliminate code duplication - Changed from tag-based job filtering to API query parameter filtering (
jobType=inference)
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/model-proxy/src/proxy/model_server.go | Refactored HTTP requests, added concurrent job processing, introduced job parameter fetching, and replaced tag-based filtering with API-based filtering |
| src/model-proxy/deploy/model-proxy.yaml.template | Removed deprecated --modelkey command-line argument |
Comments suppressed due to low confidence (1)
src/model-proxy/src/proxy/model_server.go:37
- The error message 'failed to GET jobs from %s' in the generic
GETRequestfunction is too specific. This function is used for various endpoints (jobs, job config, job details, models), not just jobs. Consider a more generic message like 'failed to GET from %s' or 'HTTP GET request failed for %s'.
return nil, fmt.Errorf("failed to GET jobs from %s: %w", url, err)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Yuting Jiang (yukirora)
approved these changes
Nov 7, 2025
Rui Gao (hippogr)
approved these changes
Nov 7, 2025
Yuting Jiang (yukirora)
had a problem deploying
to
auto-test
November 8, 2025 03:45 — with
GitHub Actions
Failure
Yuting Jiang (yukirora)
temporarily deployed
to
auto-test
November 8, 2025 15:01 — with
GitHub Actions
Inactive
Yuting Jiang (yukirora)
temporarily deployed
to
auto-test
November 8, 2025 15:47 — with
GitHub Actions
Inactive
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.
This pull request refactors and improves the model server proxy logic in
src/model-proxy/src/proxy/model_server.go, focusing on reliability, parallelism, and code simplification. Key changes include switching to a more robust job listing method, extracting forced job parameters, and parallelizing model mapping queries. Additionally, the handling of model keys in the deployment template has been updated.Job listing and parameter extraction improvements:
ListModelServingJobsfunction withListInferenceJobs, which queries inference jobs specifically and uses a sharedGETRequesthelper for HTTP GETs. This also introduces a constant list of required job parameters and a dedicatedGetJobParametersfunction to extract them. [1] [2] [3]GETRequesthelper, simplifying error handling and request construction.Parallelization and concurrency:
GetJobModelsMappingfunction now uses goroutines and a semaphore to parallelize requests for job server URLs and model lists, improving performance and reliability by avoiding bottlenecks and handling errors per job. Results are collected via a channel and aggregated after all jobs complete.Deployment template update:
--modelkeyargument from the model proxy deployment YAML template, reflecting the code changes and reducing configuration complexity.