Available Model
All AI blocks currently use theqwen2.5:1.5b model, a compact on-device language model optimised for fast inference. Set the MODEL field on each AI block to qwen2.5:1.5b.
AI Action Blocks
Use these blocks as actions inside any automation stack to initiate an inference request. They send the prompt to the model and return immediately — they do not wait for the response inline.erlc_ask_ai
Sends the text provided in the
PROMPT input to the model specified in the MODEL field. Use this for straightforward prompts where the model’s default behaviour is acceptable.erlc_ask_ai_with_system
Sends a prompt alongside a system message. Connect a text value to
PROMPT for the user message and a separate text value to SYSTEM_PROMPT to set the model’s context and persona. Set MODEL in the field.AI generation is asynchronous. When
erlc_ask_ai (or erlc_ask_ai_with_system) runs, it dispatches the prompt to the model and execution of the current stack continues immediately with the next block. The model response does not arrive inline — it fires a separate erlc_when_ai_responds event when generation completes.AI Response Trigger
erlc_when_ai_responds
Fires when the model identified by the
MODEL field finishes generating a response. Place action blocks inside this trigger to handle the generated text — for example, sending the response as a Discord message. Read the generated text from the event context using the erlc_event_value block.Use Cases
Auto-reply to Discord Messages
Trigger on
discord_message_create, pipe the message content into erlc_ask_ai, then send the AI response back to the channel with erlc_bot_send_message.Summarise Emergency Calls
When an in-game call is logged, send the description to the AI and post the summary to a staff Discord channel.
Dynamic Announcements
Feed current server state (player count, active incidents) into a prompt and let the AI draft a contextual announcement.
Message Moderation
Send flagged player messages to the AI with a moderation-focused system prompt and take action based on the classification in the response.
JSON Example — Discord Message → Ask AI → Send Response
This example shows three connected pieces:- A
erlc_when_discord_eventtrigger listening fordiscord_message_create. - An
erlc_ask_aiblock that forwards the message content as a prompt. - A separate
erlc_when_ai_respondstrigger that sends the response back to Discord.
The two stacks above are separate trigger blocks on the canvas, not connected by a
next chain. Stack 1 runs when a Discord message arrives and dispatches the AI request. Stack 2 runs independently when the model responds. This is the correct pattern for all AI-driven automations in erlc.dev Studio.Tips for Better AI Output
Keep prompts specific
Keep prompts specific
The
qwen2.5:1.5b model performs best with short, specific prompts. Avoid open-ended instructions. Instead of "Help this player", write "In one sentence, tell this ERLC player how to contact staff: " + [player message].Use the system prompt to set a persona
Use the system prompt to set a persona
With
erlc_ask_ai_with_system, set a system prompt like "You are a strict ERLC moderator assistant. Reply only about in-game rules." to prevent the model from straying into unrelated topics.Rate-limit AI requests
Rate-limit AI requests
Wrap your
erlc_ask_ai block inside an erlc_throttle block to prevent a flood of Discord messages from triggering dozens of simultaneous AI requests. Set a reasonable SECONDS window (e.g. 5) and a unique KEY.Sanitise AI output before posting
Sanitise AI output before posting
Pass the AI response through
erlc_discord_escape before sending it to Discord to prevent any model-generated Markdown syntax from rendering unintentionally.