load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target")
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")

oncall("executorch")

# Header-only worker protocol shared by model-specific serving binaries.
fbcode_target(_kind = runtime.cxx_library,
    name = "worker_loop",
    exported_headers = [
        "worker_loop.h",
        "worker_prefill_plan.h",
    ],
    header_namespace = "executorch/examples/llm_server/cpp",
    exported_deps = [
        "//executorch/extension/llm/runner:runner_lib",
        "//executorch/extension/llm/serving:prompt_history",
        "//pytorch/tokenizers:headers",
    ],
    external_deps = ["nlohmann_json"],
    visibility = ["PUBLIC"],
)

fbcode_target(_kind = runtime.cxx_library,
    name = "multiplexed_worker",
    srcs = ["multiplexed_worker.cpp"],
    headers = ["multiplexed_worker_test.h"],
    exported_headers = ["multiplexed_worker.h"],
    header_namespace = "executorch/examples/llm_server/cpp",
    exported_deps = ["//executorch/extension/llm/serving:serving_runtime"],
    external_deps = ["nlohmann_json"],
    visibility = ["PUBLIC"],
)
