<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/chat-modes-configuring-the-llm-for-each-turn-a86jijkry" -->

---
title: Chat Modes: Configuring the LLM for Each Turn | daily.dev
description: A Ruby developer describes a technique for building chat applications that mix quick questions with heavy multi-step tasks: routing each conversation turn...
canonical: https://daily.dev/posts/chat-modes-configuring-the-llm-for-each-turn-a86jijkry
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Chat Modes: Configuring the LLM for Each Turn | daily.dev
og:description: A Ruby developer describes a technique for building chat applications that mix quick questions with heavy multi-step tasks: routing each conversation turn...
og:url: https://daily.dev/posts/chat-modes-configuring-the-llm-for-each-turn-a86jijkry
og:image: https://api.daily.dev/og/posts/A86jijkrY.png
og:image:alt: Chat Modes: Configuring the LLM for Each Turn
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Chat Modes: Configuring the LLM for Each Turn

**[Ruby Flow](https://daily.dev/sources/rubyflow)** · 11 min read · 1 upvotes · 0 comments

## Summary

A Ruby developer describes a technique for building chat applications that mix quick questions with heavy multi-step tasks: routing each conversation turn through a cheap classifier that picks a 'mode' (instructions, tools, model, thinking effort) before the answering model runs. The piece contrasts one-size-fits-all chat configuration (which wastes latency, cost, and accuracy) with per-turn mode selection, compares routing latency and cost between Gemini 3.5 Flash-Lite and a new probability-returning judge model called Jev, and introduces an open-source gem, RubyLLM::Modes, built on top of RubyLLM to implement this pattern, including code examples for defining modes and a router with fallback handling.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://msg.samsonov.io/2026-09-26-ruby-llm-modes>

## Questions this post answers

### How can I configure different tools, models, and prompts for different types of messages in the same chat conversation?

Route each turn through a lightweight classifier that picks a named 'mode' before the answering model runs, where a mode bundles instructions, tools, model choice, and thinking effort under one description. The classifier reads the mode descriptions plus recent history and returns the best match, keeping the answering model's context limited to only what that turn needs.

_daily.dev surfaces patterns like per-turn mode routing for developers designing multi-purpose LLM chat flows._

### What is Jev and how does it compare to using a chat model like Gemini 3.5 Flash-Lite for classifying chat intent?

Jev is a judge-style model that returns a probability distribution over given answer options instead of generating text, making it well suited to routing decisions. In one comparison, Jev's median routing time was 351 ms versus 765 ms for Gemini 3.5 Flash-Lite, and cost per 1000 routing turns was $0.04 versus $0.29, with routing decisions matching almost 100% of the time.

_Developers picking a classifier for LLM routing can track cost and latency comparisons like this on daily.dev._

### What are the downsides of giving an LLM chat one shared configuration of tools and instructions for every kind of user turn?

A single shared configuration means every request carries all tools and skills even when a turn needs none of them, increasing latency and cost, and the model more often picks the wrong tool as more similar tools are exposed. It also forces one thinking effort for all cases and buries the tool/skill decision inside the model's own turn rather than as a separately testable step.

_daily.dev helps engineers weighing LLM chat architecture trade-offs like shared versus per-turn configuration._

## Similar posts on daily.dev

- [llmrb/llm.rb: Ruby toolkit for multiple Large Language Models \(LLMs\)](https://daily.dev/posts/llmrb-llm-rb-ruby-toolkit-for-multiple-large-language-models-llms--ei4xztrqw) · Ruby Flow · 0 upvotes · 0 comments
- [RubyLLM 1.14: From Zero to AI Chat App in Under Two Minutes](https://daily.dev/posts/rubyllm-1-14-from-zero-to-ai-chat-app-in-under-two-minutes-4pqmrussr) · RUBYLAND · 1 upvotes · 0 comments
- [DoorDash Builds LLM Conversation Simulator to Test Customer Support Chatbots at Scale](https://daily.dev/posts/doordash-builds-llm-conversation-simulator-to-test-customer-support-chatbots-at-scale-pijhailvz) · InfoQ · 1 upvotes · 0 comments
- [Google Updates Gemma 4: The best Small LLM is back \!\!](https://daily.dev/posts/google-updates-gemma-4-the-best-small-llm-is-back--tvolamyq7) · Medium · 1 upvotes · 0 comments

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#ruby](https://daily.dev/tags/ruby), [#prompt-engineering](https://daily.dev/tags/prompt-engineering)

[View this post on daily.dev](https://daily.dev/posts/chat-modes-configuring-the-llm-for-each-turn-a86jijkry)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Chat Modes: Configuring the LLM for Each Turn","url":"https://daily.dev/posts/chat-modes-configuring-the-llm-for-each-turn-a86jijkry","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/chat-modes-configuring-the-llm-for-each-turn-a86jijkry"},"datePublished":"2026-09-27T22:56:21.993Z","dateModified":"2026-09-27T22:57:04.649Z","description":"A Ruby developer describes a technique for building chat applications that mix quick questions with heavy multi-step tasks: routing each conversation turn...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/2468c1f949b19f44655595b6d6b71b5e?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/2468c1f949b19f44655595b6d6b71b5e?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Ruby Flow","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Ruby Flow","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/a21aaa8bcbbf448193a016895c90a0e1","url":"https://daily.dev/sources/rubyflow"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/chat-modes-configuring-the-llm-for-each-turn-a86jijkry","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ai-agents,ruby,prompt-engineering","timeRequired":"PT11M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Ruby Flow","item":"https://daily.dev/sources/rubyflow"},{"@type":"ListItem","position":3,"name":"Chat Modes: Configuring the LLM for Each Turn"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/chat-modes-configuring-the-llm-for-each-turn-a86jijkry#faq","mainEntity":[{"@type":"Question","name":"How can I configure different tools, models, and prompts for different types of messages in the same chat conversation?","acceptedAnswer":{"@type":"Answer","text":"Route each turn through a lightweight classifier that picks a named 'mode' before the answering model runs, where a mode bundles instructions, tools, model choice, and thinking effort under one description. The classifier reads the mode descriptions plus recent history and returns the best match, keeping the answering model's context limited to only what that turn needs. daily.dev surfaces patterns like per-turn mode routing for developers designing multi-purpose LLM chat flows."}},{"@type":"Question","name":"What is Jev and how does it compare to using a chat model like Gemini 3.5 Flash-Lite for classifying chat intent?","acceptedAnswer":{"@type":"Answer","text":"Jev is a judge-style model that returns a probability distribution over given answer options instead of generating text, making it well suited to routing decisions. In one comparison, Jev's median routing time was 351 ms versus 765 ms for Gemini 3.5 Flash-Lite, and cost per 1000 routing turns was $0.04 versus $0.29, with routing decisions matching almost 100% of the time. Developers picking a classifier for LLM routing can track cost and latency comparisons like this on daily.dev."}},{"@type":"Question","name":"What are the downsides of giving an LLM chat one shared configuration of tools and instructions for every kind of user turn?","acceptedAnswer":{"@type":"Answer","text":"A single shared configuration means every request carries all tools and skills even when a turn needs none of them, increasing latency and cost, and the model more often picks the wrong tool as more similar tools are exposed. It also forces one thinking effort for all cases and buries the tool/skill decision inside the model's own turn rather than as a separately testable step. daily.dev helps engineers weighing LLM chat architecture trade-offs like shared versus per-turn configuration."}}]}
```

