Skip to content

make "serve" library #14331

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ else()
add_subdirectory(main)
add_subdirectory(perplexity)
add_subdirectory(quantize)
add_subdirectory(serve)
if (LLAMA_BUILD_SERVER)
add_subdirectory(server)
endif()
Expand Down
37 changes: 37 additions & 0 deletions tools/serve/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# serve

set(TARGET llama-serve)

add_library(${TARGET}
serve.cpp
srvutils.hpp
)

target_include_directories(${TARGET} PUBLIC .)
target_include_directories(${TARGET} PRIVATE ${CMAKE_SOURCE_DIR})

target_link_libraries(${TARGET} PRIVATE common mtmd)

target_compile_features(${TARGET} PRIVATE cxx_std_17)

if (BUILD_SHARED_LIBS)
set_target_properties (${TARGET} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_compile_definitions(${TARGET} PRIVATE LLAMA_BUILD)
target_compile_definitions(${TARGET} PUBLIC LLAMA_SHARED)
endif()

set(serve_PUBLIC_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/serve.h
${CMAKE_CURRENT_SOURCE_DIR}/serve.hpp
${CMAKE_CURRENT_SOURCE_DIR}/utils.hpp
)

set_target_properties(${TARGET}
PROPERTIES
PUBLIC_HEADER "${serve_PUBLIC_HEADERS}")

install(TARGETS ${TARGET} LIBRARY PUBLIC_HEADER)

if (TARGET BUILD_INFO)
add_dependencies(${TARGET} BUILD_INFO)
endif()
3 changes: 3 additions & 0 deletions tools/serve/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# LLaMA.cpp abstract Server

Abstract server API for **llama.cpp**.
3 changes: 3 additions & 0 deletions tools/serve/serve.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "serve.h"

// placeholder, some implementation can be moved here
3 changes: 3 additions & 0 deletions tools/serve/serve.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#pragma once

// placeholder, extern API to appear here
3,624 changes: 3,624 additions & 0 deletions tools/serve/serve.hpp

Large diffs are not rendered by default.

Loading