SDKs overview
TensorFeed provides Software Development Kits (SDKs) and client libraries designed to facilitate programmatic interaction with its machine learning platform. These SDKs abstract the underlying RESTful API, offering language-specific interfaces for common operations such as model deployment, inference request handling, feature store management, and monitoring configuration. The availability of official SDKs for Python, Go, and Java aims to support a broad range of development environments and integration patterns within existing ML pipelines and applications.
The SDKs are structured to streamline development by providing high-level abstractions for complex MLOps tasks. For instance, developers can use the Python SDK to define a model, deploy it to a TensorFeed endpoint, and then send inference requests, all within their preferred programming language environment. This approach minimizes the need for direct HTTP request construction and JSON payload management, allowing engineers to focus on model logic and application integration. TensorFeed's documentation provides specific examples and API references for each SDK, detailing how to perform various operations and interact with different components of the platform, such as the Model Deployment Platform and Feature Store TensorFeed official documentation.
Official SDKs by language
TensorFeed offers officially supported SDKs for Python, Go, and Java. These libraries are maintained by TensorFeed and are intended for production use, providing stable interfaces and regular updates. Each SDK is designed to offer idiomatic access to the TensorFeed API within its respective language ecosystem.
| Language | Package Name | Installation Command | Maturity |
|---|---|---|---|
| Python | tensorfeed-sdk |
pip install tensorfeed-sdk |
Stable |
| Go | github.com/tensorfeed/go-sdk |
go get github.com/tensorfeed/go-sdk |
Stable |
| Java | com.tensorfeed:java-sdk |
Add to pom.xml (Maven) or build.gradle (Gradle) |
Stable |
These SDKs are designed to facilitate key functionalities of the TensorFeed platform, including:
- Model Deployment: Programmatically upload, version, and deploy machine learning models to scalable inference endpoints. This includes specifying resource requirements, auto-scaling policies, and A/B testing configurations.
- Feature Store Interaction: Retrieve and store features for online and offline inference, ensuring consistency across training and serving environments. The SDKs provide methods for reading and writing feature vectors, managing feature definitions, and handling feature transformations.
- ML Monitoring: Configure and retrieve metrics related to model performance, data drift, and operational health. Developers can set up alerts, fetch historical monitoring data, and integrate with external observability platforms.
- Inference Management: Send real-time or batch inference requests to deployed models and retrieve predictions. The SDKs handle request serialization, authentication, and response parsing, simplifying the client-side integration.
For detailed API references and method signatures for each SDK, developers can consult the TensorFeed developer documentation.
Installation
Installing the TensorFeed SDKs typically involves using the standard package managers for each respective language. Below are the common installation methods:
Python SDK
The Python SDK is distributed via PyPI. To install:
pip install tensorfeed-sdk
It is recommended to use a virtual environment to manage dependencies for Python projects. For example:
python -m venv tensorfeed-env
source tensorfeed-env/bin/activate
pip install tensorfeed-sdk
This ensures that the SDK and its dependencies do not conflict with other Python projects on your system. Python's package management is a common practice in ML development, as outlined in guides such as the Google Python Developer's Guide on tooling.
Go SDK
The Go SDK can be installed using the go get command, which fetches the module and its dependencies:
go get github.com/tensorfeed/go-sdk
After installation, you can import the package in your Go source files:
import "github.com/tensorfeed/go-sdk/client"
Go modules manage dependencies automatically, ensuring reproducible builds. More information on Go module management is available in the official Go documentation on managing dependencies.
Java SDK
The Java SDK is available through Maven Central. For Maven projects, add the following dependency to your pom.xml file:
<dependency>
<groupId>com.tensorfeed</groupId>
<artifactId>java-sdk</artifactId>
<version>1.0.0</version> <!-- Use the latest version -->
</dependency>
For Gradle projects, add this to your build.gradle file:
implementation 'com.tensorfeed:java-sdk:1.0.0' // Use the latest version
Ensure you replace 1.0.0 with the latest stable version available, which can be found in the TensorFeed Java SDK release notes.
Quickstart example
This Python quickstart example demonstrates how to initialize the TensorFeed client, deploy a simple scikit-learn model, and make an inference request. This example assumes you have an API key configured for authentication.
Python Quickstart: Deploying a Model and Making an Inference
import os
import joblib
from sklearn.linear_model import LogisticRegression
from tensorfeed_sdk.client import TensorFeedClient
from tensorfeed_sdk.models import ModelDefinition, DeploymentConfig
# 1. Initialize the TensorFeed client
# Ensure TENSORFEED_API_KEY environment variable is set
client = TensorFeedClient(api_key=os.environ.get("TENSORFEED_API_KEY"))
# 2. Train a dummy scikit-learn model
X_train = [[1, 2], [3, 4], [5, 6]]
y_train = [0, 1, 0]
model = LogisticRegression()
model.fit(X_train, y_train)
# 3. Save the model to a file (e.g., joblib format)
model_path = "my_logistic_model.joblib"
joblib.dump(model, model_path)
# 4. Define the model for TensorFeed
model_name = "my-first-model"
model_definition = ModelDefinition(
name=model_name,
runtime="python-sklearn-1.0", # Specify appropriate runtime
artifacts=[{"path": model_path, "name": "model.joblib"}]
)
# 5. Deploy the model
deployment_config = DeploymentConfig(
instance_type="tf.small",
min_replicas=1,
max_replicas=2
)
try:
deployed_model = client.models.deploy(
model_definition=model_definition,
config=deployment_config
)
print(f"Model '{deployed_model.name}' deployed successfully with ID: {deployed_model.id}")
# 6. Make an inference request
input_data = [[7, 8]]
predictions = client.models.predict(
model_id=deployed_model.id,
data=input_data
)
print(f"Inference result: {predictions}")
# 7. (Optional) Clean up: undeploy the model
# client.models.undeploy(model_id=deployed_model.id)
# print(f"Model '{deployed_model.name}' undeployed.")
except Exception as e:
print(f"An error occurred: {e}")
finally:
# Clean up local model file
if os.path.exists(model_path):
os.remove(model_path)
This example covers the basic workflow of model deployment and inference. Authentication typically relies on an API key, which should be securely managed, ideally through environment variables. More complex scenarios, such as A/B testing, canary deployments, or integration with the Feature Store, involve additional SDK methods and configuration options detailed in the TensorFeed quickstart guide.
Community libraries
While TensorFeed provides official SDKs, the ecosystem also benefits from community-driven libraries and integrations. These often extend functionality, provide specialized tooling, or offer integrations with other popular ML frameworks and platforms. Community contributions typically emerge from developers who use TensorFeed in specific contexts and build tools to address their unique requirements.
Examples of potential community contributions could include:
- TensorFlow/PyTorch Integrations: Libraries that simplify the packaging and deployment of models trained with specific versions of TensorFlow or PyTorch, potentially offering helper functions for model serialization or custom inference handlers.
- Data Science Notebook Extensions: Plugins or extensions for Jupyter or VS Code notebooks that provide direct integration with TensorFeed for deploying models or fetching monitoring data from within the notebook environment.
- CI/CD Pipeline Integrations: Scripts or GitHub Actions/GitLab CI templates that automate the deployment of models to TensorFeed as part of a continuous integration and continuous deployment pipeline.
- Monitoring Dashboards: Custom Grafana dashboards or Prometheus exporters that pull metrics from TensorFeed's monitoring API and visualize them in a custom observability stack.
Developers interested in contributing to or finding community-developed resources can typically look for open-source repositories on platforms like GitHub, often linked from the TensorFeed community page or within relevant discussion forums. Before using any community library in a production environment, it is advisable to review its documentation, community support, and maintenance status, as these are not officially supported by TensorFeed.