From 8df9357a6391ee7f4c567c57392555ade95eda02 Mon Sep 17 00:00:00 2001 From: jeadie Date: Mon, 11 Nov 2024 16:08:00 +1000 Subject: [PATCH 1/3] memory tooling and connector docs --- .../docs/components/data-connectors/memory.md | 22 ++++++++++++ .../docs/features/ai-gateway/memory.md | 36 +++++++++++++++++++ .../docs/features/ai-gateway/runtime_tools.md | 11 +++++- 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 spiceaidocs/docs/components/data-connectors/memory.md create mode 100644 spiceaidocs/docs/features/ai-gateway/memory.md diff --git a/spiceaidocs/docs/components/data-connectors/memory.md b/spiceaidocs/docs/components/data-connectors/memory.md new file mode 100644 index 00000000..aa87e66a --- /dev/null +++ b/spiceaidocs/docs/components/data-connectors/memory.md @@ -0,0 +1,22 @@ +--- +title: 'Memory Data Connector' +sidebar_label: 'Memory Data Connector' +description: 'Memory Data Connector Documentation' +pagination_prev: null +--- + +The Memory Data Connector enables configuring an in-memory dataset for tables used, or produced by the Spice runtime. Only certain tables, with predefined schemas, can be defined by the connector. These are: + - `store`: Defines a table that LLMs, with [memory tooling](/features/ai-gateway/memory), can store data in. Requires `mode: read_write`. + +### Examples + +```yaml +datasets: +- from: memory:store + name: llm_memory + mode: read_write + columns: + - name: value + embeddings: # Easily make your LLM learnings searchable. + - from: all-MiniLM-L6-v2 +``` diff --git a/spiceaidocs/docs/features/ai-gateway/memory.md b/spiceaidocs/docs/features/ai-gateway/memory.md new file mode 100644 index 00000000..36796897 --- /dev/null +++ b/spiceaidocs/docs/features/ai-gateway/memory.md @@ -0,0 +1,36 @@ +--- +title: 'Language Model Memories' +sidebar_label: 'Memory' +description: 'Learn how LLMs can interact with the spice runtime.' +sidebar_position: 3 +pagination_prev: null +pagination_next: null +--- + +# Memory Tools + +Spice provides memory persistence tools that allow language models to store and retrieve information across conversations. These tools are available through the `memory` tool group. + +## Enabling Memory Tools + +To enable memory tools for Spice models you need to: + 1. Define a `store` [memory](/components/data-connectors/memory.md) dataset. + 2. Specify `memory` in the model's `spice_tools` parameter. + +```yaml +datasets: + - from: memory:store + name: llm_memory + mode: read_write + +models: + - name: memory-enabled-model + from: openai:gpt-4 + params: + spice_tools: memory, sql # Can be combined with other tool groups +``` + + +## Available Tools + - `store_memory`: Store important information for future reference + - `load_memory`: Retrieve previously stored memories from the last time period. diff --git a/spiceaidocs/docs/features/ai-gateway/runtime_tools.md b/spiceaidocs/docs/features/ai-gateway/runtime_tools.md index 0996741b..dae592b6 100644 --- a/spiceaidocs/docs/features/ai-gateway/runtime_tools.md +++ b/spiceaidocs/docs/features/ai-gateway/runtime_tools.md @@ -21,8 +21,17 @@ models: spice_tools: auto # Use all available tools ``` +To use all builtin tools with additional tools, use the `builtin` tool group. +```yaml +models: + - name: full-runtime + from: openai:gpt-4o + params: + spice_tools: builtin, memory +``` + ### Tool Recursion Limit -When a model requests to call a runtime tool, Spice runs the tool internally and feeds it back to the model. The `tool_recursion_limit` parameter limits the depth of internal recursion Spice will undertake. By default, Spice can infinitely recurse if the model requests to do so. +When a model requests to call a runtime tool, Spice runs the tool internally and feeds it back to the model. The `tool_recursion_limit` parameter limits the depth of internal recursion Spice will undertake. By default, Spice can infinitely recurse if the model requests to do so. ```yaml models: From 09da75cf04d9567b2bee6c70a168099822487902 Mon Sep 17 00:00:00 2001 From: jeadie Date: Wed, 13 Nov 2024 08:20:32 +1000 Subject: [PATCH 2/3] restructuring of files --- spiceaidocs/docs/components/data-connectors/memory.md | 4 ++++ .../features/{ai-gateway => large-language-models}/index.md | 0 .../features/{ai-gateway => large-language-models}/memory.md | 3 +-- .../docs/features/large-language-models/model-serving.md | 0 .../parameter_overrides.md} | 2 +- .../{ai-gateway => large-language-models}/runtime_tools.md | 0 .../{ => machine-learning-models}/ml-model-serving/index.md | 0 7 files changed, 6 insertions(+), 3 deletions(-) rename spiceaidocs/docs/features/{ai-gateway => large-language-models}/index.md (100%) rename spiceaidocs/docs/features/{ai-gateway => large-language-models}/memory.md (97%) create mode 100644 spiceaidocs/docs/features/large-language-models/model-serving.md rename spiceaidocs/docs/features/{ai-gateway/default_overrides.md => large-language-models/parameter_overrides.md} (97%) rename spiceaidocs/docs/features/{ai-gateway => large-language-models}/runtime_tools.md (100%) rename spiceaidocs/docs/features/{ => machine-learning-models}/ml-model-serving/index.md (100%) diff --git a/spiceaidocs/docs/components/data-connectors/memory.md b/spiceaidocs/docs/components/data-connectors/memory.md index aa87e66a..22985673 100644 --- a/spiceaidocs/docs/components/data-connectors/memory.md +++ b/spiceaidocs/docs/components/data-connectors/memory.md @@ -19,4 +19,8 @@ datasets: - name: value embeddings: # Easily make your LLM learnings searchable. - from: all-MiniLM-L6-v2 + +embeddings: + - name: all-MiniLM-L6-v2 + from: huggingface:huggingface.co/sentence-transformers/all-MiniLM-L6-v2 ``` diff --git a/spiceaidocs/docs/features/ai-gateway/index.md b/spiceaidocs/docs/features/large-language-models/index.md similarity index 100% rename from spiceaidocs/docs/features/ai-gateway/index.md rename to spiceaidocs/docs/features/large-language-models/index.md diff --git a/spiceaidocs/docs/features/ai-gateway/memory.md b/spiceaidocs/docs/features/large-language-models/memory.md similarity index 97% rename from spiceaidocs/docs/features/ai-gateway/memory.md rename to spiceaidocs/docs/features/large-language-models/memory.md index 36796897..50074736 100644 --- a/spiceaidocs/docs/features/ai-gateway/memory.md +++ b/spiceaidocs/docs/features/large-language-models/memory.md @@ -25,12 +25,11 @@ datasets: models: - name: memory-enabled-model - from: openai:gpt-4 + from: openai:gpt-4o params: spice_tools: memory, sql # Can be combined with other tool groups ``` - ## Available Tools - `store_memory`: Store important information for future reference - `load_memory`: Retrieve previously stored memories from the last time period. diff --git a/spiceaidocs/docs/features/large-language-models/model-serving.md b/spiceaidocs/docs/features/large-language-models/model-serving.md new file mode 100644 index 00000000..e69de29b diff --git a/spiceaidocs/docs/features/ai-gateway/default_overrides.md b/spiceaidocs/docs/features/large-language-models/parameter_overrides.md similarity index 97% rename from spiceaidocs/docs/features/ai-gateway/default_overrides.md rename to spiceaidocs/docs/features/large-language-models/parameter_overrides.md index 178456b7..e41750f2 100644 --- a/spiceaidocs/docs/features/ai-gateway/default_overrides.md +++ b/spiceaidocs/docs/features/large-language-models/parameter_overrides.md @@ -1,6 +1,6 @@ --- title: 'Language Model Overrides' -sidebar_label: 'Default overrides' +sidebar_label: 'Parameter overrides' description: 'Learn how to override default LLM hyperparameters in Spice.' sidebar_position: 1 pagination_prev: null diff --git a/spiceaidocs/docs/features/ai-gateway/runtime_tools.md b/spiceaidocs/docs/features/large-language-models/runtime_tools.md similarity index 100% rename from spiceaidocs/docs/features/ai-gateway/runtime_tools.md rename to spiceaidocs/docs/features/large-language-models/runtime_tools.md diff --git a/spiceaidocs/docs/features/ml-model-serving/index.md b/spiceaidocs/docs/features/machine-learning-models/ml-model-serving/index.md similarity index 100% rename from spiceaidocs/docs/features/ml-model-serving/index.md rename to spiceaidocs/docs/features/machine-learning-models/ml-model-serving/index.md From 3f4d106066789fe820e0811ad36f8ec89298a1d2 Mon Sep 17 00:00:00 2001 From: jeadie Date: Wed, 13 Nov 2024 08:53:33 +1000 Subject: [PATCH 3/3] fix links --- spiceaidocs/docs/components/data-connectors/memory.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spiceaidocs/docs/components/data-connectors/memory.md b/spiceaidocs/docs/components/data-connectors/memory.md index 22985673..59b53d05 100644 --- a/spiceaidocs/docs/components/data-connectors/memory.md +++ b/spiceaidocs/docs/components/data-connectors/memory.md @@ -6,7 +6,7 @@ pagination_prev: null --- The Memory Data Connector enables configuring an in-memory dataset for tables used, or produced by the Spice runtime. Only certain tables, with predefined schemas, can be defined by the connector. These are: - - `store`: Defines a table that LLMs, with [memory tooling](/features/ai-gateway/memory), can store data in. Requires `mode: read_write`. + - `store`: Defines a table that LLMs, with [memory tooling](/features/large-language-models/memory), can store data in. Requires `mode: read_write`. ### Examples