Launch Week 3: Five days of launches

Resources for AI Connections

Attach MCP servers, prompt versions and hyperparameters to your AI connection's payload.

Overview

Resources are what your AI Connection brings to each call beyond the golden: MCP servers your model provider can call tools on, prompt versions, and hyperparameters. All three are sent to your endpoint as part of the payload, and prompts and hyperparameters are logged alongside your test runs and experiments, so you can trace every evaluation result back to the exact prompt versions and configuration values used to produce it. You attach them on the Resources tab of your AI connection.

Attach prompts, hyperparameters and MCP servers

MCP Servers

Attach MCP servers under MCP Servers so your model provider can call their tools while generating outputs. Only servers that run over HTTP can be attached to an AI connection.

Attached servers are only sent when your payload references mcp.servers. Put it where your provider expects its tools; inside a list, it expands to one entry per attached server:

{
  "model": "gpt-4.1",
  "input": golden.input,
  "tools": [mcp.servers]
}

The Payload below the selector defines the shape each server is rendered into. The default matches OpenAI's remote MCP tool:

{
  "type": "mcp",
  "server_label": mcp.server.label,
  "server_description": mcp.server.description,
  "server_url": mcp.server.url,
  "headers": mcp.server.headers,
  "require_approval": "never"
}

Change it to match your provider, using mcp.server.label, mcp.server.url, mcp.server.description and mcp.server.headers; keys whose value a server doesn't have are left out. Reset to default brings back the shape above.

Prompts

Associate prompts with your AI connection by clicking Add under Prompts and picking a version, commit, branch, or label. Branch and label references stay live, so every run uses the branch's current head commit or the label's current version. When running evaluations, these prompts will be attributed to each test run, letting you trace results back to the prompts used.

The prompts variable in your payload is a dictionary where each key maps to an object containing alias and version:

{
  "system": { "alias": "system-prompt", "version": "1.0.0" },
  "assistant": { "alias": "assistant-prompt", "version": "2.1.0" }
}

Here's an example of how your Python endpoint might handle the prompts dictionary:

from deepeval.prompt import Prompt

@app.post("/generate")
def generate(request: dict):
    # Pull different prompt versions using their keys
    system_info = request["prompts"]["system"]
    assistant_info = request["prompts"]["assistant"]

    system_prompt = Prompt(alias=system_info["alias"]).pull(version=system_info["version"])
    assistant_prompt = Prompt(alias=assistant_info["alias"]).pull(version=assistant_info["version"])

    # Use the prompts in your generation
    response = llm.generate(
        system=system_prompt.text,
        assistant=assistant_prompt.text,
        user=request["input"]
    )

    return {"output": response}

For more details on working with prompts, see Prompt Versioning.

Hyperparameters

Click Add under Hyperparameters to define optional hyperparameters as string key-value pairs. These are sent to your endpoint as part of the payload and are also logged in test runs and experiments, making it easy to track which configuration was used for each evaluation.

Hyperparameters are useful for passing model configuration values like temperature, model_name, or max_tokens to your AI app without hardcoding them into your endpoint. Since they're logged alongside test run and experiment results, you can compare how different hyperparameter values affect evaluation outcomes.

The hyperparameters variable in your payload is a dictionary where both keys and values are strings (reference a single value with hyperparameter.<key>, for example "temperature": hyperparameter.temperature):

{
  "temperature": "0.7",
  "model": "gpt-4o",
  "max_tokens": "1024"
}

Here's an example of how your Python endpoint might use hyperparameters:

@app.post("/generate")
def generate(request: dict):
    hyperparameters = request.get("hyperparameters", {})

    response = llm.generate(
        model=hyperparameters.get("model", "gpt-4o"),
        temperature=float(hyperparameters.get("temperature", "0.7")),
        max_tokens=int(hyperparameters.get("max_tokens", "1024")),
        user=request["input"]
    )

    return {"output": response}

Next Steps

With resources attached, configure how Confident AI reads your endpoint's response.

Scaling beyond prototype?For teams evaluating Confident AI in productionTalk to us

Last updated on

Built byConfident AI