Skip to content

Commit

Permalink
Merge pull request #130 from mistralai/doc/v0.0.77
Browse files Browse the repository at this point in the history
Update docs to v0.0.77
  • Loading branch information
hrjn authored Sep 2, 2024
2 parents 014c3dd + 21013fa commit 539138f
Show file tree
Hide file tree
Showing 7 changed files with 8,851 additions and 6,707 deletions.
4 changes: 4 additions & 0 deletions docs/capabilities/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ Here is an example of how you can create this agent with using the La Plateforme
<details>
<summary><b>Use case 3: Python agent workflow</b></summary>

<img src="/img/agent_demo1.png" alt="drawing" width="600"/>

You can use the Python agent we created in use case 2 in an assistant coding workflow. For example, here is a very simple Python agent workflow with the following steps:

1. User Query:
Expand Down Expand Up @@ -230,6 +232,8 @@ Check out this [example notebook](https://github.com/mistralai/cookbook/blob/mai
<details>
<summary><b>Use case 4: Data analytical multi-agent workflow</b></summary>

<img src="/img/agent_demo2.png" alt="drawing" width="600"/>

You can also leverage multiple agents in a workflow. Here is an example:

1. Data Analysis Planning:
Expand Down
2 changes: 1 addition & 1 deletion docs/deployment/cloud/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ In particular, Mistral's optimized commercial models are available on:
- [Azure AI](../azure)
- [AWS Bedrock](../aws)
- [Google Cloud Vertex AI Model Garden](../vertex)
- Snowflake Cortex
- [Snowflake Cortex](../sfcortex)

83 changes: 83 additions & 0 deletions docs/deployment/cloud/sfcortex.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
id: sfcortex
title: Snowflake Cortex
sidebar_position: 3.24
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

## Introduction

Mistral AI's open and commercial models can be leveraged from the Snowflake Cortex platform
as fully managed endpoints. Mistral models on Snowflake Cortex are serverless services so
you don't have to manage any infrastructure.

As of today, the following models are available:

- Mistral Large
- Mistral 7B

For more details, visit the [models](../../../getting-started/models) page.

## Getting started

The following sections outline the steps to query the latest version of Mistral Large
on the Snowflake Cortex platform.

### Getting access to the model

The following items are required:

- The associated Snowflake account must be in a compatible region (see the
[region list](https://docs.snowflake.com/en/user-guide/snowflake-cortex/llm-functions#availability)
in the Snowflake documentation).
- The principal that is calling the model must have the `CORTEX_USER` database role.

### Querying the model (chat completion)

The model can be called either directly in SQL or in Python using Snowpark ML.
It is exposed via the
[`COMPLETE` _LLM function_](https://docs.snowflake.com/en/sql-reference/functions/complete-snowflake-cortex).

<Tabs>
<TabItem value="sql" label="SQL">
```SQL
SELECT SNOWFLAKE.CORTEX.COMPLETE('mistral-large2', 'Who is the best French painter? Answer in one short sentence.');
```
</TabItem>
<TabItem value="Python" label="Python">
Execute this code either from a hosted Snowflake notebook or from your local machine.

For local execution you need to:
- Create a virtual environment with the following package:
- `snowflake-ml-python` (tested with version `1.6.1`)
- Ensure that you have a [configuration file](https://docs.snowflake.com/en/user-guide/snowsql-config)
with the proper credentials on your system. The example below assumes that you have a named connection
called `mistral` that is configured appropriately.

```python
from snowflake.snowpark import Session
from snowflake.ml.utils import connection_params
from snowflake.cortex import Complete

# Start session (local execution only)
params = connection_params.SnowflakeLoginOptions(connection_name="mistral")
session = Session.builder.configs(params).create()

# Query the model
prompt = "Who is the best French painter? Answer in one short sentence."
completion = Complete(model="mistral-large2", prompt=prompt)
print(completion)
```
</TabItem>
</Tabs>

## Going further

For more information and examples, you can check the Snowflake documentation for:

- [LLM functions](https://docs.snowflake.com/en/user-guide/snowflake-cortex/llm-functions)
- The API of the `COMPLETE` function in
[SQL](https://docs.snowflake.com/en/sql-reference/functions/complete-snowflake-cortex)
and [Python](https://docs.snowflake.com/en/developer-guide/snowpark-ml/reference/latest/api/model/snowflake.cortex.Complete).
26 changes: 14 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,24 @@
"typecheck": "tsc"
},
"dependencies": {
"@docusaurus/core": "3.2.1",
"@docusaurus/preset-classic": "3.2.1",
"@easyops-cn/docusaurus-search-local": "^0.38.1",
"@mdx-js/react": "^3.0.0",
"@docusaurus/core": "3.5.2",
"@docusaurus/preset-classic": "3.5.2",
"@docusaurus/theme-common": "3.5.2",
"@easyops-cn/docusaurus-search-local": "^0.44.5",
"@mdx-js/react": "^3.0.1",
"clsx": "^1.2.1",
"docusaurus-lunr-search": "^3.3.1",
"docusaurus-lunr-search": "^3.4.0",
"lunr": "^2.3.9",
"prism-react-renderer": "^2.3.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"redocusaurus": "^2.0.2"
"react": "^18.3.1",
"react-dom": "^18.3.1",
"redocusaurus": "^2.1.1"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.2.1",
"@docusaurus/tsconfig": "^3.2.1",
"@types/react": "^18.2.42",
"typescript": "^5.3.2"
"@docusaurus/tsconfig": "^3.5.2",
"@types/react": "^18.3.4",
"typescript": "^5.5.4"
},
"browserslist": {
"production": [
Expand All @@ -47,5 +48,6 @@
},
"engines": {
"node": ">=18.0"
}
},
"packageManager": "[email protected]+sha256.56a9e76b51796ca7f73b85e44cf83712862091f4d498c0ce4d5b7ecdc6ba18f7"
}
Loading

0 comments on commit 539138f

Please sign in to comment.