Comments (3)
I understand the request and I think OAI did a great job with their function calling models. I am uncertain if support for this in LMQL makes sense, since it is a very vendor-specific API, that will be hard generalize in a model-agnostic way.
I am open to design proposal however. It would be great to somehow abstract their implementation away, and to provide a common interface, that also works e.g. for Gorilla models or other forms of more open function calling.
from lmql.
I understand the request and I think OAI did a great job with their function calling models. I am uncertain if support for this in LMQL makes sense, since it is a very vendor-specific API, that will be hard generalize in a model-agnostic way.
I am open to design proposal however. It would be great to somehow abstract their implementation away, and to provide a common interface, that also works e.g. for Gorilla models or other forms of more open function calling.
I did a bit more research on this issue. There are several major implementations of function/tool calling:
- OpenAI Parallel Function Calling
- Gorilla/OpenFunctions
- Transformers Agents (Huggingface)
- open-interpreter
- litellm
There are of course others. Every agentic framework has some version of this. All of them I have looked at so far have standardized around the OpenAI parallel function calling API, and use the openai
Python package for integration, both for calls to openai and function calling via local LLMs.
This standardization is not confined to agentic frameworks. The fact that Gorilla and litellm are depending on the openai spec for all function calling are pretty good signals.
I would have already submitted a PR but the lmql oai client is more complex than most other packages' openai integrations. The reason for that is obvious. Regardless, I have yet to have time to sit down and take it all in.
Note: As I vaguely recall from my first attempt, logit_bias
and/or logprobs
parameters did not have any effect on the output of a function/tool definition and/or call. I could be misremembering, so citation and/or example needed because that doesn't sound right. Streaming/chunks is supported.
from lmql.
Another thought: check the prompt templates of gorilla and litellm's function-calling for local models.
from lmql.
Related Issues (20)
- Possible error with nests of nested queries in Python HOT 2
- Proposal for new KeyWord `using`
- Model Repeats Same Phrase HOT 1
- `--layout` ignores CUDA_VISIBLE_DEVICES
- cannot import name 'OutputGraph' from 'torch._dynamo.output_graph' HOT 1
- Add a normal llama.cpp server endpoint option. HOT 1
- Batched OpenAI request worker async race (AssertionError: bopenai...)
- Use external files and avoid quoting?
- Docs for cache behaviour HOT 1
- lmql run not working for llama models even though same script works in playground and also for openai models HOT 1
- `lmql serve-model llama.cpp:<PATH TO WEIGHTS>.gguf` only works with an absolute path
- Azure OpenAI API instruct model not ERROR on query HOT 1
- [Question] Whats is the default decoder used in queries ? HOT 1
- FileNotFoundError: [WinError 2] 系统找不到指定的文件。
- python AttributeError: 'NoneType' object has no attribute 'get_event_loop', lmql == 0.7.3 HOT 1
- Llama 3 GGUF Tokenizer HOT 5
- Make STOPS_AT work with Tokens HOT 1
- Difficulty getting started! HOT 3
- Support for Ollama
- Support for GPT-4o
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lmql.