Manta Developers
GitHub
Menu

@manta-eu/horns-server/studio-model

Reference for @manta-eu/horns-server/studio-model in @manta-eu/horns-server 0.2.3.

Type Aliases

StudioModelChoice

StudioModelChoice = { model: LanguageModel; monitored: boolean; ok: true; } | { ok: false; reason: string; }

monitored says whether the call lands in the AI Gateway’s log.


StudioModelEnv

StudioModelEnv = object

Properties

CLOUDFLARE_AI_GATEWAY_TOKEN?

optional CLOUDFLARE_AI_GATEWAY_TOKEN?: string

CLOUDFLARE_ENV?

optional CLOUDFLARE_ENV?: string

GOOGLE_VERTEX_LOCATION?

optional GOOGLE_VERTEX_LOCATION?: string

GOOGLE_VERTEX_MODEL?

optional GOOGLE_VERTEX_MODEL?: string

GOOGLE_VERTEX_PROJECT?

optional GOOGLE_VERTEX_PROJECT?: string

HORNS_CRITIC_BASE_URL?

optional HORNS_CRITIC_BASE_URL?: string

HORNS_CRITIC_MODEL?

optional HORNS_CRITIC_MODEL?: string

HORNS_LLM_BASE_URL?

optional HORNS_LLM_BASE_URL?: string

HORNS_LLM_MODEL?

optional HORNS_LLM_MODEL?: string

VERTEX_SERVICE_ACCOUNT?

optional VERTEX_SERVICE_ACCOUNT?: string

Variables

aiGatewayHost

const aiGatewayHost: "gateway.ai.cloudflare.com" = "gateway.ai.cloudflare.com"

Functions

criticModel()

criticModel(env, fetcher?): StudioModelChoice

The critic: its own route where one is named, the Studio’s own model otherwise. It judges a picture, so name a route where the Studio’s model has no image input.

Parameters

env

StudioModelEnv

fetcher?

(input, init?) => Promise<Response>

Returns

StudioModelChoice


studioModel()

studioModel(env, fetcher?): StudioModelChoice

Vertex where a realm’s agreement bars the gateway, the gateway otherwise.

Parameters

env

StudioModelEnv

fetcher?

(input, init?) => Promise<Response>

Returns

StudioModelChoice