Registry / azure / azureml-inference-server-http

azureml-inference-server-http

JSON →
library1.5.1pypypiunverified

The `azureml-inference-server-http` library provides the core HTTP server runtime for deploying machine learning models on Azure Machine Learning. It hosts user-defined model scripts (`score.py`) by loading `init()` and `run()` functions, allowing models to be exposed via a FastAPI-based REST API. As of version 1.5.1, it continues to evolve primarily through internal improvements and stability updates, with a focus on seamless integration into the Azure ML ecosystem.

pip install azureml-inference-server-http
INSTALL
IMPORT
SIG · AZUREML-INFERENCE-
A
azureml-inference-server-http
azurepythonv1.5.1
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
build_error
glibc
py 3.103.920 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

HttpServer
Users define `init()` and `run()` functions in a `score.py` file.
from azureml.inference.server.http import HttpServer
This library provides the server runtime. User interaction is primarily by defining a `score.py` script with `init()` and `run()` functions, not by directly importing server components into application code.

This quickstart demonstrates how to create a minimal `score.py` file, which is the standard interface for models running on `azureml-inference-server-http`. It also provides the necessary shell commands to run this server locally for testing. The server exposes a `/score` endpoint for inference requests.

# Create a file named 'score.py' # --- # import json # # def init(): # global model # # In a real scenario, load your model here, e.g., from a file. # model = {"status": "initialized"} # # def run(raw_data): # try: # data = json.loads(raw_data) # prediction = f"Model received input: {data.get('input', 'no input')} and is {model['status']}" # return json.dumps({"output": prediction}) # except Exception as e: # return json.dumps({"error": str(e)}) # --- # To run locally, save the above to 'score.py' and execute in your terminal: # export AZUREML_ENTRY_SCRIPT=score.py # python -m azureml.inference.server.http.http_server # # Then, send a request to http://localhost:5001/score # Example with curl: # curl -X POST -H "Content-Type: application/json" -d '{"input": "example data"}' http://localhost:5001/score
Debug
Known issues
gotchaThis library is primarily a server runtime, not a client library for direct programmatic interaction with ML models. Users define `init()` and `run()` functions in a `score.py` file that this server loads and executes.
fix
Focus on correctly structuring your `score.py` script and its environment, rather than attempting to import and use internal server components directly.
affects: All versions
gotchaLocal testing requires setting specific environment variables, most notably `AZUREML_ENTRY_SCRIPT`, to point the server to your `score.py` file.
fix
Before running `python -m azureml.inference.server.http.http_server`, ensure `export AZUREML_ENTRY_SCRIPT=your_score_file.py` (or `set AZUREML_ENTRY_SCRIPT=your_score_file.py` on Windows) is executed.
affects: All versions
breakingThe exact signature requirements for `init()` and `run()` in `score.py` have been stable, but future versions might introduce subtle changes or new optional parameters.
fix
Always refer to the official Azure ML documentation for the recommended `score.py` template and function signatures for your target Azure ML SDK and server version to ensure compatibility.
affects: Across major releases (e.g., 1.x to 2.x)
gotchaAll Python package dependencies for your model code within `score.py` must be explicitly managed and installed into the server's environment. `pip install azureml-inference-server-http` does not install your model's dependencies.
fix
When deploying to Azure ML, provide a `conda_env.yml` file. For local testing, manually `pip install` all necessary packages into your Python environment *before* running the server.
affects: All versions
Upgrade
Version history
1.5.1latest on PyPI · released Dec 18, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
23 hits · last 30 days
node
20
Amazon
1
OpenAI (training)
1
Resources
azureml-inference-server-http — pip install azureml-inference-server-http · libregistry