Skip to main content

GenAI LLM Component

The GenAI LLM component adds language skills to your agents. Write a precise prompt, select a model, connect inputs and outputs, then test and refine. Studio manages execution, security, observability, and file parsing so you can focus on building outcomes.

When To Use GenAI LLM

Start here when you need to summarise, generate, extract, or classify text. It’s the core building block for most agents and workflows.

What You Can Build Quickly

  • Summarise: Turn long documents into action-oriented briefs
  • Generate: Draft emails, replies, or outlines automatically
  • Extract: Pull values from text (names, dates, amounts) into JSON
  • Classify: Route tickets by priority, category, or sentiment
  • Process Files: Parse PDF or DOCX into searchable text

Step 1: Select a Model

Pick a built-in model or connect your own.

Context Windows

Always leave space in the context window for both your input and the model’s output.

FieldRequired?DescriptionNotes
ModelYesThe LLM that executes your promptIncludes GPT-5 family, Claude, Gemini, Groq, and others
Custom ModelNoYour own hosted endpoint or APIBest for specialised domains or large context sizes

Step 2: Write a Precise Prompt

The prompt tells the model what to do, the format to use, and any constraints.

Example Prompt
LLMpromptextractionJSON
You are an assistant that extracts structured insights. From {{Attachment.text}}, create a JSON object with: - "title": one-sentence summary - "key_points": 3 bullet points - "action": a next step recommendation Return only valid JSON.
Prompt Guidelines
  • Be explicit about the task and expected format
  • Reference inputs like {{Input}} or {{Attachment.text}}
  • Constrain tone, length, or schema if needed
  • Break complex requests into ordered steps

Step 3: Connect Inputs

Inputs are values you pass into the model.

InputRequired?DescriptionNotes
InputYesMain string or variable used in the promptInserted as {{Input}}
AttachmentNoFiles like PDF, DOCX, PNG, or JPGAuto-converted to text and available as Attachment.text
Reusable Inputs

Rename inputs, set data types, and define defaults so your component is reusable across workflows.

Step 4: Configure Model Settings

Start with defaults. Adjust only when you need to guide behaviour.

Maximum Output Tokens caps reply length and prevents cutoffs.

  • Short replies: 128 to 256
  • Long form: 1024 to 4096
  • Typical default: 2048 or 8192 by model
Sizing tip
Leave headroom in the context window for both input and output.
Example
Summarise {{Input}} in 120 to 150 words. Output markdown.

Quick Reference

SettingWhat It ControlsOpenAIAnthropicOther Providers
Maximum Output TokensCaps how many tokens the model can generate in one reply
VerbosityDetail level in reasoning outputGPT-5 only
Reasoning EffortTrade-off between deeper reasoning and speedGPT-5 only
PassthroughReturns raw, unformatted output
Use Agent System PromptApplies global system instructions consistently
Use Context WindowIncludes conversation history in requests
Use Web SearchLets the model fetch real-time facts
Top PProbability mass sampling for variety
Top KRestricts sampling to top K tokens
TemperatureControls randomness and creativity
Stop SequencesDefines strings where generation should end
Quick Presets

Extractor: Max Tokens 256, Stop Sequences set, Frequency Penalty 0.3
Summariser: Max Tokens 512–1024, Temperature 0.3, Top P 1.0
Brainstormer: Max Tokens 512, Temperature 0.8, Top P 0.9

Step 5: Define Outputs

Expose the model’s reply and map fields for downstream use. Custom outputs can be returned as text, markdown, html, or json, depending on downstream requirements.

OutputRequired?DescriptionExample
ReplyYesMain model outputParagraph, list, or JSON text
Custom OutputNoExtracted fields from the replyReply.summary, Reply.json.customer_id
What is unique in Smythos

You can declare new outputs like title and content without mentioning them in your prompt. Smythos will auto structure the reply so title contains only the title and content contains only the body. You can add other fields such as toc or keywords and control them purely through the output description. For example, if you need exactly 10 keywords, just state that in the output description and you are done.

Before You Go Live

You are close. Run a quick loop to make sure this component behaves the way you expect, then deploy it and keep an eye on it.

Quick Play Test
  • Open Debug Mode and run a real sample from your use case
  • Read the raw response and confirm your Custom Outputs render correctly
  • Try one bad input on purpose to see how the component fails and recovers
Review These Things
  • Cutoffs → raise Max Tokens or trim the input
  • Wobbly tone or drift → lower Top P or add a Frequency Penalty
  • Messy format → add a clear schema in the prompt and use Stop Sequences if your model supports them
  • Extra tokens spent on history → reduce Context Window or summarise prior turns
Test Your Component
Using {{Input}} or {{Attachment.text}}, return only this JSON: { "title": "<one sentence>", "key_points": ["<point 1>", "<point 2>", "<point 3>"], "action": "<one next step>" } If a field is missing, output an empty string instead of guessing.

Best Practices

  • Connect to the Code Component for validation or post processing
  • Add to your workflow and follow the Deploying Agents guide
  • Keep an eye on logs and usage in Observability. Look for spikes in token count, latency jumps, or empty fields
When To Revisit Settings

If your data changes or latency targets tighten, revisit Max Tokens, Top P, and Reasoning Effort. Small changes can reduce cost without hurting quality.

What's Next