Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Langroid has this kind of design (I’m the lead dev):

https://github.com/langroid/langroid

Quick tour:

https://langroid.github.io/langroid/tutorials/langroid-tour/



Looks great, MCP, supports multiple vector stores, and nice docs! How do you handle to subtle differences in tool call APIs?


Thanks!

Langroid enables tool-calling with practically any LLM via prompts: the dev just defines tools using a Pydantic-derived `ToolMessage` class, which can define a tool-handler, and additional instructions etc; The tool definition gets transpiled into appropriate system message instructions. The handler is inserted as a method into the Agent, which is fine for stateless tools. Or the agent can define its own handler for the tool in case tool handling needs agent state. In the agent response loop our code detects whether the LLM generated a tool, so that the agent's handler can handle it. See ToolMessage docs: https://langroid.github.io/langroid/quick-start/chat-agent-t...

In other words we don't have to rely on any specific LLM API's "native" tool-calling, though we do support OpenAI's tools and (the older, deprecated) functions, and a config option allows leveraging that. We also support grammar constrained tools/structured outputs where available, e.g. in vLLM or llama.cpp: https://langroid.github.io/langroid/quick-start/chat-agent-t...


Love it, I did something very similar, deriving a pydantic model from the function signature. Simpler without the native tool call API, even though occasional retries are required when the response fails to validate. Will have to give Langroid a try.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: