Skip to main content
This guide covers how Reliant interacts with LLMs, common caveats, and provider-specific considerations.

How LLM Calls Work

When Reliant calls an LLM, it sends a structured request:
The LLM returns:
  • Text response (assistant message)
  • Tool calls (requests to use tools)
  • Stop reason (why it stopped: end_turn, tool_use, max_tokens)

Tool Call Requirements

Critical caveat: When the LLM requests a tool, the tool must exist in the available tools list.

Tool Matching Rules

  1. Tool calls reference tools by name
  2. The name must exactly match an available tool
  3. Tool inputs must match the tool’s schema
  4. Unknown tools cause execution errors

Best Practice

Use tools: true to include all default tools, or explicitly list needed tools:

System Messages

System prompts set the LLM’s behavior and context. They’re sent first in every request.

Where System Prompts Come From

  1. Workflow-level system_prompt input
  2. Preset configuration
  3. Node-level override on call_llm
These are combined, with node-level taking precedence.

System Prompt Best Practices

Tips:
  • Be specific about the task
  • Define output format expectations
  • Include examples if needed
  • Keep it focused (long prompts waste tokens)

Context and Tokens

Context Window

Each model has a maximum context window (total tokens for input + output):

Token Counting

Reliant tracks token usage per-thread. When context grows large:
  1. Compaction summarizes older messages
  2. Filtering reduces tool result verbosity
  3. Truncation as a last resort

Caching

Some providers cache repeated prefixes for efficiency: Reliant leverages caching automatically when available.

Provider Differences

Anthropic (Claude)

Strengths:
  • Excellent code understanding
  • Strong tool use
  • Good at following complex instructions
Caveats:
  • Tool calls must include thinking for Opus models
  • Rate limits vary by tier
  • No image generation

OpenAI (GPT-4)

Strengths:
  • Fast response times
  • Good general knowledge
  • Image understanding
Caveats:
  • Different tool call format (function calling)
  • JSON mode requires explicit enabling
  • Rate limits per-minute

Google (Gemini)

Strengths:
  • Large context window
  • Good multimodal support
  • Competitive pricing
Caveats:
  • Different safety filter behavior
  • Tool use syntax differences
  • Regional availability varies

Common Pitfalls

1. Tool Call Without Matching Tool

2. Context Overflow

3. Infinite Loops

4. Empty Tool Calls Array

5. Stop Reason Misunderstanding

Response Tools

Response tools force structured output from the LLM:
The LLM must call this tool to complete. Output is always:
Use for:
  • Routing decisions
  • Classification tasks
  • Structured data extraction
See Workflow Examples for patterns.

Debugging LLM Issues

Check the Raw Response

In the UI, expand a message to see:
  • Full prompt sent
  • Raw LLM response
  • Token counts
  • Timing information

Common Fixes


See also: CEL Expressions