Help understanding OpenRouter language models

AI-generated summary

The discussion revolves around understanding how OpenRouter language models interact with Discourse’s AI features, particularly regarding tool support. pfaffman expresses confusion about the distinction between “native tools” and “XML tools,” questioning whether OpenRouter’s tools are inherently XML-based and how they relate to API key configurations on the /admin/plugins/discourse-ai/ai-llms page. sam clarifies that OpenRouter models vary in native tool support—some support it, others don’t—and attempting to use native tools with unsupported models will cause failures. However, Discourse provides its own tool system, allowing access to features even when models lack native support. Falco adds that tools currently only affect the Discourse AI Bot, while features like AI Helper, Summarize, Search, and Automation do not rely on tools, making model tool support irrelevant for those functions.

I was going to reply but think that I’m not supposed to be able to reply there? (Or maybe it was something else that I once replied to taht wasn’t supposed to and perhaps I no longer have special powers).

Continuing the discussion from Configuring OpenRouter language models:

Sorry. I still don’t understand, and I know a lot more about at least Discourse than at least most people this is for (but likely know less about AI?). This is the first mention of “XML tools in this topic..”

The OpenRouter tools are XML tools? Normal People don’t care that XML is referring to some underlying details of how the API works, but I’m curious.

And “Native tools” refers to configuring API keys for Anthropic and OpenAI? On the /admin/plugins/discourse-ai/ai-llms page? And these XML tools, like the Native Tools both allow you to create personas that use some of these LLMs, right?

Open Router has some models with native tool support and some models that lack native tool support. It is documented on each model.

Attempting to make native tool calls to these unsupported models will crash the call.

Luckily, Discourse implements its own tool system, so you end up having access to features that a model provider does not natively implement.

Also worth mentioning the tools only affect Discourse AI Bot currently. For AI Helper, Summarize, Search, Automation we don’t use tools, so you can pick a model with or without support and it won’t matter there.