Skip to content

Commit

Permalink
feat: Add llama.cpp web assembly support
Browse files Browse the repository at this point in the history
Primarily for calculating embeddings on the client

Signed-off-by: Gordon Smith <[email protected]>
  • Loading branch information
GordonSmith committed Aug 28, 2024
1 parent 841bddb commit 1e3330a
Show file tree
Hide file tree
Showing 32 changed files with 2,885 additions and 263 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.nyc_output/
/.vscode/c_cpp_properties.json
/.vscode/ipch
.vscode/c_cpp_properties.json
.vscode/ipch
.vscode/settings.json
.nx/
bin/
build/
Expand Down
4 changes: 1 addition & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"cmake.cmakePath": "${workspaceFolder}/scripts/cmake.sh",
"ecl.launchConfiguration": "not found",
"ecl.targetCluster": {}
"cmake.cmakePath": "${workspaceFolder}/scripts/cmake.sh"
}
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ set(EM_LINK_FLAGS
"-sUSE_GLFW=0"
"-sALLOW_UNIMPLEMENTED_SYSCALLS=1"
"-sINCOMING_MODULE_JS_API=\"['wasmBinary']\""
"--no-entry"
"--pre-js ${CMAKE_CURRENT_SOURCE_DIR}/src-cpp/src/pre.js"
"--post-js ${CMAKE_CURRENT_SOURCE_DIR}/src-cpp/src/post.js"
)
Expand Down Expand Up @@ -79,8 +80,8 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(PACK_MODE "-d")
endif ()

add_subdirectory(src-cpp)
add_subdirectory(packages/base91/src-cpp)
add_subdirectory(packages/expat/src-cpp)
add_subdirectory(packages/graphviz/src-cpp)
add_subdirectory(packages/llama/src-cpp)
add_subdirectory(packages/zstd/src-cpp)
1 change: 1 addition & 0 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default {
{ text: 'DuckDB', link: '/duckdb/src/duckdb/classes/DuckDB' },
{ text: 'Expat', link: '/expat/src/expat/classes/Expat' },
{ text: 'Graphviz', link: '/graphviz/src/graphviz/classes/Graphviz' },
{ text: 'Llama', link: '/llama/src/llama/classes/Llama' },
{ text: 'Zstd', link: '/zstd/src/zstd/classes/Zstd' },
]
}
Expand Down
3 changes: 3 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ features:
- title: GraphViz
details: The Graphviz layout algorithms take descriptions of graphs in a simple text language, and make diagrams in useful formats, such as images and SVG for web pages or display in an interactive graph browser.
link: /graphviz/src/graphviz/classes/Graphviz
- title: Llama
details: Inference of Meta's LLaMA model (and others) in pure C/C++.
link: /llama/src/llama/classes/Llama
- title: Zstd
details: Zstandard is a fast compression algorithm, providing high compression ratios and is backed by an extremely fast decoder.
link: /zstd/src/zstd/classes/Zstd
Expand Down
Loading

0 comments on commit 1e3330a

Please sign in to comment.