TensorFlow Serving deploys a TensorFlow computation graph together with saved weights as an inference service. It moves the model outside the Python program, allowing applications written in JavaScript, C++, or other environments to consume predictions through a REST API. section 6.3.2
Exporting a Keras model
Export a Keras model in TensorFlow SavedModel format, reload the artifact, and call its serving endpoint with input data. This separates production inference from training and creates room for speed and memory optimizations. section 6.3.2
model.export("path/to/location", format="tf_saved_model") #1 reloaded_artifact = tf.saved_model.load("path/to/location") #2 predictions = reloaded_artifact.serve(input_data) #2
The listing shows the complete export, reload, and prediction flow for a TensorFlow Serving artifact. section 6.3.2
Use this deployment pattern when:
- The consuming application can reliably reach a remote service over the internet. section 6.3.2
- Roughly 500 milliseconds of request, inference, and response time is acceptable. section 6.3.2
- Inference inputs are not highly sensitive, because the server must access them in decrypted form; use SSL for HTTP traffic. section 6.3.2

