Implementation:Tensorflow Serving Simple Servers
| Knowledge Sources | |
|---|---|
| Domains | Model Serving, Server Bootstrap |
| Last Updated | 2026-02-13 00:00 GMT |
Overview
Provides a simple bootstrapping function that creates a complete serving Manager for a single TensorFlow SavedModel with automatic version loading from a filesystem path.
Description
The Simple Servers module provides CreateSingleTFModelManagerFromBasePath, a convenience function that constructs a complete model serving pipeline with default configurations. It wires together three components:
1. FileSystemStoragePathSource: Monitors a base path on the filesystem for new model version directories, polling every second. New directories are detected and reported as aspired versions.
2. SavedModelBundleSourceAdapter: Converts storage paths into loadable SavedModelBundles with default configuration, acting as the bridge between the path source and the model manager.
3. AspiredVersionsManagerBuilder: Creates an AspiredVersionsManager with an AvailabilityPreservingPolicy, which ensures that the old version is unloaded before the new version is loaded. The builder connects the source chain (path source feeding into bundle source adapter) and produces the final Manager.
The created Manager serves SavedModelBundle servables under the fixed name "default". The AvailabilityPreservingPolicy trades availability for reduced resource usage by not keeping two versions loaded simultaneously.
Usage
Use this module for simple, single-model deployments where minimal configuration is needed. It is intended for testing, prototyping, and basic experimental deployments. For production deployments, use ServerCore with full configuration options instead.
Code Reference
Source Location
- Repository: Tensorflow_Serving
- Files:
tensorflow_serving/servables/tensorflow/simple_servers.h(lines 1-56)tensorflow_serving/servables/tensorflow/simple_servers.cc(lines 1-101)
Signature
namespace simple_servers {
Status CreateSingleTFModelManagerFromBasePath(
const string& base_path, std::unique_ptr<Manager>* manager);
} // namespace simple_servers
Import
#include "tensorflow_serving/servables/tensorflow/simple_servers.h"
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| base_path | string |
Yes | Filesystem path where model version directories are located |
Outputs
| Name | Type | Description |
|---|---|---|
| manager | std::unique_ptr<Manager>* |
Created Manager that automatically loads/unloads model versions from base_path |
| return | Status |
OK on success; error if source or adapter creation fails |
Usage Examples
Creating a Simple Server
std::unique_ptr<Manager> manager;
TF_RETURN_IF_ERROR(
simple_servers::CreateSingleTFModelManagerFromBasePath(
"/models/my_model", &manager));
// Get a handle to the loaded model
ServableHandle<SavedModelBundle> bundle;
TF_RETURN_IF_ERROR(manager->GetServableHandle(
ServableRequest::Latest("default"), &bundle));