mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-30 13:04:17 +00:00
refactor: Add ProviderContext for a flexible storage directory
- Introduce ProviderContext class to decouple provider storage paths from absolute paths - Add storage_dir attribute to StackRunConfig to accept CLI options - Implement storage directory resolution with prioritized fallbacks: 1. CLI option (--state-directory) 2. Environment variable (LLAMA_STACK_STATE_DIR) 3. Default distribution directory - Standardize provider signatures to follow context, config, deps pattern - Update provider implementations to use the new context-based approach - Add comprehensive tests to verify state directory resolution
This commit is contained in:
parent
dd07c7a5b5
commit
e6c9aebe47
41 changed files with 242 additions and 81 deletions
|
|
@ -62,9 +62,13 @@ class MockInferenceAdapterWithSleep:
|
|||
# ruff: noqa: N802
|
||||
def do_POST(self):
|
||||
time.sleep(sleep_time)
|
||||
response_json = json.dumps(response).encode("utf-8")
|
||||
self.send_response(code=200)
|
||||
self.send_header("Content-Type", "application/json")
|
||||
self.send_header("Content-Length", str(len(response_json)))
|
||||
self.end_headers()
|
||||
self.wfile.write(json.dumps(response).encode("utf-8"))
|
||||
self.wfile.write(response_json)
|
||||
self.wfile.flush()
|
||||
|
||||
self.request_handler = DelayedRequestHandler
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue