CLI Enhancement: Add Environment Variable Support for Model Name and API_KEY #34
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.
PR Message
This PR adds support for two environment variables to improve MinerU’s compatibility when deployed on model management platforms such as GPUStack.
Background
We are from the GPUStack team. While integrating MinerU into model management platforms, we encountered the following issues:
Unable to specify
model_namewhen multiple models are presentWhen MinerU calls
/v1/models, it raises an error if the backend returns more than one model, as shown in the current implementation.The CLI does not provide a way to specify the model name.
The new
MINERU_VL_MODEL_NAMEenvironment variable addresses this limitation.Lack of API key support for authenticated platforms
Many model management platforms use OpenAI-compatible API keys for authentication, but MinerU currently does not support providing an API key.
The new
MINERU_VL_API_KEYenvironment variable enables MinerU to work in authentication-required environments.Changes
MINERU_VL_MODEL_NAMEto explicitly specify the model name.MINERU_VL_API_KEYto allow MinerU to pass an API key when authentication is needed.These enhancements make MinerU more flexible and better suited for deployment behind AI gateways and model management platforms that handle multiple models or require authentication.