mirror of
https://github.com/meta-llama/llama-stack.git
synced 2026-01-02 23:22:16 +00:00
feat: add /jobs API
This API will be later tied to jobs as defined for specific flows (post-training, eval, etc.) through the common scheduler mechanism. Note: At the moment, API does nothing useful. (Except returning Not Implemented errors when called.) This is an alternative to developing per-flow jobs APIs. Eventually, once /jobs API is implemented, we should be able to deprecate existing APIs under /v1/post-training/, /v1/eval/ etc. See #1587 (tracker) See #1238 (design details) Note: This is an alternative path to #1582 and #1583. Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
This commit is contained in:
parent
0fdb15bcc7
commit
90799cdcee
12 changed files with 557 additions and 11 deletions
48
llama_stack/distribution/jobs.py
Normal file
48
llama_stack/distribution/jobs.py
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the terms described in the LICENSE file in
|
||||
# the root directory of this source tree.
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from llama_stack.apis.jobs import (
|
||||
JobInfo,
|
||||
Jobs,
|
||||
ListJobsResponse,
|
||||
)
|
||||
from llama_stack.distribution.datatypes import StackRunConfig
|
||||
|
||||
|
||||
class DistributionJobsConfig(BaseModel):
|
||||
run_config: StackRunConfig
|
||||
|
||||
|
||||
async def get_provider_impl(config, deps):
|
||||
impl = DistributionJobsImpl(config, deps)
|
||||
await impl.initialize()
|
||||
return impl
|
||||
|
||||
|
||||
class DistributionJobsImpl(Jobs):
|
||||
def __init__(self, config, deps):
|
||||
self.config = config
|
||||
self.deps = deps
|
||||
|
||||
async def initialize(self) -> None:
|
||||
pass
|
||||
|
||||
async def shutdown(self) -> None:
|
||||
pass
|
||||
|
||||
async def list_jobs(self) -> ListJobsResponse:
|
||||
raise NotImplementedError
|
||||
|
||||
async def delete_job(self, job_id: str) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
async def cancel_job(self, job_id: str) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
async def get_job(self, job_id: str) -> JobInfo:
|
||||
raise NotImplementedError
|
||||
Loading…
Add table
Add a link
Reference in a new issue