> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orq.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Simple deployment pattern

> Implement simple deployment architecture for LLM applications. Quick-start pattern for straightforward AI integration with minimal configuration overhead.

## Objective

The Simple Deployment architecture provides the most straightforward way to integrate Orq.ai into your application as an AI Gateway. This pattern serves as the primary entry point for routing LLM calls through the Orq.ai platform, enabling you to benefit from unified routing, monitoring, and security features while maintaining a clean separation between your application logic and AI model configurations.

<Info>
  To orchestrate multiple Deployments in application code, see [Chaining Deployments](/docs/tutorials/chaining-deployments).
</Info>

## Use Case

Simple Deployment is ideal for applications that need:

* **Single Model Integration**: Applications requiring one primary LLM interaction pattern.
* **Straightforward AI Features**: Chat interfaces, content generation, text processing workflows, and classification tasks.
* **Rapid Prototyping**: Quick integration for testing AI capabilities in existing systems.
* **Centralized Management**: Teams wanting to manage AI configurations outside of application code.

## Prerequisites

Before configuring a Simple Deployment, ensure you have:

* **Orq.ai Account**: Active workspace in the [AI Studio](https://my.orq.ai/auth/signup).
* **API Access**: Valid API key from [Workspace Settings > API Keys](/docs/ai-studio/organization/api-keys).
* **Model Access**: At least one model enabled in the [AI Gateway](/docs/ai-studio/ai-gateway/add-models), see [Using the AI Gateway](/docs/ai-studio/ai-gateway/add-models).

## Configuring a Deployment

To create a [Deployment](/docs/deployments/overview), head to the AI Studio:

* Choose a [Project](/docs/ai-studio/get-started/projects) and Folder and select the <kbd><Icon icon="plus" /></kbd> button.
* Choose Deployment.

You should see a modal to configure your initial deployment where you can:

<Frame caption="Configuring your Deployment, all parameters can be changed after creation.">
  <img src="https://mintcdn.com/orqai/2uKt1cknQn314wvb/images/docs/simple-deployment-setup.png?fit=max&auto=format&n=2uKt1cknQn314wvb&q=85&s=4ea687e13124886fe3b9c8b7258e12e3" alt="Create Deployment dialog with fields for Deployment Key set to myDeployment and Model set to claude-opus-4-8." width="1134" height="626" data-path="images/docs/simple-deployment-setup.png" />
</Frame>

## Prompting

Configure the Deployment using the [Prompt](/docs/ai-studio/prompts/prompts) template, or type a prompt directly into the Deployment.

There are three message types:

* **System**: Defines what the LLM does, setting its rules and persona.
* **User**: What the user asks the LLM to do, usually a question.
* **Assistant**: The LLM's response.

Most models require a user message but treat the system message as optional. You can call them with just a user message, but not with a system message alone. The Anthropic and Google models used in this cookbook both follow this pattern. OpenAI models can be called with only a system message.

<Info>
  To learn how to write good prompts, see [Prompting](/docs/ai-studio/prompts/prompt-engineering-guide).
</Info>

<Frame caption="Configure here your model and messages.">
  <img src="https://mintcdn.com/orqai/2uKt1cknQn314wvb/images/docs/simple-deployment-UI.png?fit=max&auto=format&n=2uKt1cknQn314wvb&q=85&s=e5d88b1a29ccae83d5544ca4b0f17d54" alt="Deployment Variant configuration screen showing the prompt template and model message settings." width="3270" height="1662" data-path="images/docs/simple-deployment-UI.png" />
</Frame>

Multiple parameters are available for your model, to learn more, see [Model Parameters](/docs/ai-studio/prompts/prompts#model-parameters).

<Info>
  Learn more about the possibilities of Prompts in Orq.ai, see [Creating a Prompt](/docs/ai-studio/prompts/prompts).
</Info>

<Check>
  Choose **Deploy** once ready, this will make your newly created [Deployment](/docs/deployments/overview) available through the API.
</Check>

## Integrating with the SDK

Choose your preferred programming language and install the corresponding SDK:

<CodeGroup>
  ```bash Bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
  # pip
  pip install orq-ai-sdk
  ```

  ```bash Bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
  # npm
  npm install @orq-ai/node
  ```
</CodeGroup>

Get your integration ready by initializing the SDK as follows:

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import os

  from orq_ai_sdk import Orq

  client = Orq(
    api_key=os.environ.get("ORQ_API_KEY", "__API_KEY__"),
  )
  ```

  ```typescript TypeScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const deployment = await client.deployments.invoke({
     key: "myDeployment",
     context: {
        environments: ["production"]
     },
     metadata: {
        "custom-field-name": "custom-metadata-value"
     }
  });
  ```
</CodeGroup>

## Calling the Deployment

To call the [Deployment](/docs/deployments/overview) within your integration, use the following calls:

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  generation = client.deployments.invoke(
    key="myDeployment",
    context={
      "environments": ["production"]
    },
    metadata={
      "custom-field-name": "custom-metadata-value"
    },
    identity={
      "id": "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
      "display_name": "Jane Doe",
      "email": "jane.doe@example.com",
    }
  )

  print(generation.choices[0].message.content)
  ```

  ```typescript TypeScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const deployment = await client.deployments.invoke({
    key: "myDeployment",
    context: {
      environments: ["production"]
    },
    metadata: {
      "custom-field-name": "custom-metadata-value"
    },
    identity: {
      id: "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
      displayName: "Jane Doe",
      email: "jane.doe@example.com",
    }
  });
  ```
</CodeGroup>

<Info>
  To pass messages at request time rather than relying only on the prompt configured in the AI Studio, include the optional `messages` parameter in `invoke`.
</Info>

<Info>
  To learn more about **Identities** see [Track usage by identity](/docs/analytics/identity).
</Info>

## Viewing Traces

Go to Observability > Traces to see every call made through the **Deployment**. Click a trace to inspect its span breakdown, including the input, model output, latency, tokens, and cost.

<Frame caption="View traces and look at the Deployment calls with span tree and model output details.">
  <img src="https://mintcdn.com/orqai/2uKt1cknQn314wvb/images/docs/simple-deployment-traces.gif?s=7ca6049915c57d451330abfb6aebc7fa" alt="Traces page for a myDeployment call" width="1200" height="621" data-path="images/docs/simple-deployment-traces.gif" />
</Frame>

<Info>
  To learn more about traces, see [Traces](/docs/observability/traces).
</Info>

<Check>
  You completed basic common architecture for a Simple Deployment, explore more of our other Architectures to see more complex architectures.
</Check>
