Skip to main content

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.
To orchestrate multiple Deployments in application code, see Chaining Deployments.

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:

Configuring a Deployment

To create a Deployment, head to the AI Studio:
  • Choose a Project and Folder and select the button.
  • Choose Deployment.
You should see a modal to configure your initial deployment where you can:
Create Deployment dialog with fields for Deployment Key set to myDeployment and Model set to claude-opus-4-8.

Prompting

Configure the Deployment using the Prompt 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.
To learn how to write good prompts, see Prompting.
Deployment Variant configuration screen showing the prompt template and model message settings.
Multiple parameters are available for your model, to learn more, see Model Parameters.
Learn more about the possibilities of Prompts in Orq.ai, see Creating a Prompt.
Choose Deploy once ready, this will make your newly created Deployment available through the API.

Integrating with the SDK

Choose your preferred programming language and install the corresponding SDK:
# pip
pip install orq-ai-sdk
Get your integration ready by initializing the SDK as follows:
import os

from orq_ai_sdk import Orq

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

Calling the Deployment

To call the Deployment within your integration, use the following calls:
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)
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.
To learn more about Identities see Track usage by identity.

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.
Traces page for a myDeployment call
To learn more about traces, see Traces.
You completed basic common architecture for a Simple Deployment, explore more of our other Architectures to see more complex architectures.