Model Endpoints

Comprehensive guide to managing model endpoint configurations in the View platform.

Overview

Model Endpoints manage AI model connections and configurations within the View platform. They provide centralized configuration for connecting to various AI model services, including Ollama, OpenAI, and other API-compatible model providers, enabling flexible AI model integration and management.

Model Endpoints are managed via the View server API and provide comprehensive configuration for model connections, including endpoint URLs, API types, timeouts, and additional metadata for optimal AI model integration and performance.

Model Endpoint Object Structure

Model Endpoint objects contain comprehensive configuration for AI model connections. Here's the complete structure:

{
  "GUID": "00000000-0000-0000-0000-000000000000",
  "TenantGUID": "00000000-0000-0000-0000-000000000000",
  "Name": "Ollama",
  "EndpointUrl": "http://ollama:11434/",
  "ApiType": "Ollama",
  "TimeoutMs": 30000,
  "Labels": [],
  "AdditionalData": "Description for Ollama",
  "Active": true,
  "CreatedUtc": "2025-10-08T19:39:59.160283Z"
}

Field Descriptions

  • GUID (GUID): Globally unique identifier for the model endpoint object
  • TenantGUID (GUID): Globally unique identifier for the tenant
  • Name (string): Display name for the model endpoint
  • EndpointUrl (string): URL endpoint for the AI model service
  • ApiType (string): Type of API interface (e.g., "Ollama", "OpenAI", "Anthropic")
  • TimeoutMs (integer): Request timeout in milliseconds
  • Labels (array): Array of labels for categorization and filtering
  • AdditionalData (string): Additional metadata or description for the endpoint
  • Active (boolean): Whether the endpoint is currently active and available
  • CreatedUtc (datetime): Timestamp when the endpoint was created

Enumerate Model Endpoints

Retrieves all model endpoints for a tenant using GET /v2.0/tenants/[tenant-guid]/modelendpoints. Returns a JSON array containing all model endpoint configurations.

Request Parameters

No additional parameters required beyond authentication.

Response

Returns an array of all model endpoints for the tenant, or a 404 Not Found error if no endpoints exist.

curl --location 'http://localhost:8000/v2.0/tenants/[tenant-guid]/modelendpoints' \
--header 'Authorization: [access-key]'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "[endpoint-url]", //endpoint
  "[tenant-guid]", //tenant Id
  "[access-key]" //access key
);

const enumerateModelEndpoints = async () => {
  try {
    const response = await api.ModelEndpoint.enumerate();
    console.log(response, 'Model endpoints fetched successfully');
  } catch (err) {
    console.log('Error fetching Model endpoints:', err);
  }
};

enumerateModelEndpoints();
import view_sdk
from view_sdk import configuration
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="endpoint-url",
    tenant_guid="tenant-guid",
    service_ports={Service.DEFAULT: 8000},
)

def enumerateModelEndpoints():
    """Enumerate all model endpoints."""
    model_endpoints = configuration.ModelEndpoint.enumerate()
    print(model_endpoints)

enumerateModelEndpoints()

Response

Returns an array of all model endpoints:

{
    "Success": true,
    "Timestamp": {
        "Start": "2025-10-09T07:37:41.550282Z",
        "TotalMs": 13.24,
        "Messages": {}
    },
    "MaxResults": 1000,
    "Skip": 0,
    "IterationsRequired": 1,
    "EndOfResults": true,
    "TotalRecords": 1,
    "RecordsRemaining": 0,
    "Objects": [
        {
            "GUID": "00000000-0000-0000-0000-000000000000",
            "TenantGUID": "00000000-0000-0000-0000-000000000000",
            "Name": "Ollama",
            "EndpointUrl": "http://ollama:11434/",
            "ApiType": "Ollama",
            "TimeoutMs": 30000,
            "Labels": [],
            "AdditionalData": "Description for Ollama",
            "Active": true,
            "CreatedUtc": "2025-10-08T19:39:59.160283Z"
        }
    ]
}

Read All Model Endpoints

Retrieves all model endpoints for a tenant using GET /v1.0/tenants/[tenant-guid]/modelendpoints. Returns a JSON array containing all model endpoint configurations with complete details.

Request Parameters

No additional parameters required beyond authentication.

Response

Returns an array of all model endpoints for the tenant, or a 404 Not Found error if no endpoints exist.

curl --location 'http://localhost:8000/v1.0/tenants/[tenant-guid]/modelendpoints' \
--header 'Authorization: [access-key]'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "[endpoint-url]", //endpoint
  "[tenant-guid]", //tenant Id
  "[access-key]" //access key
);

const readAllModelEndpoints = async () => {
  try {
    const response = await api.ModelEndpoint.readAll();
    console.log(response, 'All model endpoints fetched successfully');
  } catch (err) {
    console.log('Error fetching All model endpoints:', err);
  }
};

readAllModelEndpoints();
import view_sdk
from view_sdk import configuration
from view_sdk.sdk_configuration import Service
sdk = view_sdk.configure(
    access_key="default",
    base_url="endpoint-url",
    tenant_guid="tenant-guid",
    service_ports={Service.DEFAULT: 8000},
)

def retrieveAllModelEndpoints():
    """Retrieve all model endpoints."""
    model_endpoints = configuration.ModelEndpoint.retrieve_all()
    print("All ModelEndpoints:")
    print(model_endpoints)

retrieveAllModelEndpoints()

Response

Returns an array of all model endpoints with complete details:

[
    {
        "GUID": "00000000-0000-0000-0000-000000000000",
        "TenantGUID": "00000000-0000-0000-0000-000000000000",
        "Name": "Ollama",
        "EndpointUrl": "http://ollama:11434/",
        "ApiType": "Ollama",
        "TimeoutMs": 30000,
        "Labels": [],
        "AdditionalData": "Description for Ollama",
        "Active": true,
        "CreatedUtc": "2025-10-08T19:39:59.160283Z"
    }
]

Read Model Endpoint

Retrieves a specific model endpoint by GUID using GET /v1.0/tenants/[tenant-guid]/modelendpoints/[modelendpoint-guid]. Returns the complete endpoint configuration with all details.

Request Parameters

  • modelendpoint-guid (string, Path, Required): GUID of the model endpoint to retrieve

Response

Returns the model endpoint object with all configuration details if found, or a 404 Not Found error if the endpoint doesn't exist.

Note: The HEAD method can be used as an alternative to simply check the existence of the object. HEAD requests return either a 200 OK if the object exists, or a 404 Not Found if not. No response body is returned with a HEAD request.

curl --location 'http://localhost:8000/v1.0/tenants/[tenant-guid]/modelendpoints/[modelendpoint-guid]' \
--header 'Authorization: [access-key]'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "[endpoint-url]", //endpoint
  "[tenant-guid]", //tenant Id
  "[access-key]" //access key
);

const readModelEndpoint = async () => {
  try {
    const response = await api.ModelEndpoint.read('00000000-0000-0000-0000-000000000000');
    console.log(response, 'Model endpoint fetched successfully');
  } catch (err) {
    console.log('Error fetching Model endpoint:', err);
  }
};

readModelEndpoint();
import view_sdk
from view_sdk import configuration
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="endpoint-url",
    tenant_guid="tenant-guid",
    service_ports={Service.DEFAULT: 8000},
)

def readModelEndpoint():
    """Retrieve a specific model endpoint by GUID."""
    model_endpoint = configuration.ModelEndpoint.retrieve(
        "model-endpoint-guid"
    )
    print("Retrieved ModelEndpoint:")
    print(model_endpoint)
    
readModelEndpoint()

Response

Returns the complete model endpoint with configuration details:

{
  "GUID": "00000000-0000-0000-0000-000000000000",
  "TenantGUID": "00000000-0000-0000-0000-000000000000",
  "Name": "Ollama",
  "EndpointUrl": "http://ollama:11434/",
  "ApiType": "Ollama",
  "TimeoutMs": 30000,
  "Labels": [],
  "AdditionalData": "Description for Ollama",
  "Active": true,
  "CreatedUtc": "2025-10-08T19:39:59.160283Z"
}

Create Model Endpoint

Creates a new model endpoint using PUT /v1.0/tenants/[tenant-guid]/modelendpoints. Creates a new endpoint configuration with the specified parameters.

Request Parameters

  • Name (string, Required): Display name for the model endpoint
  • EndpointUrl (string, Required): URL endpoint for the AI model service
  • ApiType (string, Required): Type of API interface
  • TimeoutMs (integer, Optional): Request timeout in milliseconds (default: 30000)
  • Labels (array, Optional): Array of labels for categorization
  • AdditionalData (string, Optional): Additional metadata or description
  • Active (boolean, Optional): Whether the endpoint is active (default: true)

Request Body

{
    "Name": "My model endpoint",
    "EndpointUrl": "http://localhost:8000/",
    "BearerToken": null,
    "ApiType": "Ollama",
    "TimeoutMs": 30000,
    "AdditionalData": "My open text field",
    "Active": true
}

Response

Returns the created model endpoint object with all configuration details, or a 400 Bad Request error if the request is invalid.

curl --location --request PUT 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/modelendpoints' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "Name": "My model endpoint",
    "EndpointUrl": "http://localhost:8000/",
    "BearerToken": null,
    "ApiType": "Ollama",
    "TimeoutMs": 30000,
    "AdditionalData": "My open text field",
    "Active": true
}'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "<tenant-guid>", //tenant Id
  "default" //access key
);

const createModelEndpoint = async () => {
  try {
    const response = await api.ModelEndpoint.create({
      Name: 'Ollama',
      EndpointUrl: 'http://ollama:11434/',
      ApiType: 'Ollama',
      TimeoutMs: 30000,
      Labels: ['ollama', 'local'],
      AdditionalData: 'Description for Ollama',
      Active: true,
    });
    console.log(response, 'Model endpoint created successfully');
  } catch (err) {
    console.log('Error creating Model endpoint:', err);
  }
};


createModelEndpoint();
import view_sdk
from view_sdk import configuration
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="endpoint-url",
    tenant_guid="tenant-guid",
    service_ports={Service.DEFAULT: 8000},
)

def createModelEndpoint():
    """Create a new model endpoint."""
    model_endpoint = configuration.ModelEndpoint.create(
        Name="Ollama Local Endpoint",
        EndpointUrl="http://ollama:11434/",
        BearerToken=None,
        ApiType="Ollama",
        TimeoutMs=30000,
        AdditionalData="Local Ollama endpoint for testing",
        Active=True
    )
    print("Created ModelEndpoint:")
    print(model_endpoint)
    return model_endpoint

createModelEndpoint()

Response

Returns the created model endpoint with complete configuration:

{
  "GUID": "22222222-2222-2222-2222-222222222222",
  "TenantGUID": "00000000-0000-0000-0000-000000000000",
  "Name": "Ollama Local",
  "EndpointUrl": "http://ollama:11434/",
  "ApiType": "Ollama",
  "TimeoutMs": 30000,
  "Labels": ["local", "ollama"],
  "AdditionalData": "Local Ollama instance",
  "Active": true,
  "CreatedUtc": "2025-10-08T21:30:45.789012Z"
}

Update Model Endpoint

Updates an existing model endpoint using PUT /v1.0/tenants/[tenant-guid]/modelendpoints/[modelendpoint-guid]. Modifies the endpoint configuration with the provided parameters.

Request Parameters

  • modelendpoint-guid (string, Path, Required): GUID of the model endpoint to update

Request Body

{
    "Name": "My model endpoint",
    "EndpointUrl": "http://localhost:8000/",
    "BearerToken": null,
    "ApiType": "Ollama",
    "TimeoutMs": 30000,
    "AdditionalData": "My open text field",
    "Active": true
}

Response

Returns the updated model endpoint object with all configuration details, or a 404 Not Found error if the endpoint doesn't exist

curl --location --request PUT 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/modelendpoints/00000000-0000-0000-0000-000000000000' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "Name": "My model endpoint",
    "EndpointUrl": "http://localhost:8000/",
    "BearerToken": null,
    "ApiType": "Ollama",
    "TimeoutMs": 30000,
    "AdditionalData": "My open text field",
    "Active": true
}'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "<tenant-guid>", //tenant Id
  "default" //access key
);

const updateModelEndpoint = async () => {
  try {
    const response = await api.ModelEndpoint.update({
      GUID: 'b2df342b-d271-486e-a6ec-8d97721fd289',
      TenantGUID: '00000000-0000-0000-0000-000000000000',
      Name: 'Ollama Updated',
      EndpointUrl: 'http://ollama:11434/',
      ApiType: 'Ollama',
      TimeoutMs: 30000,
      Labels: ['updated', 'ollama'],
      AdditionalData: 'Updated description for Ollama',
      Active: true,
      CreatedUtc: '2025-10-08T19:39:59.160283Z',
    });
    console.log(response, 'Model endpoint updated successfully');
  } catch (err) {
    console.log('Error updating Model endpoint:', err);
  }
};


updateModelEndpoint();
import view_sdk
from view_sdk import configuration
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="endpoint-url",
    tenant_guid="tenant-guid",
    service_ports={Service.DEFAULT: 8000},
)

def updateModelEndpoint():
    """Update an existing model endpoint."""
    model_endpoint = configuration.ModelEndpoint.update(
        "00000000-0000-0000-0000-000000000000",
        Name="Ollama Local Endpoint [Updated]",
        EndpointUrl="http://localhost:8000/",
        TimeoutMs=60000,
        AdditionalData="Updated Ollama endpoint for testing"
    )
    print("Updated ModelEndpoint:")
    print(model_endpoint)

updateModelEndpoint()

Response

Returns the updated model endpoint with complete configuration:

{
    "GUID": "00000000-0000-0000-0000-000000000000",
    "TenantGUID": "00000000-0000-0000-0000-000000000000",
    "Name": "My model endpoint",
    "EndpointUrl": "http://localhost:8000/",
    "ApiType": "Ollama",
    "TimeoutMs": 30000,
    "Labels": [],
    "AdditionalData": "My open text field",
    "Active": true,
    "CreatedUtc": "2025-10-08T19:39:59.160283Z"
}

Check Model Endpoint Existence

Checks whether a model endpoint exists using HEAD /v1.0/tenants/[tenant-guid]/modelendpoints/[modelendpoint-guid]. Returns only HTTP status codes without response body for efficient existence verification.

Request Parameters

  • modelendpoint-guid (string, Path, Required): GUID of the model endpoint to check

Response

  • 200 OK: Model endpoint exists
  • 404 Not Found: Model endpoint does not exist
  • No response body: Only HTTP status code is returned

Note: HEAD requests do not return a response body, only the HTTP status code indicating whether the model endpoint exists.

curl --location --head 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/modelendpoints/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: ••••••'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "<tenant-guid>", //tenant Id
  "default" //access key
);

const modelEndpointExists = async () => {
  try {
    const response = await api.ModelEndpoint.exists('00000000-0000-0000-0000-000000000000');
    console.log(response, 'Model endpoint exists');
  } catch (err) {
    console.log('Error checking Model endpoint:', err);
  }
};


modelEndpointExists();
import view_sdk
from view_sdk import configuration
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="endpoint-url",
    tenant_guid="tenant-guid",
    service_ports={Service.DEFAULT: 8000},
)

def existsModelEndpoint():
    """Check if a model endpoint exists."""
    exists = configuration.ModelEndpoint.exists(
        "model-endpoint-guid"
    )
    print(exists)

existsModelEndpoint()

Response

  • 200 No Content: Model endpoint exists
  • 404 Not Found: Model endpoint does not exist
  • No response body: Only HTTP status code is returned

Note: HEAD requests do not return a response body, only the HTTP status code indicating whether the model endpoint exists.

Delete Model Endpoint

Deletes a model endpoint by GUID using DELETE /v1.0/tenants/[tenant-guid]/modelendpoints/[modelendpoint-guid]. Removes the endpoint configuration from the system.

Request Parameters

  • modelendpoint-guid (string, Path, Required): GUID of the model endpoint to delete

Response

  • 200 OK: Model endpoint deleted successfully
  • 404 Not Found: Model endpoint does not exist

Note: Deleting a model endpoint removes it from the system permanently. This action cannot be undone.

curl --location --request DELETE 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/modelendpoints/00000000-0000-0000-0000-000000000000' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "<tenant-guid>", //tenant Id
  "default" //access key
);

const deleteModelEndpoint = async () => {
  try {
    const response = await api.ModelEndpoint.delete('b2df342b-d271-486e-a6ec-8d97721fd289');
    console.log(response, 'Model endpoint deleted successfully');
  } catch (err) {
    console.log('Error deleting Model endpoint:', err);
  }
};

deleteModelEndpoint();
import view_sdk
from view_sdk import configuration
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="endpoint-url",
    tenant_guid="tenant-guid",
    service_ports={Service.DEFAULT: 8000},
)

def deleteModelEndpoint():
    """Delete a model endpoint."""
    result = configuration.ModelEndpoint.delete(
        "modelendpoint-guid"
    )
    print("Deleted ModelEndpoint:")
    print(result)

deleteModelEndpoint()

Response

Returns 204 No Content on successful deletion. No response body is returned.

Best Practices

When managing model endpoints in the View platform, consider the following recommendations for optimal AI model integration, performance, and system maintenance:

  • Endpoint Validation: Regularly test model endpoints to ensure they are accessible and responding correctly
  • Timeout Configuration: Set appropriate timeout values based on model complexity and network conditions
  • Label Management: Use descriptive labels to categorize and filter model endpoints for easier management
  • Active Status: Monitor and manage active status to control which endpoints are available for use
  • Security: Ensure endpoint URLs are secure and properly configured for production environments
  • Performance Monitoring: Track endpoint performance and availability for optimal AI model selection
  • Backup Configuration: Maintain backup endpoints for critical AI model services to ensure continuity

Next Steps

After successfully managing model endpoints, you can:

  • AI Model Integration: Use configured endpoints to integrate AI models into your applications and workflows
  • Performance Optimization: Monitor endpoint performance and optimize configurations for better response times
  • Service Management: Implement automated health checks and failover mechanisms for critical endpoints
  • Configuration Management: Use labels and metadata to organize and manage multiple model endpoints effectively
  • Platform Integration: Integrate model endpoints with other View platform services for comprehensive AI capabilities