Getting started overview
This guide provides a structured approach to initiating development with TensorFeed, focusing on the steps required to deploy a machine learning model and execute your first inference request. The process covers account creation, API key generation, and the fundamental code required to interact with the platform. TensorFeed is designed for real-time model serving, scalable ML infrastructure, and feature management, making it suitable for deploying various machine learning models quickly TensorFeed documentation.
The core workflow involves:
- Account Setup: Creating a TensorFeed account and selecting an appropriate plan.
- API Key Generation: Obtaining the necessary credentials for programmatic access.
- Model Deployment: Uploading and deploying a machine learning model to the TensorFeed platform.
- First Inference Request: Sending data to your deployed model and receiving predictions.
A quick reference table outlines these initial steps:
| Step | What to Do | Where |
|---|---|---|
| 1. Sign Up | Create a new TensorFeed account. | TensorFeed homepage |
| 2. Choose Plan | Select a Developer (free) or paid plan. | TensorFeed pricing page |
| 3. Generate API Key | Access your dashboard to create an API key. | TensorFeed Dashboard > Settings > API Keys |
| 4. Deploy Model | Upload and deploy a compatible ML model. | TensorFeed Dashboard > Models > Deploy New Model |
| 5. Make Request | Use an SDK or cURL to send an inference request. | Your development environment |
Create an account and get keys
To begin using TensorFeed, you must first create an account. Navigate to the TensorFeed homepage and follow the registration process. TensorFeed offers a Developer Plan, which is free and provides resources for up to 5 deployed models and 10,000 inference requests per month, suitable for initial exploration and development TensorFeed pricing details. Paid plans, such as the Standard Plan, start at $49/month and offer increased limits.
After account creation and plan selection, the next step is to generate your API keys. These keys authenticate your requests to the TensorFeed API. Access your TensorFeed dashboard, typically found at dashboard.tensorfeed.com. Within the dashboard, locate the "Settings" or "API Keys" section. Here, you can generate a new API key. It is critical to store this key securely, as it grants access to your TensorFeed resources. Best practices for API key management include using environment variables for storage rather than hardcoding them directly into your application code, as recommended by security guidelines for API keys Google API key best practices.
TensorFeed API keys typically consist of a public key and a secret key. The public key may be used for identifying your account in some contexts, while the secret key is essential for authenticating requests. Keep your secret key confidential.
Your first request
Before making an inference request, you need to have a model deployed on the TensorFeed platform. This involves uploading your trained model (e.g., a TensorFlow, PyTorch, or Scikit-learn model) through the TensorFeed dashboard or using the SDKs. Once deployed, each model receives a unique endpoint URL.
TensorFeed provides SDKs for Python, Go, and Java to facilitate interaction with its API. The following example demonstrates how to make a simple inference request using the Python SDK, which is TensorFeed's primary language for examples:
import os
from tensorfeed import Client
# Replace with your actual API key and model ID
API_KEY = os.environ.get("TENSORFEED_API_KEY")
MODEL_ID = "your_deployed_model_id"
if not API_KEY:
raise ValueError("TENSORFEED_API_KEY environment variable not set.")
client = Client(api_key=API_KEY)
def make_inference_request():
# Example input data for a hypothetical model
# Adjust this dictionary to match your model's expected input schema
input_data = {
"instances": [
{"feature_1": 10.5, "feature_2": "category_A"},
{"feature_1": 22.1, "feature_2": "category_B"}
]
}
try:
response = client.models.infer(model_id=MODEL_ID, data=input_data)
print("Inference successful:")
print(response.json())
except Exception as e:
print(f"Error during inference: {e}")
if __name__ == "__main__":
make_inference_request()
To run this code:
- Install the Python SDK:
pip install tensorfeed-sdk - Set Environment Variable: Set your TensorFeed API key as an environment variable:
export TENSORFEED_API_KEY="your_api_secret_key". - Replace
MODEL_ID: Obtain the specific ID for your deployed model from the TensorFeed dashboard. - Adjust
input_data: Modify theinput_datadictionary to match the schema that your deployed model expects. Incorrect input schema is a common cause of errors. - Execute the script: Run the Python script.
Upon successful execution, the script will print the inference results returned by your deployed model.
Alternatively, you can use a cURL command for a quick test, especially for RESTful API interactions:
curl -X POST \
https://api.tensorfeed.com/v1/models/your_deployed_model_id/infer \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TENSORFEED_API_KEY" \
-d '{ "instances": [{"feature_1": 10.5, "feature_2": "category_A"}] }'
Remember to replace your_deployed_model_id and YOUR_TENSORFEED_API_KEY with your actual values, and adjust the -d payload to match your model's input requirements.
Common next steps
After successfully making your first inference request, several common next steps can enhance your TensorFeed integration:
- Model Versioning and Updates: Learn how to manage different versions of your models. TensorFeed supports deploying new versions without downtime, allowing for A/B testing or canary deployments TensorFeed model management guide.
- Monitoring and Logging: Explore TensorFeed's built-in monitoring tools to track model performance, latency, and resource utilization. Set up alerts for anomalies.
- Feature Store Integration: If your application uses a feature store, integrate it with TensorFeed to ensure consistent feature engineering and reduce data drift. TensorFeed offers its own Feature Store product.
- Scalability and Auto-scaling: Configure auto-scaling rules for your deployed models to handle varying loads efficiently, optimizing cost and performance.
- Security Enhancements: Implement more advanced security measures, such as fine-grained access control for different team members or integrating with your existing identity provider.
- SDK Exploration: Dive deeper into the specific SDK (Python, Go, or Java) you are using to discover more advanced functionalities, such as batch inference, model retraining triggers, or custom pre/post-processing hooks.
- CI/CD Integration: Integrate TensorFeed deployment and monitoring into your continuous integration/continuous deployment (CI/CD) pipelines for automated ML model lifecycle management.
- Error Handling: Implement robust error handling in your application to gracefully manage API errors, network issues, or model prediction failures.
Troubleshooting the first call
Encountering issues during your initial API call is common. Here are some troubleshooting steps:
- API Key Validation: Double-check that your API key is correct and has the necessary permissions. An invalid key will typically result in a
401 Unauthorizederror. Ensure you are using the secret key, not a public ID. - Model ID Accuracy: Verify that the
MODEL_IDused in your request exactly matches the ID of a deployed model in your TensorFeed account. A mismatch will likely lead to a404 Not Founderror or a specific model not found error from the API. - Input Data Schema: The most frequent issue is incorrect input data. The JSON payload sent to the
/inferendpoint must precisely match the schema your deployed model expects. Common errors include:- Missing required fields.
- Incorrect data types (e.g., sending a string when a number is expected).
- Mismatched array dimensions or structure.
Consult your model's documentation or the TensorFeed dashboard for the expected input schema. The API will often return a
400 Bad Requestwith details about schema validation failures. - Network Connectivity: Ensure your development environment has stable internet access and can reach
api.tensorfeed.com. Proxy settings or firewalls can sometimes block outgoing requests. - SDK Version: Ensure you are using the latest version of the TensorFeed SDK. Outdated SDKs might have compatibility issues with the latest API changes. Update using
pip install --upgrade tensorfeed-sdkfor Python. - Error Messages: Pay close attention to the error messages returned by the TensorFeed API. They are designed to be informative and guide you toward a solution. For example, a
500 Internal Server Errorcould indicate an issue with the model itself during inference. - TensorFeed Dashboard Logs: Check the logs for your deployed model within the TensorFeed dashboard. These logs often contain detailed information about requests received, processing, and any errors encountered on the server side, which can be invaluable for debugging TensorFeed monitoring and logs.
- Authentication Header: For cURL or direct HTTP requests, ensure the
Authorization: Bearer YOUR_TENSORFEED_API_KEYheader is correctly formatted and present.