tensorflow-model-deployment

Export, quantize, and serve TensorFlow models via SavedModel, TFLite, and TensorFlow Serving.

Updated Feb 27, 2026
One-click install
npx skills add https://github.com/gracefullight/cnn --skill tensorflow-model-deployment-gracefullight
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tensorflow-model-deployment
Source: https://github.com/gracefullight/cnn/tree/main/.agents/skills/tensorflow-model-deployment
Command: npx skills add https://github.com/gracefullight/cnn --skill tensorflow-model-deployment-gracefullight

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Moving a trained TensorFlow model from a notebook into production involves many error-prone steps: exporting to the right format, converting for mobile or edge devices, compressing with quantization, and standing up serving infrastructure. This Skill provides tested code patterns for each stage so models deploy correctly the first time. ## Core Features & Use Cases - SavedModel Export: Save Keras models with serving signatures, versioned export paths, and embedded preprocessing for consistent inference. - TFLite Conversion & Quantization: Convert models to TensorFlow Lite with float16, dynamic range, or full integer quantization using representative datasets for calibration. - Serving & Mobile Deployment: Run models with TensorFlow Serving in Docker, benchmark TFLite models on Android devices, and validate converted models against originals. - Use Case: You trained an image classifier and need it running on Android. Use this Skill to export a SavedModel, convert it to a quantized TFLite file, validate prediction parity, and benchmark it on a physical device. ## Quick Start Use the tensorflow-model-deployment skill to convert my trained Keras model to a quantized TFLite model and validate its predictions against the original.

Frequently Asked Questions about tensorflow-model-deployment

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert a Keras model to TensorFlow Lite?▼

Convert a Keras model to TFLite using tf.lite.TFLiteConverter.from_keras_model(model), then call converter.convert() and write the resulting bytes to a .tflite file. You can also convert from a SavedModel directory or concrete functions.

How to quantize a TensorFlow Lite model for mobile deployment?▼

Quantize a TFLite model by setting converter.optimizations = [tf.lite.Optimize.DEFAULT] for dynamic range quantization. For full integer quantization, also provide a representative_dataset generator and set supported_ops to TFLITE_BUILTINS_INT8 with int8 input and output types.

What is the difference between float16 and INT8 quantization?▼

Float16 quantization halves model size with minimal accuracy loss and suits GPU-delegated inference. INT8 quantization achieves maximum compression and faster CPU inference but requires a representative dataset for calibration to avoid accuracy degradation.

Can I deploy a JAX model to TensorFlow Lite?▼

Yes, JAX models convert to TFLite through orbax.export by wrapping the model in a JaxModule, defining a ServingConfig with input signatures and optional preprocessing, exporting to SavedModel, then converting with TFLiteConverter.from_saved_model.

Why does my TFLite model produce different predictions than the original?▼

Prediction differences usually come from quantization error or unsupported operations during conversion. Validate by comparing outputs on test data with mean and max absolute difference, and use a representative dataset for calibration to reduce divergence.

How do I serve a TensorFlow model with Docker?▼

Serve a TensorFlow model by exporting it to a versioned SavedModel path, then running the tensorflow/serving Docker image with the model directory mounted and MODEL_NAME set. Send prediction requests to the REST endpoint at /v1/models/model_name:predict.