GithubHelp home page GithubHelp logo

deadsg / gbnf-nice-parser Goto Github PK

View Code? Open in Web Editor NEW

This project forked from meta-introspector/gbnf-nice-parser

0.0 0.0 0.0 1.75 MB

llama.cpp gbml Menhir parser in OCaml

OCaml 99.43% Makefile 0.57%

gbnf-nice-parser's Introduction

We are developing an ocaml parser for the GBNF grammar language and intend on deeply integrating this into the llama.cpp code via embedding ocaml plugins which we have poc for.

introduction

GBNF is Another innovative ebnf format for defining grammar rules for constraining output of llms.

It is specified in text and implementation in C++ and it is not yet very easy to debug errors when developing grammars. we are developing a parser to parse the grammar, later we want to be able to convert and generate gramars and test code and train models based on grammars.

Here is the documentation of GBNF https://github.com/ggerganov/llama.cpp/blob/master/grammars/README.md Here is the source code that implements it https://github.com/ggerganov/llama.cpp/blob/a7aee47b98e45539d491071b25778b833b77e387/common/grammar-parser.cpp#L9C1-L9C1

And here is the grammar that I extracted from it test/test.gbnf

Goals

We will later proove that its implementation is valid and connect the code to the proof. we can use this proof to expand a bridge between the proof system and how the gbnf is used to restrict the output of the llm. The proof will guide our system to logically connect the grammar with the intent of the users to the source code to the execution of the code in a woven tapestry or tape. Later will will visualize the execution of the llm and show how the tesors contribute to the tokens and how those fit in the grammar and how the grammar constrains the output. We will allow the user to fine tune grammars on text to create more customized rules.

Overview

This is a high level overview of the entire project with its context.

the heros journey

the complexity of compilers

Math

Context free grammar (start, rules, non-terminals, terminals)

Left Right Parser using DFA Deterministic Finite Automaton

Shift/Reduce

Linear Algebra

HW

Raid Disks

Ram

GPU

CPU

Infra

Clusters

Services

Deployments

Code

Languages

Machine Languages and assemblers and toolchains

C/C++ Gcc, LLVM, compcert

Bash, Sed, Awk

yacc/lex

ocaml

menhir

tensorflow torch/keras

Large Language Models

Mistral

Large Language Driver

Llama.cpp

Large Language User Interface

ollama

gpt4all

lollms

gbnf-nice-parser's People

Contributors

jmikedupont2 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.