> ## Documentation Index
> Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-change-1791323909-75c753a.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Decision models

> Use SemIf through the LangSmith LLM Gateway for structured classification and scoring with the System One API.

Decision models classify or score text and return structured answers instead of generated chat messages. Call them through the [LLM Gateway](/langsmith/llm-gateway) with the System One API.

LangSmith provides an open source decision model, SemIf (`semif-qwen3.5-4b`), through the gateway for free through September 28, 2026.

<Note>
  SemIf is enabled for US organizations on Free, Developer, and Plus plans.
</Note>

## Quickstart

Set your [LangSmith API key](/langsmith/create-account-api-key):

```bash theme={null}
export LANGSMITH_API_KEY="<your-api-key>"
```

Then run a request:

<Tabs>
  <Tab title="Python">
    Install the TypeSafe SDK:

    ```bash theme={null}
    pip install typesafe-sdk
    ```

    ```python theme={null}
    import os

    from typesafe_sdk import Noul, TypeSafeClient

    client = TypeSafeClient(
        api_key=os.environ["LANGSMITH_API_KEY"],
        base_url="https://gateway.smith.langchain.com",
    )

    response = client.system_one(
        state="Hello!",
        model="semif-qwen3.5-4b",
        questions={
            "is_helpful": Noul(
                instructions="Does this explain what an LLM gateway does?"
            ),
        },
    )
    ```
  </Tab>

  <Tab title="JavaScript">
    Install the TypeSafe SDK:

    ```bash theme={null}
    npm install @typesafe-ai/sdk
    ```

    ```javascript theme={null}
    import { noul, TypeSafeClient } from "@typesafe-ai/sdk";

    const client = new TypeSafeClient({
      apiKey: process.env.LANGSMITH_API_KEY,
      baseURL: "https://gateway.smith.langchain.com",
    });

    const response = await client.systemOne({
      state: "Hello!",
      model: "semif-qwen3.5-4b",
      questions: {
        is_helpful: noul("Does this explain what an LLM gateway does?"),
      },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl https://gateway.smith.langchain.com/v1/systemone \
        -H "Authorization: Bearer $LANGSMITH_API_KEY" \
        -H "Content-Type: application/json" \
        -d '{
          "state": "Hello!",
          "model": "semif-qwen3.5-4b",
          "questions": {
            "is_helpful": {
              "type": "noul",
              "instructions": "Does this explain what an LLM gateway does?"
            }
          }
        }'
    ```
  </Tab>
</Tabs>

## Understand decision models

Pass the text to evaluate in `state` and between 1 and 32 named questions in `questions`. Decision models support 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.

## SemIf

You can select SemIf from the hosted models on the gateway home page to get a request example. For regional base URLs, see [Regional gateways](/langsmith/llm-gateway-direct-model-access#use-a-regional-gateway).

SemIf calls do not consume Gateway Credits. Gateway [access](/langsmith/llm-gateway-model-access-policies), [rate-limit](/langsmith/llm-gateway-rate-limit-policies), and [budget policies](/langsmith/llm-gateway-spend-policies) still apply.

## TypeSafe (Jev)

The gateway also supports TypeSafe decision models with bring-your-own-key (BYOK). Configure `TYPESAFE_API_KEY` as a workspace [provider secret](/langsmith/llm-gateway-admin-setup#1-add-provider-secrets). See [TypeSafe setup](/oss/python/integrations/providers/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:

<Tabs>
  <Tab title="Python">
    Install the TypeSafe SDK:

    ```bash theme={null}
    pip install typesafe-sdk
    ```

    ```python theme={null}
    import os

    from typesafe_sdk import Noul, TypeSafeClient

    client = TypeSafeClient(
        api_key=os.environ["LANGSMITH_API_KEY"],
        base_url="https://gateway.smith.langchain.com",
    )

    response = client.system_one(
        state="Hello!",
        model="typesafe/jev-1.13.0",
        questions={
            "is_helpful": Noul(
                instructions="Does this explain what an LLM gateway does?"
            ),
        },
    )
    ```
  </Tab>

  <Tab title="JavaScript">
    Install the TypeSafe SDK:

    ```bash theme={null}
    npm install @typesafe-ai/sdk
    ```

    ```javascript theme={null}
    import { noul, TypeSafeClient } from "@typesafe-ai/sdk";

    const client = new TypeSafeClient({
      apiKey: process.env.LANGSMITH_API_KEY,
      baseURL: "https://gateway.smith.langchain.com",
    });

    const response = await client.systemOne({
      state: "Hello!",
      model: "typesafe/jev-1.13.0",
      questions: {
        is_helpful: noul("Does this explain what an LLM gateway does?"),
      },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl https://gateway.smith.langchain.com/v1/systemone \
        -H "Authorization: Bearer $LANGSMITH_API_KEY" \
        -H "Content-Type: application/json" \
        -d '{
          "state": "Hello!",
          "model": "typesafe/jev-1.13.0",
          "questions": {
            "is_helpful": {
              "type": "noul",
              "instructions": "Does this explain what an LLM gateway does?"
            }
          }
        }'
    ```
  </Tab>
</Tabs>

## See also

* [Admin setup](/langsmith/llm-gateway-admin-setup): Grant gateway access without configuring a provider secret for SemIf.
* [TypeSafe integration](/oss/python/integrations/providers/typesafe): Use TypeSafe decision models through LangChain.

***

<div className="source-links">
  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to your agent of choice via MCP for real-time answers.
  </Callout>

  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/langsmith/llm-gateway-decision-models.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>
</div>
