Use when when deploying a TensorFlow Serving instance for the NP Classifier
Scanned 9/12/2026
Install to Claude Code
npx -y skills add HolobiomicsLab/asb-skill-collections --skill model-layer-name-validation --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Model Layer Name Validation?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/holobiomicslab-model-layer-name-validation)More formats (shields.io, HTML) on the badges page.
---
name: model-layer-name-validation
description: Use when when deploying a TensorFlow Serving instance for the NP Classifier
or any model-agnostic service where client code hardcodes layer names; before running
inference pipelines; after model updates or configuration changes to catch layer
name drift early.
license: CC-BY-4.0
metadata:
edam_topics: []
tools:
- Python
- TensorFlow Serving
- docker-compose
license_tier: open
provenance_tier: literature
derived_from:
- doi: 10.1021/jacs.9b13786
title: CSCS / deep CNN natural-product annotation
evidence_spans:
- Make sure you have python installed
claims: []
provenance:
collection: https://w3id.org/holobiomicslab/asb-skill/collection/metabolomics/v2
assembled_by: scripts/collect_metabolomics_collection.py
sources:
- build: coll_cscs_deep_cnn_natural_product_annotation_cq
doi: 10.1021/jacs.9b13786
title: CSCS / deep CNN natural-product annotation
dedup_kept_from: coll_cscs_deep_cnn_natural_product_annotation_cq
schema_version: 0.2.0
attribution:
generator: AgenticScienceBuilder
original_doi: 10.1021/jacs.9b13786
all_source_dois:
- 10.1021/jacs.9b13786
zenodo_doi: 10.5281/zenodo.20794027
curators: []
promoter: Louis-Félix Nothias
sponsor: CNRS & Université Côte d'Azur
---
# model-layer-name-validation
## Summary
Validates that a TensorFlow Serving model exposes the correct input and output layer names by querying the /model/metadata endpoint and comparing against expected specifications. This ensures downstream code that depends on specific layer names will function correctly.
## When to use
When deploying a TensorFlow Serving instance for the NP Classifier or any model-agnostic service where client code hardcodes layer names; before running inference pipelines; after model updates or configuration changes to catch layer name drift early.
## When NOT to use
- Model is served via a non-TensorFlow Serving endpoint (e.g., TorchServe, KServe, or direct REST API without /model/metadata); the metadata endpoint is not exposed or is disabled.
- Layer names are dynamically generated or versioned at runtime and are not expected to match static specifications.
## Inputs
- TensorFlow Serving instance URL (host:port)
- Model name string
- Expected input layer name specification (array of strings)
- Expected output layer name specification (string)
## Outputs
- Verification report (JSON or text) documenting metadata endpoint response
- Layer name validation outcome (pass/fail)
- Extracted input layer names (array)
- Extracted output layer name (string)
## How to apply
Start the TensorFlow Serving container (typically via docker-compose), then send a GET request to the /model/metadata endpoint (e.g., http://localhost:8501/v1/models/<model_name>/metadata). Parse the JSON response to extract the input layer names and output layer name fields. Compare the extracted names against the expected specification: for NP Classifier, input layers must be exactly 'input_2048' and 'input_4096', and output layer must be exactly 'output'. If any mismatch is found, flag it and halt downstream inference; otherwise, document the metadata query result and validation outcome in a verification report.
## Related tools
- **TensorFlow Serving** (Exposes the /model/metadata endpoint and serves the model whose layer names are being validated)
- **docker-compose** (Orchestrates the TensorFlow Serving container deployment locally)
- **Python** (Used to parse JSON metadata response and perform layer name comparison)
## Examples
```
import requests; resp = requests.get('http://localhost:8501/v1/models/np_classifier/metadata'); metadata = resp.json(); inputs = metadata['model_spec'][0]['signature_def']['serving_default']['inputs']; outputs = metadata['model_spec'][0]['signature_def']['serving_default']['outputs']; assert list(inputs.keys()) == ['input_2048', 'input_4096']; assert list(outputs.keys()) == ['output']; print('Validation passed')
```
## Evaluation signals
- HTTP response status from /model/metadata endpoint is 200 and contains valid JSON
- Extracted input layer names array exactly matches expected specification (e.g., ['input_2048', 'input_4096'])
- Extracted output layer name string exactly matches expected specification (e.g., 'output')
- Verification report is generated and filed with timestamp and full metadata query result
- No downstream code failures due to layer name mismatches during inference
## Limitations
- Validation is a point-in-time check; layer names could change after this skill is applied without re-running validation
- The /model/metadata endpoint must be accessible and enabled in TensorFlow Serving configuration; some deployments may disable it for security reasons
- Does not validate the *structure* or *shape* of layers, only their names—inference may still fail due to incompatible tensor dimensions or data types
## Evidence
- [other] research_question: "What are the correct input and output layer names that must be validated when querying the /model/metadata endpoint exposed through TensorFlow Serving for the NP Classifier models?"
- [other] endpoint_and_layer_spec: "The /model/metadata endpoint exposes input layer names 'input_2048' and 'input_4096' and output layer name 'output'."
- [other] workflow_procedure: "Send a GET request to the TensorFlow Serving /model/metadata endpoint (typically http://localhost:8501/v1/models/<model_name>/metadata). 3. Parse the JSON response to extract input layer names and"
- [other] validation_check: "Validate that the input layers are exactly 'input_2048' and 'input_4096' and output layer is exactly 'output'."
- [readme] readme_layer_names: "Input layers' names should be "input_2048" and "input_4096"
Output layer's name should be "output""
- [readme] readme_metadata_change: "If the model input names change, then we need to change it in the code"
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!