-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvements to Models section (#625)
* Improvements to Models section * Update spiceaidocs/docs/components/models/filesystem.md * Update spiceaidocs/docs/components/models/anthropic.md * Update spiceaidocs/docs/components/models/filesystem.md Co-authored-by: Jack Eadie <[email protected]> * Update example * Updates * Update spiceaidocs/docs/components/models/anthropic.md --------- Co-authored-by: Jack Eadie <[email protected]>
- Loading branch information
Showing
6 changed files
with
108 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,30 @@ | ||
--- | ||
title: 'Anthropic Language Models' | ||
title: 'Anthropic Models' | ||
description: 'Instructions for using language models hosted on Anthropic with Spice.' | ||
sidebar_label: 'Anthropic' | ||
sidebar_position: 5 | ||
--- | ||
|
||
To use a language model hosted on Anthropic, specify `anthropic` in `from`. | ||
To use a language model hosted on Anthropic, specify `anthropic` in the `from` field. | ||
|
||
For a specific model, include it as the model ID in `from` (see example below). Defaults to `"claude-3-5-sonnet-20240620"`. | ||
These parameters are specific to Anthropic models: | ||
To use a specific model, include its model ID in the `from` field (see example below). If not specified, the default model is `"claude-3-5-sonnet-latest"`. | ||
|
||
| Param | Description | Default | | ||
| ----- | ----------- | ------- | | ||
| `anthropic_api_key` | The Anthropic API key. | - | | ||
| `anthropic_auth_token` | The Anthropic auth token. | - | | ||
| `endpoint` | The Anthropic API base endpoint. | `https://api.anthropic.com/v1` | | ||
The following parameters are specific to Anthropic models: | ||
|
||
Example: | ||
| Parameter | Description | Default | | ||
| ---------------------- | -------------------------------- | ------------------------------ | | ||
| `anthropic_api_key` | The Anthropic API key. | - | | ||
| `anthropic_auth_token` | The Anthropic auth token. | - | | ||
| `endpoint` | The Anthropic API base endpoint. | `https://api.anthropic.com/v1` | | ||
|
||
Example `spicepod.yml` configuration: | ||
|
||
```yaml | ||
models: | ||
- from: anthropic:claude-3-5-sonnet-20240620 | ||
- from: anthropic:claude-3-5-sonnet-latest | ||
name: claude_3_5_sonnet | ||
params: | ||
anthropic_api_key: ${ secrets:SPICE_ANTHROPIC_API_KEY } | ||
``` | ||
## Supported Models | ||
- `claude-3-5-sonnet-20240620` | ||
- `claude-3-opus-20240229` | ||
- `claude-3-sonnet-20240229` | ||
- `claude-3-haiku-20240307` | ||
- `claude-2.1` | ||
- `claude-2.0` | ||
- `claude-instant-1.2` | ||
See [Anthropic Model Names](https://docs.anthropic.com/en/docs/about-claude/models#model-names) for a list of supported model names. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,52 @@ | ||
--- | ||
title: 'Filesystem' | ||
description: 'Instructions for using models hosted on a filesystem with Spice.' | ||
sidebar_label: 'Filesystem' | ||
sidebar_position: 3 | ||
--- | ||
|
||
To use a ML model hosted on a filesystem, specify the file path in `from`. | ||
To use a model hosted on a filesystem, specify the path to the model file in `from`. | ||
|
||
Example: | ||
Supported formats include ONNX for traditional machine learning models and GGUF, GGML, and SafeTensor for large language models (LLMs). | ||
|
||
### Example: Loading an ONNX Model | ||
|
||
```yaml | ||
models: | ||
- from: file://absolute/path/to/my/model.onnx | ||
name: local_fs_model | ||
datasets: | ||
- taxi_trips | ||
``` | ||
### Example: Loading a GGUF Model | ||
```yaml | ||
models: | ||
- from: file://absolute/path/to/my/model.gguf | ||
name: local_ggml_model | ||
``` | ||
### Example: Loading a GGML Model | ||
```yaml | ||
models: | ||
- from: file://absolute/path/to/my/model.ggml | ||
name: local_ggml_model | ||
files: | ||
- path: models/llms/ggml/tokenizer.json | ||
- path: models/llms/ggml/tokenizer_config.json | ||
- path: models/llms/ggml/config.json | ||
``` | ||
### Example: Loading a SafeTensor Model | ||
```yaml | ||
models: | ||
- name: safety | ||
from: file:models/llms/llama3.2-1b-instruct/model.safetensors | ||
params: | ||
model_type: llama3 | ||
files: | ||
- path: models/llms/llama3.2-1b-instruct/tokenizer.json | ||
- path: models/llms/llama3.2-1b-instruct/tokenizer_config.json | ||
- path: models/llms/llama3.2-1b-instruct/config.json | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,21 @@ | ||
--- | ||
title: 'AI/ML Models' | ||
sidebar_label: 'AI/ML Models' | ||
description: '' | ||
title: 'Model Providers' | ||
sidebar_label: 'Model Providers' | ||
description: 'Overview of supported model providers for ML and LLMs in Spice.' | ||
sidebar_position: 5 | ||
--- | ||
|
||
Spice supports traditional machine learning (ML) models and language models (LLMs). | ||
Spice supports various model providers for traditional machine learning (ML) models and large language models (LLMs). | ||
|
||
- **Filesystem**: [ONNX](https://onnx.ai) models. | ||
- **HuggingFace**: ONNX models hosted on [HuggingFace](https://huggingface.co). | ||
- **Spice Cloud Platform**: Models hosted on the [Spice Cloud Platform](https://docs.spice.ai/building-blocks/spice-models). | ||
- **OpenAI**: OpenAI (or compatible) LLM endpoints. | ||
| Source | Description | ML Format(s) | LLM Format(s)\* | | ||
| ------------- | ----------------------------------------------------------------------------------------------- | ------------ | ---------------------- | | ||
| `file` | Local filesystem | ONNX | GGUF, GGML, SafeTensor | | ||
| `huggingface` | Models hosted on [HuggingFace](https://huggingface.co) | ONNX | GGUF, GGML, SafeTensor | | ||
| `spice.ai` | Models hosted on the [Spice Cloud Platform](https://docs.spice.ai/building-blocks/spice-models) | ONNX | - | | ||
| `openai` | OpenAI (or compatible) LLM endpoint | - | Remote HTTP endpoint | | ||
| `anthropic` | Models hosted on [Anthropic](https://www.anthropic.com) | - | Remote HTTP endpoint | | ||
| `grok` | Coming soon | - | Remote HTTP endpoint | | ||
|
||
### Model Sources | ||
|
||
| Name | Description | ML Format(s) | LLM Format(s)* | | ||
| ---------------------------- | ---------------- | ------------ | ----------------------- | | ||
| `file` | Local filesystem | ONNX | GGUF, GGML, SafeTensor | | ||
| `huggingface:huggingface.co` | Models hosted on [HuggingFace](https://huggingface.co) | ONNX | GGUF, GGML, SafeTensor | | ||
| `spice.ai` | Models hosted on the [Spice Cloud Platform](https://docs.spice.ai/building-blocks/spice-models) | ONNX | - | | ||
| `openai` | OpenAI (or compatible) LLM endpoint | - | Remote HTTP endpoint | | ||
|
||
* LLM Format(s) may require additional files (e.g. `tokenizer_config.json`). | ||
- LLM Format(s) may require additional files (e.g. `tokenizer_config.json`). | ||
|
||
The model type is inferred based on the model source and files. For more detail, refer to the `model` [reference specification](/reference/spicepod/models.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters