UniCraft Models

UniCraft AI Model Router - List models, providers, and smart routing strategies

Overview

The node "UniCraft Models" acts as an AI model router that interacts with the UniCraft API to retrieve information about AI models, providers, and smart routing strategies. It is useful for workflows that need to dynamically discover available AI models or providers, or obtain detailed metadata about a specific AI model before using it in subsequent steps.

A common scenario is when you want to list all AI models supported by UniCraft or get detailed information about a particular model (e.g., capabilities, provider details) to decide which model to use for text generation or other AI tasks. For example, you might use this node to fetch the latest available models and then route your data processing accordingly.

Specifically, the "Get Model Info" operation fetches detailed information about a single specified model.

Properties

Name Meaning
Model The AI model to get information about. Options are dynamically loaded from UniCraft API.

Output

The output JSON contains an object with the following structure for the "Get Model Info" operation:

{
  "operation": "getModelInfo",
  "model": "<model_name>",
  "info": { /* detailed information about the specified model */ }
}
  • operation: The string "getModelInfo" indicating the performed operation.
  • model: The name of the model queried.
  • info: An object containing detailed metadata about the model as returned by the UniCraft API. This may include provider info, capabilities, parameters, and other descriptive data.

The node does not output binary data.

Dependencies

  • Requires credentials for the UniCraft API, including:
    • A base URL for the UniCraft API endpoint.
    • An API key for authentication.
  • The node makes HTTP GET requests to the UniCraft API endpoints to fetch models and model information.
  • Proper configuration of these credentials in n8n is necessary for the node to function.

Troubleshooting

  • Missing Credentials: If the base URL or API key is missing or invalid, the node will throw an error stating that UniCraft credentials are required.
  • Invalid Model Name: Providing a model name that does not exist or is not recognized by the UniCraft API will result in an error from the API, which the node surfaces.
  • API Request Failures: Network issues, incorrect base URL, or expired API keys can cause request failures. The node throws errors with messages like "Failed to execute getModelInfo: ".
  • Loading Models Failure: When loading model options dynamically, if the response from the API is malformed or missing expected fields, the node throws an error indicating an invalid models response.

To resolve these issues:

  • Verify that the UniCraft API credentials are correctly set up in n8n.
  • Ensure the model name selected exists and is spelled correctly.
  • Check network connectivity and API endpoint accessibility.
  • Review API key validity and permissions.

Links and References

  • UniCraft API Documentation (refer to your UniCraft API provider for official docs)
  • n8n Documentation on creating and using credentials and HTTP Request nodes

Discussion