-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Description
I posted a similar issue in outlines, but here goes: we're building something complex and I think it would be helpful to have a marvin-like library that supports normal programming patterns with LLM's but also gives control over generation. This would provide high level pythonic abstractions like typed functions dynamically compiling grammars for return pydantic structs that would also allow you to drop down to customize generation either within or around these functions. This could be like high level mypy typed boundaries around sglang programs.
Marvin and funcchain do the high level (sort of), but you give up control. Marvin relies on json and/or function calling and is constrained to OAI models, funcchain uses dynamically compiled Lllamacpp grammar as well.
Analogy would be Pytorch:triton::funcchain/equivalent:sglang
Aside from the funcchain-like feature, for my use case I'd love to see:
- Custom unpacking of pydantic structs: Looping/ programmatically accessing fields into prompts
- Customizing generation of pydantic output structs
- Mixing and matching regular python types and pydantic inputs and outputs
- Stretch goal: Some sort of single dispatch (class based) or multiple dispatch polymorphism (https://github.com/beartype/plum)
- Our baseline MVP will be using OpenAI models initially. For this to be computationally feasible, I think we'd need function calling, which seems to be planned?
Anyway, is this something that would align with your vision, or better to have a high level interface library with multiple backends?
DSPY does this in some sense, but it's constrained to a pytorch like programming model, where this is more like "differentiable swift" or the "Julia just write your code and backprop through it" vision.
One thing that funcchain wants to do is have an "autotune" model where these functions are kicked to dpsy for compilation. I can see sometimes I'd like more control and sometimes I'd be happy to have dspy do some of the work for me.