Skip to main content
The LLM Gateway is in beta.
Decision models return structured answers instead of generated chat messages. Use them through the LLM Gateway to classify text and score it against a rubric. The System One API accepts state and named questions, then returns an answer for each question.

SemIf

SemIf is a LangChain-hosted decision model with the model ID semif-qwen3.5-4b. It is free through September 28, 2026. No provider key or Gateway Credits purchase is required.

Prerequisites

  • Your organization must be on a paid, non-Enterprise plan with SemIf enabled. Availability depends on your organization and region.
  • You need a workspace-scoped LangSmith API key with gateway:invoke and workspaces:read permissions. See Admin setup to grant access.

Call SemIf

Call semif-qwen3.5-4b through POST /v1/systemone, not Chat Completions, Messages, or Responses. Set LANGSMITH_API_KEY to your workspace-scoped LangSmith API key. The TypeSafe SDKs append /v1/systemone to the base URL. Set base_url in Python or baseURL in JavaScript to https://gateway.smith.langchain.com, without /v1.
Install the TypeSafe SDK:
Pass the text to evaluate in state and between 1 and 32 named questions in questions. SemIf supports three question types:
  • noul: Returns the probability that the answer is true.
  • choice: Classifies the state into one of the supplied options.
  • score: Scores the state against a rubric.
The response contains answers keyed by question name rather than a chat message. Streaming is not supported. You can also select SemIf from the hosted models on the gateway home page to get a request example. For regional base URLs, see Regional gateways.

Apply gateway policies

SemIf calls do not consume Gateway Credits. Gateway access, rate-limit, and budget policies still apply.

TypeSafe

The gateway also supports TypeSafe decision models with bring-your-own-key (BYOK). Configure TYPESAFE_API_KEY as a workspace provider secret. See TypeSafe setup to create a key and install the LangChain integration. Set LANGSMITH_API_KEY to your workspace-scoped LangSmith API key. The typesafe/ prefix routes the request through your workspace’s TypeSafe provider secret, not the hosted SemIf model. Do not pass your TypeSafe API key as the SDK’s api_key or apiKey when calling the gateway. Use the gateway base URL without /v1 for the SDKs:
Install the TypeSafe SDK:

See also