Skip to content

Commit

Permalink
unregister for memory banks and remove update API (#458)
Browse files Browse the repository at this point in the history
The semantics of an Update on resources is very tricky to reason about
especially for memory banks and models. The best way to go forward here
is for the user to unregister and register a new resource. We don't have
a compelling reason to support update APIs.


Tests:
pytest -v -s llama_stack/providers/tests/memory/test_memory.py -m
"chroma" --env CHROMA_HOST=localhost --env CHROMA_PORT=8000

pytest -v -s llama_stack/providers/tests/memory/test_memory.py -m
"pgvector" --env PGVECTOR_DB=postgres --env PGVECTOR_USER=postgres --env
PGVECTOR_PASSWORD=mysecretpassword --env PGVECTOR_HOST=0.0.0.0

$CONDA_PREFIX/bin/pytest -v -s -m "ollama"
llama_stack/providers/tests/inference/test_model_registration.py

---------

Co-authored-by: Dinesh Yeduguru <[email protected]>
  • Loading branch information
dineshyv and Dinesh Yeduguru authored Nov 15, 2024
1 parent 2eab3b7 commit 0850ad6
Show file tree
Hide file tree
Showing 18 changed files with 287 additions and 251 deletions.
154 changes: 58 additions & 96 deletions docs/resources/llama-stack-spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"info": {
"title": "[DRAFT] Llama Stack Specification",
"version": "0.0.1",
"description": "This is the specification of the llama stack that provides\n a set of endpoints and their corresponding interfaces that are tailored to\n best leverage Llama Models. The specification is still in draft and subject to change.\n Generated at 2024-11-14 12:51:12.176325"
"description": "This is the specification of the llama stack that provides\n a set of endpoints and their corresponding interfaces that are tailored to\n best leverage Llama Models. The specification is still in draft and subject to change.\n Generated at 2024-11-14 17:04:24.301559"
},
"servers": [
{
Expand Down Expand Up @@ -429,39 +429,6 @@
}
}
},
"/models/delete": {
"post": {
"responses": {
"200": {
"description": "OK"
}
},
"tags": [
"Models"
],
"parameters": [
{
"name": "X-LlamaStack-ProviderData",
"in": "header",
"description": "JSON-encoded provider data which will be made available to the adapter servicing the API",
"required": false,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeleteModelRequest"
}
}
},
"required": true
}
}
},
"/inference/embeddings": {
"post": {
"responses": {
Expand Down Expand Up @@ -2259,18 +2226,44 @@
}
}
},
"/models/update": {
"/memory_banks/unregister": {
"post": {
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Model"
}
"description": "OK"
}
},
"tags": [
"MemoryBanks"
],
"parameters": [
{
"name": "X-LlamaStack-ProviderData",
"in": "header",
"description": "JSON-encoded provider data which will be made available to the adapter servicing the API",
"required": false,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnregisterMemoryBankRequest"
}
}
},
"required": true
}
}
},
"/models/unregister": {
"post": {
"responses": {
"200": {
"description": "OK"
}
},
"tags": [
Expand All @@ -2291,7 +2284,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateModelRequest"
"$ref": "#/components/schemas/UnregisterModelRequest"
}
}
},
Expand Down Expand Up @@ -4622,18 +4615,6 @@
"session_id"
]
},
"DeleteModelRequest": {
"type": "object",
"properties": {
"model_id": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"model_id"
]
},
"EmbeddingsRequest": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -7912,42 +7893,23 @@
],
"title": "Response from the synthetic data generation. Batch of (prompt, response, score) tuples that pass the threshold."
},
"UpdateModelRequest": {
"UnregisterMemoryBankRequest": {
"type": "object",
"properties": {
"model_id": {
"type": "string"
},
"provider_model_id": {
"memory_bank_id": {
"type": "string"
},
"provider_id": {
}
},
"additionalProperties": false,
"required": [
"memory_bank_id"
]
},
"UnregisterModelRequest": {
"type": "object",
"properties": {
"model_id": {
"type": "string"
},
"metadata": {
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "null"
},
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"type": "array"
},
{
"type": "object"
}
]
}
}
},
"additionalProperties": false,
Expand Down Expand Up @@ -8132,10 +8094,6 @@
"name": "DeleteAgentsSessionRequest",
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/DeleteAgentsSessionRequest\" />"
},
{
"name": "DeleteModelRequest",
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/DeleteModelRequest\" />"
},
{
"name": "DoraFinetuningConfig",
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/DoraFinetuningConfig\" />"
Expand Down Expand Up @@ -8563,12 +8521,16 @@
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/URL\" />"
},
{
"name": "UnstructuredLogEvent",
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/UnstructuredLogEvent\" />"
"name": "UnregisterMemoryBankRequest",
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/UnregisterMemoryBankRequest\" />"
},
{
"name": "UpdateModelRequest",
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/UpdateModelRequest\" />"
"name": "UnregisterModelRequest",
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/UnregisterModelRequest\" />"
},
{
"name": "UnstructuredLogEvent",
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/UnstructuredLogEvent\" />"
},
{
"name": "UserMessage",
Expand Down Expand Up @@ -8657,7 +8619,6 @@
"Dataset",
"DeleteAgentsRequest",
"DeleteAgentsSessionRequest",
"DeleteModelRequest",
"DoraFinetuningConfig",
"EmbeddingsRequest",
"EmbeddingsResponse",
Expand Down Expand Up @@ -8754,8 +8715,9 @@
"TrainingConfig",
"Turn",
"URL",
"UnregisterMemoryBankRequest",
"UnregisterModelRequest",
"UnstructuredLogEvent",
"UpdateModelRequest",
"UserMessage",
"VectorMemoryBank",
"VectorMemoryBankParams",
Expand Down
Loading

0 comments on commit 0850ad6

Please sign in to comment.