Skip to content

Adding Jinja support to LLamaSharp #1299

@vvdb-architecture

Description

@vvdb-architecture

Description

I've just finished implementing a Jinja interpreter, actually a re-implementation of the complete language accepted by Google's Minja project

It's fully-managed C# code in a single assembly. There are also XUnit tests. It supports a variety of methods to do bindings for the Jinja templates, including anonymous types, value types and Json elements.

Jinja support is currently missing, so I'd like to add this to the list of assemblies provided by LLamaSharp.

The reason why I'm hesitating is because I don't see a simple way to integrate this further.
As far as I understand the architecture, there is LLamaTemplate which is called by ToModelPrompt() (a static function), so the only way to integrate Jinja capability is via a complete re-implementation of ILLamaExecutor. Is this the way to proceed?

I can of course just add the assembly as a first PR while I'm figuring out the best way to proceed.
Let me know.

Vincent

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions