Skip to content
NEWMarketplace and the trig8n Agent: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / Building Blocks & Utilities

Building Blocks & Utilities

Switch Between LLMs Automatically on Errors with OpenAI

When a chat message arrives, it tries one language model and automatically falls back to the next model in the list if an error occurs.

What it does

### Customer complaint - example I really *love* waiting two weeks just to get a keyboard that doesn’t even work. Great job. Any chance I could actually use the thing I paid for sometime this month?

The steps

  1. When chat message received
  2. Switch Model
  3. Set LLM index
  4. Increase LLM index
  5. No Operation, do nothing
  6. Check for expected error
  7. Loop finished without results
  8. Unexpected error
  9. Return result
  10. OpenAI 4o-mini
  11. OpenAI 4o
  12. OpenAI o1
  13. OpenAI Chat Model
  14. Validate response

15 steps in total.

Similar automations