mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-04-30 03:01:44 +00:00
OAI: Restrict list permissions for API keys
API keys are not allowed to view all the admin's models, templates, draft models, loras, etc. Basically anything that can be viewed on the filesystem outside of anything that's currently loaded is not allowed to be returned unless an admin key is present. This change helps preserve user privacy while not erroring out on list endpoints that the OAI spec requires. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
@@ -405,6 +405,9 @@ class ExllamaV2Container:
|
||||
def get_model_path(self, is_draft: bool = False):
|
||||
"""Get the path for this model."""
|
||||
|
||||
if is_draft and not self.draft_config:
|
||||
return None
|
||||
|
||||
model_path = pathlib.Path(
|
||||
self.draft_config.model_dir if is_draft else self.config.model_dir
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user