How to Configure an External AI (LLM) API in VectoTrail

In addition to the AI models that run locally on your device, VectoTrail can connect both the Chat and Autonomous Agents to a cloud-based AI provider. This allows you to use more powerful models, reduce on-device resource usage, or leverage an existing subscription with your preferred AI platform.

OpenAI-Compatible API Support

VectoTrail uses the industry-standard OpenAI Chat Completions API (/chat/completions), making it compatible with most leading AI providers, including:

Supported Features

  • Streaming Responses – Receive answers in real time as they are generated.

  • Vision Models – Attach images directly in chat. Images are sent using the OpenAI vision format and can be analyzed by models that support visual input.

  • Tool Calling (Function Calling) – Enables Autonomous Agents to perform real actions within your project, such as querying layers, analyzing data, creating records, and more.

Configuration Fields

FieldDescriptionBase URL (Endpoint)Enter the provider's API endpoint without adding /chat/completions. VectoTrail automatically appends the required path. Example: https://api.openai.com/v1.API KeyYour provider's authentication key. This field may be left blank for local deployments that do not require authentication, such as Ollama or LM Studio. API keys are stored locally and encrypted on your device.Model IDThe exact model identifier required by your provider. Examples include gpt-4o, llama-3.1-70b-versatile, and anthropic/claude-sonnet-4.5.

Setup Instructions

  1. Open AI Hub and select Chat or Autonomous Agents.

  2. Tap Models to open the model selection screen.

  3. Select Cloud API (OpenAI Compatible).

  4. Enter the Base URL, API Key (if required), and Model ID.

  5. Tap Test & Save. VectoTrail will perform a live connection test and validate your configuration before saving.

Troubleshooting

  • Authentication Error
    Verify that your API key is correct, active, and has sufficient credits available.

  • Model Not Found
    Ensure the Model ID exactly matches the identifier provided by your AI service.

  • Connection Error
    Confirm that the endpoint URL is correct and that any local server is reachable from the device.

Privacy & Security

When using an external AI provider, all requests are sent directly from your device to the selected service. Messages, images, and other transmitted data do not pass through VectoTrail servers. Users remain responsible for reviewing and complying with the privacy policies and terms of use of their chosen AI provider.

How to Create a TFLite Model Compatible with VectoTrail

VectoTrail allows you to import custom TensorFlow Lite (.tflite) object detection models for use in Computer Vision workflows. Typical use cases include weed detection, pest identification, disease monitoring, asset inspection, and other specialized field applications.

The platform supports two model formats:

  • MediaPipe models (recommended)

  • Standard TFLite models without metadata

Option 1: MediaPipe Models (Recommended)

Models exported with MediaPipe Model Maker or other tools that embed standard MediaPipe metadata are automatically recognized by VectoTrail.

The application reads class labels directly from the model, eliminating manual configuration and reducing the risk of import errors.

Whenever possible, this is the recommended deployment method.

Option 2: Standard TFLite Models

Models exported directly from frameworks such as YOLO/Ultralytics can also be imported, provided they follow the compatibility requirements described below.

Input Requirements

  • Tensor layout: NHWC ([1, height, width, 3])

  • Supported input types: FLOAT32, UINT8, or INT8

  • NCHW models are not supported

Output Requirements

  • Output tensor format must be [1, N, fields].

  • Non-Maximum Suppression (NMS) must already be embedded in the model graph.

  • N (maximum detections) must not exceed 1500.

  • fields must be between 6 and 200.

  • The first six values of each detection must follow this structure:

x1, y1, x2, y2, score, class

Additional fields, such as segmentation mask coefficients, are ignored during import.

Output tensors must use the FLOAT32 data type.

Exporting YOLO Models

When exporting from Ultralytics YOLO, enable built-in NMS to generate a compatible output format:

yolo export model=your_model.pt format=tflite nms=True imgsz=320

Adjust the image size (imgsz) to match the dimensions used during training.

Class Labels

Models without embedded metadata do not include human-readable class names.

During import, you may optionally provide a comma-separated list of labels that matches your model's class indices:

weed, pest, disease

If no labels are supplied, VectoTrail automatically assigns generic names such as Class 0, Class 1, and so on.

General Requirements

  • Maximum model size: 300 MB

  • File format: Valid TensorFlow Lite (.tflite)

Importing a Model into VectoTrail

  1. Open AI HubComputer Vision.

  2. Select Models.

  3. Choose Import Model.

  4. Select your .tflite file.

  5. If required, enter the class labels.

  6. Confirm the import.

Common Import Errors

Error MessageDescriptionRaw detection grid detectedThe model was exported without built-in NMS. Re-export using nms=True.Quantized output not supportedThe output tensor must use FLOAT32.Invalid input image formatThe model input is not in NHWC format [1,H,W,3].Unsupported input data typeOnly FLOAT32, UINT8, and INT8 input tensors are supported.Unrecognized output formatThe output tensor does not follow the required [1,N,6+] structure.Invalid TFLite fileThe file is corrupted or is not a valid TensorFlow Lite model.

Performance Recommendation

For the best experience on mobile devices, use compact models optimized for TensorFlow Lite and keep input resolutions as low as possible while maintaining acceptable accuracy. Smaller models generally provide faster inference times and lower battery consumption during field operations.