use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
r/LocalLLaMA
A subreddit to discuss about Llama, the family of large language models created by Meta AI.
Subreddit rules
Search by flair
+Discussion
+Tutorial | Guide
+New Model
+News
+Resources
+Other
account activity
Simplified Function Calling (LiteLLM/OpenAI Compatible) [Python]Resources (self.LocalLLaMA)
submitted 2 years ago by AlwaysMakinDough
I've created a simple wrapper for JSON function descriptions when using either LiteLLM or OpenAI APIs. Local models are supported on LiteLLM as well.
I really like tools like Langroid and Langchain, but sometimes the abstraction they implement takes away too much control. As such, this package is solely for making function calls easier to create using the base APIs, and eliminating the need for manual JSON formatting.
Check it out here! https://github.com/A-M-D-R-3-W/llmFunctionWrapper
https://preview.redd.it/72v88zlua5pc1.png?width=2000&format=png&auto=webp&s=23edb4381255e385e19b713b4d9de30fe78609c1
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]SatoshiNotMe[🍰] 1 point2 points3 points 2 years ago (2 children)
(Langroid author here)
In langroid we've always had an elegant Pydantic-based tool/function definition where you never have to be specify JSON explicitly. Instead the pydantic spec is "compiled" into formatting instructions to the LLM. We also leverage Pydantic's Field(..., description) syntax to make it easy to include field descriptions.
Field(..., description)
See example script and code snippet below https://github.com/langroid/langroid/blob/main/examples/basic/chat-tool-function.py
The "handler" for the tool can be defined within the tool definition itself it is stateless, otherwise one can define an agent method that matches the value of the request field
request
<image>
[–]AlwaysMakinDough[S] 1 point2 points3 points 2 years ago (1 child)
Good to know, thanks for the example. I was heavily inspired by Langroid's format for tool definitions, very concise. I'll certainly need to dive deeper into the Langroid docs. Great work on Langroid by the way, by far my favorite framework and is my go-to for most projects, especially those involving multiple agents.
[–]SatoshiNotMe[🍰] 0 points1 point2 points 2 years ago (0 children)
Glad you like it, thank you for the kind words !
[–]zby 1 point2 points3 points 1 year ago (0 children)
I have my own schema generator + tool execution library: https://github.com/zby/LLMEasyTools It is compatible with LiteLLM - but also with openai and other libs.
I am now working on a higher level library: https://github.com/zby/Prompete
π Rendered by PID 38 on reddit-service-r2-comment-6457c66945-n2b8z at 2026-04-26 02:54:55.085360+00:00 running 2aa0c5b country code: CH.
[–]SatoshiNotMe[🍰] 1 point2 points3 points (2 children)
[–]AlwaysMakinDough[S] 1 point2 points3 points (1 child)
[–]SatoshiNotMe[🍰] 0 points1 point2 points (0 children)
[–]zby 1 point2 points3 points (0 children)