Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

[Proposal] "Stable" C API #171

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

Closed
Ronsor opened this issue Mar 15, 2023 · 4 comments
Closed

[Proposal] "Stable" C API #171

Ronsor opened this issue Mar 15, 2023 · 4 comments
Labels
duplicate This issue or pull request already exists enhancement New feature or request

Comments

@Ronsor
Copy link
Contributor

Ronsor commented Mar 15, 2023

I propose refactoring main.cpp into a library (llama.cpp, compiled to llama.so/llama.a/whatever) and making main.cpp a simple driver program. A simple C API should be exposed to access the model, and then bindings can more easily be written for Python, node.js, or whatever other language.

This would partially solve #82 and #162.

Edit: on that note, is it possible to do inference from two or more prompts on different threads? If so, serving multiple people would be possible without multiple copies of model weights in RAM.

@bakkot
Copy link
Contributor

bakkot commented Mar 15, 2023

For anyone wanting to do this, see an initial attempt in #77, and in particular this comment on ggerganov's preferred approach. Should be pretty straightforward I think.

@v3ss0n
Copy link

v3ss0n commented Mar 15, 2023

It is already ongoing , check PR #77

@ggerganov
Copy link
Member

Yes, see the comment #77 (review) as @bakkot suggested. This is the way 🦙

@v3ss0n
Copy link

v3ss0n commented Mar 15, 2023

ah @bakkot beat me to it while i was writing. @Ronsor please close this , and the project have Discussion now https://github.com/ggerganov/llama.cpp/discussions

@ggml-org ggml-org locked and limited conversation to collaborators Mar 15, 2023
@gjmulder gjmulder converted this issue into discussion #177 Mar 15, 2023
@gjmulder gjmulder added enhancement New feature or request duplicate This issue or pull request already exists labels Mar 15, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
duplicate This issue or pull request already exists enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants