Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Llama.cpp as a core module #912

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from
Draft

Support Llama.cpp as a core module #912

wants to merge 18 commits into from

Conversation

heapwolf
Copy link
Member

@heapwolf heapwolf commented Feb 3, 2024

This PR will add JavaScript bindings for llama.cpp

import { Model, Context, Grammar } from 'socket:llm'

// include a model file in your project
const model = new Model('./mistral-7b-openorca.Q4_0.gguf')

// create a grammar
const grammar = new Grammar('...') // supports (json)gbnf

// create a context
const context = new Context({ model, grammar })

// use the context to evaluate the input and produce output
context.eval(tokens, params)

@heapwolf heapwolf changed the title Llama Support Llama.cpp as a core module Feb 3, 2024
@ansarizafar
Copy link

Google has recently released gemma models and https://github.com/google/gemma.cpp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants