testing.md 1.6 KB

Model Test Page

Overview

A sandbox for testing any model via the configured gateway proxy. The page lets a user select one model, then renders a category-specific tester (language, embedding, reranker).

Route

/utilities/testing/model

Optional query parameter ?model=<modelId> pre-selects the model on load.

The selected model determines which tester is shown:

  • language: chat tester
  • embedding: embedding tester
  • reranker: rerank tester

Model Selector

The selected model is shown in the top selector button (icon + name). If no model is selected, the page shows a placeholder prompt to select a model.

Language Mode (Chat)

Behavior:

  • Sends POST /api/workspaces/[workspaceId]/models/[id]/test with { messages, parameters }.
  • Assistant output is streamed and rendered incrementally.
  • While request is in-flight, Send becomes Stop and cancels via AbortController.
  • Clear session resets thread, system prompt, errors, and parameter values.

Embedding Mode

Behavior:

  • Sends POST /api/workspaces/[workspaceId]/models/[id]/test with a plain string body.
  • UI shows latency, dimensions, token usage, and raw vector data.

Reranker Mode

Behavior:

  • Sends POST /api/workspaces/[workspaceId]/models/[id]/test with { query, documents }.
  • UI displays sorted documents by relevance score and latency/token usage metadata.

API Behavior

The test endpoint routes requests by model category and returns category-appropriate responses:

  • language: streaming chat response
  • embedding: embedding result with metadata
  • reranker: ranked documents with metadata