diff --git a/pgml-apps/pgml-chat/pgml_chat/main.py b/pgml-apps/pgml-chat/pgml_chat/main.py
index e9ac079ea..3c447a419 100644
--- a/pgml-apps/pgml-chat/pgml_chat/main.py
+++ b/pgml-apps/pgml-chat/pgml_chat/main.py
@@ -123,7 +123,7 @@ def handler(signum, frame):
"--chat_completion_model",
dest="chat_completion_model",
type=str,
- default="meta-llama/Meta-Llama-3-8B-Instruct",
+ default="meta-llama/Meta-Llama-3.1-8B-Instruct",
)
parser.add_argument(
diff --git a/pgml-cms/blog/announcing-support-for-meta-llama-3.1.md b/pgml-cms/blog/announcing-support-for-meta-llama-3.1.md
new file mode 100644
index 000000000..f960f3376
--- /dev/null
+++ b/pgml-cms/blog/announcing-support-for-meta-llama-3.1.md
@@ -0,0 +1,37 @@
+---
+description: >-
+ Today we’re taking the next steps towards open source AI becoming the industry standard. We’re releasing Llama 3.1 405B, the first frontier-level open source AI model, as well as new and improved Llama 3.1 70B and 8B models. In addition to having significantly better cost/performance relative to closed models.
+featured: false
+tags: [engineering]
+image: ".gitbook/assets/image (2) (2).png"
+---
+
+# Announcing Support for Meta Llama 3.1
+
+
+
+
+
+
+
+Montana Low
+
+July 23, 2024
+
+We're pleased to offer Meta Llama 3.1 running in our serverless cloud today. Mark Zuckerberg explained [his company's reasons for championing open source AI](https://about.fb.com/news/2024/07/open-source-ai-is-the-path-forward/), and it's great to see a strong ecosystem forming. These models are now available in our serverless cloud with optimized kernels for maximum throughput.
+
+- meta-llama/Meta-Llama-3.1-8B-Instruct
+- meta-llama/Meta-Llama-3.1-70B-Instruct
+- meta-llama/Meta-Llama-3.1-405B-Instruct
+
+## Is open-source AI right for you?
+
+We think so. Open-source models have made remarkable strides, not only catching up to proprietary counterparts but also surpassing them across multiple domains. The advantages are clear:
+
+* **Performance & reliability:** Open-source models are increasingly comparable or superior across a wide range of tasks and performance metrics. Mistral and Llama-based models, for example, are easily faster than GPT 4. Reliability is another concern you may reconsider leaving in the hands of OpenAI. OpenAI’s API has suffered from several recent outages, and their rate limits can interrupt your app if there is a surge in usage. Open-source models enable greater control over your model’s latency, scalability and availability. Ultimately, the outcome of greater control is that your organization can produce a more dependable integration and a highly reliable production application.
+* **Safety & privacy:** Open-source models are the clear winner when it comes to security sensitive AI applications. There are [enormous risks](https://www.infosecurity-magazine.com/news-features/chatgpts-datascraping-scrutiny/) associated with transmitting private data to external entities such as OpenAI. By contrast, open-source models retain sensitive information within an organization's own cloud environments. The data never has to leave your premises, so the risk is bypassed altogether – it’s enterprise security by default. At PostgresML, we offer such private hosting of LLM’s in your own cloud.
+* **Model censorship:** A growing number of experts inside and outside of leading AI companies argue that model restrictions have gone too far. The Atlantic recently published an [article on AI’s “Spicy-Mayo Problem'' ](https://www.theatlantic.com/ideas/archive/2023/11/ai-safety-regulations-uncensored-models/676076/) which delves into the issues surrounding AI censorship. The titular example describes a chatbot refusing to return commands asking for a “dangerously spicy” mayo recipe. Censorship can affect baseline performance, and in the case of apps for creative work such as Sudowrite, unrestricted open-source models can actually be a key differentiating value for users.
+* **Flexibility & customization:** Closed-source models like GPT3.5 Turbo are fine for generalized tasks, but leave little room for customization. Fine-tuning is highly restricted. Additionally, the headwinds at OpenAI have exposed the [dangerous reality of AI vendor lock-in](https://techcrunch.com/2023/11/21/openai-dangers-vendor-lock-in/). Open-source models such as MPT-7B, Llama V2 and Mistral 7B are designed with extensive flexibility for fine tuning, so organizations can create custom specifications and optimize model performance for their unique needs. This level of customization and flexibility opens the door for advanced techniques like DPO, PPO LoRa and more.
+
+For a full list of models available in our cloud, check out our [plans and pricing](/pricing).
+
diff --git a/pgml-cms/blog/introducing-korvus-the-all-in-one-rag-pipeline-for-postgresml.md b/pgml-cms/blog/introducing-korvus-the-all-in-one-rag-pipeline-for-postgresml.md
index fa1bfdf76..259d84173 100644
--- a/pgml-cms/blog/introducing-korvus-the-all-in-one-rag-pipeline-for-postgresml.md
+++ b/pgml-cms/blog/introducing-korvus-the-all-in-one-rag-pipeline-for-postgresml.md
@@ -100,7 +100,7 @@ async def main():
"aggregate": {"join": "\n"},
},
"chat": {
- "model": "meta-llama/Meta-Llama-3-8B-Instruct",
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"messages": [
{
"role": "system",
diff --git a/pgml-cms/blog/introducing-the-openai-switch-kit-move-from-closed-to-open-source-ai-in-minutes.md b/pgml-cms/blog/introducing-the-openai-switch-kit-move-from-closed-to-open-source-ai-in-minutes.md
index 196c4fb37..a1d9609fa 100644
--- a/pgml-cms/blog/introducing-the-openai-switch-kit-move-from-closed-to-open-source-ai-in-minutes.md
+++ b/pgml-cms/blog/introducing-the-openai-switch-kit-move-from-closed-to-open-source-ai-in-minutes.md
@@ -44,7 +44,7 @@ The Switch Kit is an open-source AI SDK that provides a drop in replacement for
const korvus = require("korvus");
const client = korvus.newOpenSourceAI();
const results = client.chat_completions_create(
- "meta-llama/Meta-Llama-3-8B-Instruct",
+ "meta-llama/Meta-Llama-3.1-8B-Instruct",
[
{
role: "system",
@@ -65,7 +65,7 @@ console.log(results);
import korvus
client = korvus.OpenSourceAI()
results = client.chat_completions_create(
- "meta-llama/Meta-Llama-3-8B-Instruct",
+ "meta-llama/Meta-Llama-3.1-8B-Instruct",
[
{
"role": "system",
@@ -96,7 +96,7 @@ print(results)
],
"created": 1701291672,
"id": "abf042d2-9159-49cb-9fd3-eef16feb246c",
- "model": "meta-llama/Meta-Llama-3-8B-Instruct",
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"object": "chat.completion",
"system_fingerprint": "eecec9d4-c28b-5a27-f90b-66c3fb6cee46",
"usage": {
@@ -113,7 +113,7 @@ We don't charge per token, so OpenAI “usage” metrics are not particularly re
!!!
-The above is an example using our open-source AI SDK with Meta-Llama-3-8B-Instruct, an incredibly popular and highly efficient 8 billion parameter model.
+The above is an example using our open-source AI SDK with Meta-Llama-3.1-8B-Instruct, an incredibly popular and highly efficient 8 billion parameter model.
Notice there is near one to one relation between the parameters and return type of OpenAI’s `chat.completions.create` and our `chat_completion_create`.
@@ -125,7 +125,7 @@ Here is an example of streaming:
const korvus = require("korvus");
const client = korvus.newOpenSourceAI();
const it = client.chat_completions_create_stream(
- "meta-llama/Meta-Llama-3-8B-Instruct",
+ "meta-llama/Meta-Llama-3.1-8B-Instruct",
[
{
role: "system",
@@ -150,7 +150,7 @@ while (!result.done) {
import korvus
client = korvus.OpenSourceAI()
results = client.chat_completions_create_stream(
- "meta-llama/Meta-Llama-3-8B-Instruct",
+ "meta-llama/Meta-Llama-3.1-8B-Instruct",
[
{
"role": "system",
@@ -182,7 +182,7 @@ for c in results:
],
"created": 1701296792,
"id": "62a817f5-549b-43e0-8f0c-a7cb204ab897",
- "model": "meta-llama/Meta-Llama-3-8B-Instruct",
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"object": "chat.completion.chunk",
"system_fingerprint": "f366d657-75f9-9c33-8e57-1e6be2cf62f3"
}
@@ -198,7 +198,7 @@ for c in results:
],
"created": 1701296792,
"id": "62a817f5-549b-43e0-8f0c-a7cb204ab897",
- "model": "meta-llama/Meta-Llama-3-8B-Instruct",
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"object": "chat.completion.chunk",
"system_fingerprint": "f366d657-75f9-9c33-8e57-1e6be2cf62f3"
}
diff --git a/pgml-cms/blog/unified-rag.md b/pgml-cms/blog/unified-rag.md
index 49461068d..8028fa981 100644
--- a/pgml-cms/blog/unified-rag.md
+++ b/pgml-cms/blog/unified-rag.md
@@ -51,7 +51,7 @@ Here is an example of the pgml.transform function
SELECT pgml.transform(
task => ''{
"task": "text-generation",
- "model": "meta-llama/Meta-Llama-3-8B-Instruct"
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct"
}''::JSONB,
inputs => ARRAY[''AI is going to''],
args => ''{
@@ -64,7 +64,7 @@ Here is another example of the pgml.transform function
SELECT pgml.transform(
task => ''{
"task": "text-generation",
- "model": "meta-llama/Meta-Llama-3-70B-Instruct"
+ "model": "meta-llama/Meta-Llama-3.1-70B-Instruct"
}''::JSONB,
inputs => ARRAY[''AI is going to''],
args => ''{
@@ -145,9 +145,9 @@ SELECT * FROM chunks limit 10;
| id | chunk | chunk_index | document_id |
| ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | ------------- |
| 1 | Here is an example of the pgml.transform function | 1 | 1 |
-| 2 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "meta-llama/Meta-Llama-3-8B-Instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); | 2 | 1 |
+| 2 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "meta-llama/Meta-Llama-3.1-8B-Instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); | 2 | 1 |
| 3 | Here is another example of the pgml.transform function | 3 | 1 |
-| 4 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "meta-llama/Meta-Llama-3-70B-Instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); | 4 | 1 |
+| 4 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "meta-llama/Meta-Llama-3.1-70B-Instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); | 4 | 1 |
| 5 | Here is a third example of the pgml.transform function | 5 | 1 |
| 6 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "microsoft/Phi-3-mini-128k-instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); | 6 | 1 |
| 7 | ae94d3413ae82367c3d0592a67302b25 | 1 | 2 |
@@ -253,8 +253,8 @@ LIMIT 6;
| 1 | 0.09044166306461232 | Here is an example of the pgml.transform function |
| 3 | 0.10787954026965096 | Here is another example of the pgml.transform function |
| 5 | 0.11683694289239333 | Here is a third example of the pgml.transform function |
-| 2 | 0.17699128851412282 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "meta-llama/Meta-Llama-3-8B-Instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); |
-| 4 | 0.17844729798760672 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "meta-llama/Meta-Llama-3-70B-Instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); |
+| 2 | 0.17699128851412282 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "meta-llama/Meta-Llama-3.1-8B-Instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); |
+| 4 | 0.17844729798760672 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "meta-llama/Meta-Llama-3.1-70B-Instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); |
| 6 | 0.17520464423854842 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "microsoft/Phi-3-mini-128k-instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); |
!!!
@@ -330,8 +330,8 @@ FROM (
| cosine_distance | rank_score | chunk |
| -------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| 0.2124727254737595 | 0.3427378833293915 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "meta-llama/Meta-Llama-3-70B-Instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); |
-| 0.2109014406365579 | 0.342184841632843 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "meta-llama/Meta-Llama-3-8B-Instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); |
+| 0.2124727254737595 | 0.3427378833293915 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "meta-llama/Meta-Llama-3.1-70B-Instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); |
+| 0.2109014406365579 | 0.342184841632843 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "meta-llama/Meta-Llama-3.1-8B-Instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); |
| 0.21259646694819168 | 0.3332781493663788 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "microsoft/Phi-3-mini-128k-instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); |
| 0.19483324929456136 | 0.03163915500044823 | Here is an example of the pgml.transform function |
| 0.1685870257610742 | 0.031176624819636345 | Here is a third example of the pgml.transform function |
diff --git a/pgml-cms/docs/SUMMARY.md b/pgml-cms/docs/SUMMARY.md
index c0d10d814..59687e3e7 100644
--- a/pgml-cms/docs/SUMMARY.md
+++ b/pgml-cms/docs/SUMMARY.md
@@ -146,7 +146,7 @@
* [Explain plans]()
* [Composition]()
* [LLMs]()
- * [LLama]()
+ * [Llama]()
* [GPT]()
* [Facon]()
* [Glossary]()
diff --git a/pgml-cms/docs/introduction/getting-started/connect-your-app.md b/pgml-cms/docs/introduction/getting-started/connect-your-app.md
index f561fb081..100fcb638 100644
--- a/pgml-cms/docs/introduction/getting-started/connect-your-app.md
+++ b/pgml-cms/docs/introduction/getting-started/connect-your-app.md
@@ -42,7 +42,7 @@ const pgml = require("pgml");
const main = () => {
const client = pgml.newOpenSourceAI();
const results = client.chat_completions_create(
- "meta-llama/Meta-Llama-3-8B-Instruct",
+ "meta-llama/Meta-Llama-3.1-8B-Instruct",
[
{
role: "system",
@@ -66,7 +66,7 @@ import pgml
async def main():
client = pgml.OpenSourceAI()
results = client.chat_completions_create(
- "meta-llama/Meta-Llama-3-8B-Instruct",
+ "meta-llama/Meta-Llama-3.1-8B-Instruct",
[
{
"role": "system",
diff --git a/pgml-cms/docs/open-source/korvus/guides/opensourceai.md b/pgml-cms/docs/open-source/korvus/guides/opensourceai.md
index e10386da5..2bd5f627b 100644
--- a/pgml-cms/docs/open-source/korvus/guides/opensourceai.md
+++ b/pgml-cms/docs/open-source/korvus/guides/opensourceai.md
@@ -62,7 +62,7 @@ Here is a simple example using zephyr-7b-beta, one of the best 7 billion paramet
const korvus = require("korvus");
const client = korvus.newOpenSourceAI();
const results = client.chat_completions_create(
- "meta-llama/Meta-Llama-3-8B-Instruct",
+ "meta-llama/Meta-Llama-3.1-8B-Instruct",
[
{
role: "system",
@@ -83,7 +83,7 @@ console.log(results);
import korvus
client = korvus.OpenSourceAI()
results = client.chat_completions_create(
- "meta-llama/Meta-Llama-3-8B-Instruct",
+ "meta-llama/Meta-Llama-3.1-8B-Instruct",
[
{
"role": "system",
@@ -114,7 +114,7 @@ print(results)
],
"created": 1701291672,
"id": "abf042d2-9159-49cb-9fd3-eef16feb246c",
- "model": "meta-llama/Meta-Llama-3-8B-Instruct",
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"object": "chat.completion",
"system_fingerprint": "eecec9d4-c28b-5a27-f90b-66c3fb6cee46",
"usage": {
@@ -133,7 +133,7 @@ Notice there is near one to one relation between the parameters and return type
The best part of using open-source AI is the flexibility with models. Unlike OpenAI, we are not restricted to using a few censored models, but have access to almost any model out there.
-Here is an example of streaming with the popular `meta-llama/Meta-Llama-3-8B-Instruct` model.
+Here is an example of streaming with the popular `meta-llama/Meta-Llama-3.1-8B-Instruct` model.
{% tabs %}
{% tab title="JavaScript" %}
@@ -141,7 +141,7 @@ Here is an example of streaming with the popular `meta-llama/Meta-Llama-3-8B-Ins
const korvus = require("korvus");
const client = korvus.newOpenSourceAI();
const it = client.chat_completions_create_stream(
- "meta-llama/Meta-Llama-3-8B-Instruct",
+ "meta-llama/Meta-Llama-3.1-8B-Instruct",
[
{
role: "system",
@@ -166,7 +166,7 @@ while (!result.done) {
import korvus
client = korvus.OpenSourceAI()
results = client.chat_completions_create_stream(
- "meta-llama/Meta-Llama-3-8B-Instruct",
+ "meta-llama/Meta-Llama-3.1-8B-Instruct",
[
{
"role": "system",
@@ -196,7 +196,7 @@ for c in results:
],
"created": 1701296792,
"id": "62a817f5-549b-43e0-8f0c-a7cb204ab897",
- "model": "meta-llama/Meta-Llama-3-8B-Instruct",
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"object": "chat.completion.chunk",
"system_fingerprint": "f366d657-75f9-9c33-8e57-1e6be2cf62f3"
}
@@ -212,7 +212,7 @@ for c in results:
],
"created": 1701296792,
"id": "62a817f5-549b-43e0-8f0c-a7cb204ab897",
- "model": "meta-llama/Meta-Llama-3-8B-Instruct",
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"object": "chat.completion.chunk",
"system_fingerprint": "f366d657-75f9-9c33-8e57-1e6be2cf62f3"
}
@@ -234,7 +234,7 @@ We also have asynchronous versions of the `chat_completions_create` and `chat_co
const korvus = require("korvus");
const client = korvus.newOpenSourceAI();
const results = await client.chat_completions_create_async(
- "meta-llama/Meta-Llama-3-8B-Instruct",
+ "meta-llama/Meta-Llama-3.1-8B-Instruct",
[
{
role: "system",
@@ -255,7 +255,7 @@ console.log(results);
import korvus
client = korvus.OpenSourceAI()
results = await client.chat_completions_create_async(
- "meta-llama/Meta-Llama-3-8B-Instruct",
+ "meta-llama/Meta-Llama-3.1-8B-Instruct",
[
{
"role": "system",
@@ -284,7 +284,7 @@ results = await client.chat_completions_create_async(
],
"created": 1701291672,
"id": "abf042d2-9159-49cb-9fd3-eef16feb246c",
- "model": "meta-llama/Meta-Llama-3-8B-Instruct",
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"object": "chat.completion",
"system_fingerprint": "eecec9d4-c28b-5a27-f90b-66c3fb6cee46",
"usage": {
@@ -303,7 +303,7 @@ Notice the return types for the sync and async variations are the same.
const korvus = require("korvus");
const client = korvus.newOpenSourceAI();
const it = await client.chat_completions_create_stream_async(
- "meta-llama/Meta-Llama-3-8B-Instruct",
+ "meta-llama/Meta-Llama-3.1-8B-Instruct",
[
{
role: "system",
@@ -328,7 +328,7 @@ while (!result.done) {
import korvus
client = korvus.OpenSourceAI()
results = await client.chat_completions_create_stream_async(
- "meta-llama/Meta-Llama-3-8B-Instruct",
+ "meta-llama/Meta-Llama-3.1-8B-Instruct",
[
{
"role": "system",
@@ -359,7 +359,7 @@ async for c in results:
],
"created": 1701296792,
"id": "62a817f5-549b-43e0-8f0c-a7cb204ab897",
- "model": "meta-llama/Meta-Llama-3-8B-Instruct",
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"object": "chat.completion.chunk",
"system_fingerprint": "f366d657-75f9-9c33-8e57-1e6be2cf62f3"
}
@@ -375,7 +375,7 @@ async for c in results:
],
"created": 1701296792,
"id": "62a817f5-549b-43e0-8f0c-a7cb204ab897",
- "model": "meta-llama/Meta-Llama-3-8B-Instruct",
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"object": "chat.completion.chunk",
"system_fingerprint": "f366d657-75f9-9c33-8e57-1e6be2cf62f3"
}
@@ -389,8 +389,8 @@ We have truncated the output to two items
We have tested the following models and verified they work with the OpenSourceAI:
-* meta-llama/Meta-Llama-3-8B-Instruct
-* meta-llama/Meta-Llama-3-70B-Instruct
+* meta-llama/Meta-Llama-3.1-8B-Instruct
+* meta-llama/Meta-Llama-3.1-70B-Instruct
* microsoft/Phi-3-mini-128k-instruct
* mistralai/Mixtral-8x7B-Instruct-v0.1
* mistralai/Mistral-7B-Instruct-v0.2
diff --git a/pgml-cms/docs/open-source/korvus/guides/rag.md b/pgml-cms/docs/open-source/korvus/guides/rag.md
index 4fe76f380..d9a2e23e1 100644
--- a/pgml-cms/docs/open-source/korvus/guides/rag.md
+++ b/pgml-cms/docs/open-source/korvus/guides/rag.md
@@ -114,7 +114,7 @@ const results = await collection.rag(
aggregate: { "join": "\n" },
},
chat: {
- model: "meta-llama/Meta-Llama-3-8B-Instruct",
+ model: "meta-llama/Meta-Llama-3.1-8B-Instruct",
messages: [
{
role: "system",
@@ -155,7 +155,7 @@ results = await collection.rag(
"aggregate": {"join": "\n"},
},
"chat": {
- "model": "meta-llama/Meta-Llama-3-8B-Instruct",
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"messages": [
{
"role": "system",
@@ -196,7 +196,7 @@ let results = collection.rag(serde_json::json!(
"aggregate": {"join": "\n"},
},
"chat": {
- "model": "meta-llama/Meta-Llama-3-8B-Instruct",
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"messages": [
{
"role": "system",
@@ -236,7 +236,7 @@ char * results = korvus_collectionc_rag(collection,
\"aggregate\": {\"join\": \"\\n\"}\
},\
\"chat\": {\
- \"model\": \"meta-llama/Meta-Llama-3-8B-Instruct\",\
+ \"model\": \"meta-llama/Meta-Llama-3.1-8B-Instruct\",\
\"messages\": [\
{\
\"role\": \"system\",\
@@ -314,7 +314,7 @@ const results = await collection.rag(
aggregate: { "join": "\n" },
},
chat: {
- model: "meta-llama/Meta-Llama-3-8B-Instruct",
+ model: "meta-llama/Meta-Llama-3.1-8B-Instruct",
messages: [
{
role: "system",
@@ -356,7 +356,7 @@ results = await collection.rag(
"aggregate": {"join": "\n"},
},
"chat": {
- "model": "meta-llama/Meta-Llama-3-8B-Instruct",
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"messages": [
{
"role": "system",
@@ -398,7 +398,7 @@ let results = collection.rag(serde_json::json!(
"aggregate": {"join": "\n"},
},
"chat": {
- "model": "meta-llama/Meta-Llama-3-8B-Instruct",
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"messages": [
{
"role": "system",
diff --git a/pgml-cms/docs/open-source/pgml/api/pgml.transform/README.md b/pgml-cms/docs/open-source/pgml/api/pgml.transform/README.md
index 722d49d57..b9d6de949 100644
--- a/pgml-cms/docs/open-source/pgml/api/pgml.transform/README.md
+++ b/pgml-cms/docs/open-source/pgml/api/pgml.transform/README.md
@@ -123,7 +123,7 @@ pgml.transform(
SELECT pgml.transform(
task => '{
"task": "text-generation",
- "model": "meta-llama/Meta-Llama-3-8B-Instruct",
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"model_type": "mistral",
"revision": "main",
"device_map": "auto"
@@ -148,7 +148,7 @@ def transform(task, call, inputs):
transform(
{
"task": "text-generation",
- "model": "meta-llama/Meta-Llama-3-8B-Instruct",
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"model_type": "mistral",
"revision": "main",
},
diff --git a/pgml-cms/docs/open-source/pgml/api/pgml.transform/text-generation.md b/pgml-cms/docs/open-source/pgml/api/pgml.transform/text-generation.md
index 707f5ab84..7439f3c5f 100644
--- a/pgml-cms/docs/open-source/pgml/api/pgml.transform/text-generation.md
+++ b/pgml-cms/docs/open-source/pgml/api/pgml.transform/text-generation.md
@@ -14,7 +14,7 @@ Use this for conversational AI applications or when you need to provide instruct
SELECT pgml.transform(
task => '{
"task": "text-generation",
- "model": "meta-llama/Meta-Llama-3-8B-Instruct"
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct"
}'::JSONB,
inputs => ARRAY[
'{"role": "system", "content": "You are a friendly and helpful chatbot"}'::JSONB,
@@ -53,7 +53,7 @@ An example with some common parameters:
SELECT pgml.transform(
task => '{
"task": "text-generation",
- "model": "meta-llama/Meta-Llama-3-8B-Instruct"
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct"
}'::JSONB,
inputs => ARRAY[
'{"role": "system", "content": "You are a friendly and helpful chatbot"}'::JSONB,
@@ -80,7 +80,7 @@ Use this for simpler text-generation tasks like completing sentences or generati
SELECT pgml.transform(
task => '{
"task": "text-generation",
- "model": "meta-llama/Meta-Llama-3-8B-Instruct"
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct"
}'::JSONB,
inputs => ARRAY[
'Three Rings for the Elven-kings under the sky, Seven for the Dwarf-lords in their halls of stone'
@@ -118,7 +118,7 @@ An example with some common parameters:
SELECT pgml.transform(
task => '{
"task": "text-generation",
- "model": "meta-llama/Meta-Llama-3-8B-Instruct"
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct"
}'::JSONB,
inputs => ARRAY[
'Three Rings for the Elven-kings under the sky, Seven for the Dwarf-lords in their halls of stone'
diff --git a/pgml-cms/docs/open-source/pgml/api/pgml.transform_stream.md b/pgml-cms/docs/open-source/pgml/api/pgml.transform_stream.md
index 7d259a742..c4fcf3c6e 100644
--- a/pgml-cms/docs/open-source/pgml/api/pgml.transform_stream.md
+++ b/pgml-cms/docs/open-source/pgml/api/pgml.transform_stream.md
@@ -30,13 +30,13 @@ pgml.transform_stream(
| inputs | The input chat messages. |
| args | The additional arguments for the model. |
-A simple example using `meta-llama/Meta-Llama-3-8B-Instruct`:
+A simple example using `meta-llama/Meta-Llama-3.1-8B-Instruct`:
```postgresql
SELECT pgml.transform_stream(
task => '{
"task": "conversational",
- "model": "meta-llama/Meta-Llama-3-8B-Instruct"
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct"
}'::JSONB,
inputs => ARRAY[
'{"role": "system", "content": "You are a friendly and helpful chatbot"}'::JSONB,
@@ -85,7 +85,7 @@ An example with some common parameters:
SELECT pgml.transform_stream(
task => '{
"task": "conversational",
- "model": "meta-llama/Meta-Llama-3-8B-Instruct"
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct"
}'::JSONB,
inputs => ARRAY[
'{"role": "system", "content": "You are a friendly and helpful chatbot"}'::JSONB,
@@ -132,13 +132,13 @@ pgml.transform_stream(
| input | The text to complete. |
| args | The additional arguments for the model. |
-A simple example using `meta-llama/Meta-Llama-3-8B-Instruct`:
+A simple example using `meta-llama/Meta-Llama-3.1-8B-Instruct`:
```postgresql
SELECT pgml.transform_stream(
task => '{
"task": "text-generation",
- "model": "meta-llama/Meta-Llama-3-8B-Instruct"
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct"
}'::JSONB,
input => 'Three Rings for the Elven-kings under the sky, Seven for the Dwarf-lords in their halls of stone'
) AS answer;
@@ -189,7 +189,7 @@ An example with some common parameters:
SELECT pgml.transform_stream(
task => '{
"task": "text-generation",
- "model": "meta-llama/Meta-Llama-3-8B-Instruct"
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct"
}'::JSONB,
input => 'Three Rings for the Elven-kings under the sky, Seven for the Dwarf-lords in their halls of stone',
args => '{
diff --git a/pgml-cms/docs/open-source/pgml/guides/chatbots/README.md b/pgml-cms/docs/open-source/pgml/guides/chatbots/README.md
index 3a03abcb2..74ba0718a 100644
--- a/pgml-cms/docs/open-source/pgml/guides/chatbots/README.md
+++ b/pgml-cms/docs/open-source/pgml/guides/chatbots/README.md
@@ -202,7 +202,7 @@ Let's take this hypothetical example and make it a reality. For the rest of this
* The chatbot remembers our past conversation
* The chatbot can answer questions correctly about Baldur's Gate 3
-In reality we haven't created a SOTA LLM, but fortunately other people have and we will be using the incredibly popular `meta-llama/Meta-Llama-3-8B-Instruct`. We will be using pgml our own Python library for the remainder of this tutorial. If you want to follow along and have not installed it yet:
+In reality we haven't created a SOTA LLM, but fortunately other people have and we will be using the incredibly popular `meta-llama/Meta-Llama-3.1-8B-Instruct`. We will be using pgml our own Python library for the remainder of this tutorial. If you want to follow along and have not installed it yet:
```
pip install pgml
@@ -220,7 +220,7 @@ Let's setup a basic chat loop with our model:
from pgml import TransformerPipeline
import asyncio
-model = TransformerPipeline("text-generation", "meta-llama/Meta-Llama-3-8B-Instruct")
+model = TransformerPipeline("text-generation", "meta-llama/Meta-Llama-3.1-8B-Instruct")
async def main():
@@ -266,7 +266,7 @@ Remember LLM's are just function approximators that are designed to predict the
We need to understand that LLMs have a special format for the inputs specifically for conversations. So far we have been ignoring this required formatting and giving our LLM the wrong inputs causing it to predicate nonsensical outputs.
-What do the right inputs look like? That actually depends on the model. Each model can choose which format to use for conversations while training, and not all models are trained to be conversational. `meta-llama/Meta-Llama-3-8B-Instruct` has been trained to be conversational and expects us to format text meant for conversations like so:
+What do the right inputs look like? That actually depends on the model. Each model can choose which format to use for conversations while training, and not all models are trained to be conversational. `meta-llama/Meta-Llama-3.1-8B-Instruct` has been trained to be conversational and expects us to format text meant for conversations like so:
```
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
@@ -284,7 +284,7 @@ This is the style of input our LLM has been trained on. Let's do a simple test w
from pgml import TransformerPipeline
import asyncio
-model = TransformerPipeline("text-generation", "meta-llama/Meta-Llama-3-8B-Instruct")
+model = TransformerPipeline("text-generation", "meta-llama/Meta-Llama-3.1-8B-Instruct")
user_input = """
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
@@ -315,7 +315,7 @@ That was perfect! We got the exact response we wanted for the first question, bu
from pgml import TransformerPipeline
import asyncio
-model = TransformerPipeline("text-generation", "meta-llama/Meta-Llama-3-8B-Instruct")
+model = TransformerPipeline("text-generation", "meta-llama/Meta-Llama-3.1-8B-Instruct")
user_input = """
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
@@ -346,7 +346,7 @@ By chaining these special tags we can build a conversation that Llama has been t
This example highlights that modern LLM's are stateless function approximators. Notice we have included the first question we asked and the models response in our input. Every time we ask it a new question in our conversation, we will have to supply the entire conversation history if we want it to know what we already discussed. LLMs have no built in way to remember past questions and conversations.
{% endhint %}
-Doing this by hand seems very tedious, how do we actually accomplish this in the real world? We use [Jinja](https://jinja.palletsprojects.com/en/3.1.x/) templates. Conversational models on HuggingFace typical come with a Jinja template which can be found in the `tokenizer_config.json`. [Checkout `meta-llama/Meta-Llama-3-8B-Instruct`'s Jinja template in the `tokenizer_config.json`](https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct/blob/main/tokenizer_config.json). For more information on Jinja templating check out [HuggingFace's introduction](https://huggingface.co/docs/transformers/main/chat_templating).
+Doing this by hand seems very tedious, how do we actually accomplish this in the real world? We use [Jinja](https://jinja.palletsprojects.com/en/3.1.x/) templates. Conversational models on HuggingFace typical come with a Jinja template which can be found in the `tokenizer_config.json`. [Checkout `meta-llama/Meta-Llama-3.1-8B-Instruct`'s Jinja template in the `tokenizer_config.json`](https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct/blob/main/tokenizer_config.json). For more information on Jinja templating check out [HuggingFace's introduction](https://huggingface.co/docs/transformers/main/chat_templating).
Luckily for everyone reading this, our `pgml` library automatically handles templating and formatting inputs correctly so we can skip a bunch of boring code. We do want to change up our program a little bit to take advantage of this automatic templating:
diff --git a/pgml-cms/docs/open-source/pgml/guides/unified-rag.md b/pgml-cms/docs/open-source/pgml/guides/unified-rag.md
index cf37afba7..32ce81bb2 100644
--- a/pgml-cms/docs/open-source/pgml/guides/unified-rag.md
+++ b/pgml-cms/docs/open-source/pgml/guides/unified-rag.md
@@ -48,7 +48,7 @@ Here is an example of the pgml.transform function
SELECT pgml.transform(
task => ''{
"task": "text-generation",
- "model": "meta-llama/Meta-Llama-3-8B-Instruct"
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct"
}''::JSONB,
inputs => ARRAY[''AI is going to''],
args => ''{
@@ -61,7 +61,7 @@ Here is another example of the pgml.transform function
SELECT pgml.transform(
task => ''{
"task": "text-generation",
- "model": "meta-llama/Meta-Llama-3-70B-Instruct"
+ "model": "meta-llama/Meta-Llama-3.1-70B-Instruct"
}''::JSONB,
inputs => ARRAY[''AI is going to''],
args => ''{
@@ -142,9 +142,9 @@ SELECT * FROM chunks limit 10;
| id | chunk | chunk_index | document_id |
| ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | ------------- |
| 1 | Here is an example of the pgml.transform function | 1 | 1 |
-| 2 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "meta-llama/Meta-Llama-3-8B-Instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); | 2 | 1 |
+| 2 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "meta-llama/Meta-Llama-3.1-8B-Instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); | 2 | 1 |
| 3 | Here is another example of the pgml.transform function | 3 | 1 |
-| 4 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "meta-llama/Meta-Llama-3-70B-Instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); | 4 | 1 |
+| 4 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "meta-llama/Meta-Llama-3.1-70B-Instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); | 4 | 1 |
| 5 | Here is a third example of the pgml.transform function | 5 | 1 |
| 6 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "microsoft/Phi-3-mini-128k-instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); | 6 | 1 |
| 7 | ae94d3413ae82367c3d0592a67302b25 | 1 | 2 |
@@ -250,8 +250,8 @@ LIMIT 6;
| 1 | 0.09044166306461232 | Here is an example of the pgml.transform function |
| 3 | 0.10787954026965096 | Here is another example of the pgml.transform function |
| 5 | 0.11683694289239333 | Here is a third example of the pgml.transform function |
-| 2 | 0.17699128851412282 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "meta-llama/Meta-Llama-3-8B-Instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); |
-| 4 | 0.17844729798760672 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "meta-llama/Meta-Llama-3-70B-Instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); |
+| 2 | 0.17699128851412282 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "meta-llama/Meta-Llama-3.1-8B-Instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); |
+| 4 | 0.17844729798760672 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "meta-llama/Meta-Llama-3.1-70B-Instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); |
| 6 | 0.17520464423854842 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "microsoft/Phi-3-mini-128k-instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); |
!!!
@@ -327,8 +327,8 @@ FROM (
| cosine_distance | rank_score | chunk |
| -------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| 0.2124727254737595 | 0.3427378833293915 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "meta-llama/Meta-Llama-3-70B-Instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); |
-| 0.2109014406365579 | 0.342184841632843 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "meta-llama/Meta-Llama-3-8B-Instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); |
+| 0.2124727254737595 | 0.3427378833293915 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "meta-llama/Meta-Llama-3.1-70B-Instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); |
+| 0.2109014406365579 | 0.342184841632843 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "meta-llama/Meta-Llama-3.1-8B-Instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); |
| 0.21259646694819168 | 0.3332781493663788 | SELECT pgml.transform(\n task => ''{\n "task": "text-generation",\n "model": "microsoft/Phi-3-mini-128k-instruct"\n }''::JSONB,\n inputs => ARRAY[''AI is going to''],\n args => ''{\n "max_new_tokens": 100\n }''::JSONB\n ); |
| 0.19483324929456136 | 0.03163915500044823 | Here is an example of the pgml.transform function |
| 0.1685870257610742 | 0.031176624819636345 | Here is a third example of the pgml.transform function |
@@ -402,7 +402,7 @@ SELECT
pgml.transform (
task => '{
"task": "conversational",
- "model": "meta-llama/Meta-Llama-3-8B-Instruct"
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct"
}'::jsonb,
inputs => ARRAY['{"role": "system", "content": "You are a friendly and helpful chatbot."}'::jsonb, jsonb_build_object('role', 'user', 'content', replace('Given the context answer the following question: How do I write a select statement with pgml.transform? Context:\n\n{CONTEXT}', '{CONTEXT}', chunk))],
args => '{
@@ -417,7 +417,7 @@ FROM
!!! results
```text
-["To write a SELECT statement with pgml.transform, you can use the following syntax:\n\n```sql\nSELECT pgml.transform(\n task => '{\n \"task\": \"text-generation\",\n \"model\": \"meta-llama/Meta-Llama-3-70B-Instruct\"\n }'::JSONB,\n inputs => ARRAY['AI is going to'],\n args => '{\n \"max_new_tokens\": 100\n }'::JSONB\n"]
+["To write a SELECT statement with pgml.transform, you can use the following syntax:\n\n```sql\nSELECT pgml.transform(\n task => '{\n \"task\": \"text-generation\",\n \"model\": \"meta-llama/Meta-Llama-3.1-70B-Instruct\"\n }'::JSONB,\n inputs => ARRAY['AI is going to'],\n args => '{\n \"max_new_tokens\": 100\n }'::JSONB\n"]
```
!!!
@@ -426,7 +426,7 @@ FROM
We have now combined the embedding api call, the semantic search api call, the rerank api call and the text generation api call from our RAG flow into one sql query.
-We are using `meta-llama/Meta-Llama-3-8B-Instruct` to perform text generation. We have a number of different models available for text generation, but for our use case `meta-llama/Meta-Llama-3-8B-Instruct` is a fantastic mix between speed and capability. For this simple example we are only passing the top search result as context to the LLM. In real world use cases, you will want to pass more results.
+We are using `meta-llama/Meta-Llama-3.1-8B-Instruct` to perform text generation. We have a number of different models available for text generation, but for our use case `meta-llama/Meta-Llama-3.1-8B-Instruct` is a fantastic mix between speed and capability. For this simple example we are only passing the top search result as context to the LLM. In real world use cases, you will want to pass more results.
We can stream from the database by using the `pgml.transform_stream` function and cursors. Here is a query measuring time to first token.
@@ -486,7 +486,7 @@ SELECT
pgml.transform_stream(
task => '{
"task": "conversational",
- "model": "meta-llama/Meta-Llama-3-8B-Instruct"
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct"
}'::jsonb,
inputs => ARRAY['{"role": "system", "content": "You are a friendly and helpful chatbot."}'::jsonb, jsonb_build_object('role', 'user', 'content', replace('Given the context answer the following question: How do I write a select statement with pgml.transform? Context:\n\n{CONTEXT}', '{CONTEXT}', chunk))],
args => '{
diff --git a/pgml-dashboard/src/components/code_editor/editor/mod.rs b/pgml-dashboard/src/components/code_editor/editor/mod.rs
index 5a4083493..2f8b72b80 100644
--- a/pgml-dashboard/src/components/code_editor/editor/mod.rs
+++ b/pgml-dashboard/src/components/code_editor/editor/mod.rs
@@ -23,7 +23,7 @@ impl Editor {
show_task: false,
show_question_input: false,
task: "text-generation".to_string(),
- model: "meta-llama/Meta-Llama-3-8B-Instruct".to_string(),
+ model: "meta-llama/Meta-Llama-3.1-8B-Instruct".to_string(),
btn_location: "text-area".to_string(),
btn_style: "party".to_string(),
is_editable: true,
diff --git a/pgml-dashboard/src/components/code_editor/editor/template.html b/pgml-dashboard/src/components/code_editor/editor/template.html
index 5eb6631f9..2bf0541ee 100644
--- a/pgml-dashboard/src/components/code_editor/editor/template.html
+++ b/pgml-dashboard/src/components/code_editor/editor/template.html
@@ -78,8 +78,8 @@
// The number is the average time it takes to run in seconds
// text-generation
- "meta-llama/Meta-Llama-3-8B-Instruct", // G
- "meta-llama/Meta-Llama-3-70B-Instruct", // G
+ "meta-llama/Meta-Llama-3.1-8B-Instruct", // G
+ "meta-llama/Meta-Llama-3.1-70B-Instruct", // G
"mistralai/Mixtral-8x7B-Instruct-v0.1", // G
"mistralai/Mistral-7B-Instruct-v0.2", // G
diff --git a/pgml-dashboard/src/components/tables/serverless_models/mod.rs b/pgml-dashboard/src/components/tables/serverless_models/mod.rs
index b77ead764..0249250b0 100644
--- a/pgml-dashboard/src/components/tables/serverless_models/mod.rs
+++ b/pgml-dashboard/src/components/tables/serverless_models/mod.rs
@@ -48,14 +48,14 @@ impl ServerlessModels {
],
instruct_models: [
Component::from(Row::new(&[
- "meta-llama/Meta-Llama-3-70B-Instruct".into(),
+ "meta-llama/Meta-Llama-3.1-70B-Instruct".into(),
"70,000".into(),
"70,000".into(),
"8,000".into(),
"Highest quality".into(),
])),
Component::from(Row::new(&[
- "meta-llama/Meta-Llama-3-8B-Instruct".into(),
+ "meta-llama/Meta-Llama-3.1-8B-Instruct".into(),
"8,000".into(),
"8,000".into(),
"8,000".into(),
diff --git a/pgml-dashboard/static/js/utilities/demo.js b/pgml-dashboard/static/js/utilities/demo.js
index 15e63ed67..191b19f4b 100644
--- a/pgml-dashboard/static/js/utilities/demo.js
+++ b/pgml-dashboard/static/js/utilities/demo.js
@@ -40,7 +40,7 @@ SELECT
pgml.transform(
task => '{
"task": "conversational",
- "model": "meta-llama/Meta-Llama-3-8B-Instruct"
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct"
}'::jsonb,
inputs => ARRAY['{"role": "system", "content": "You are a friendly and helpful chatbot."}'::jsonb, jsonb_build_object('role', 'user', 'content', replace('Given the context answer the following question. ${userInput}? Context:\n{CONTEXT}', '{CONTEXT}', chunk))],
args => '{
@@ -258,8 +258,8 @@ export const generateModels = (task) => {
];
case "text-generation":
return [
- "meta-llama/Meta-Llama-3-8B-Instruct",
- "meta-llama/Meta-Llama-3-70B-Instruct",
+ "meta-llama/Meta-Llama-3.1-8B-Instruct",
+ "meta-llama/Meta-Llama-3.1-70B-Instruct",
"mistralai/Mixtral-8x7B-Instruct-v0.1",
"mistralai/Mistral-7B-Instruct-v0.2",
];
diff --git a/pgml-extension/examples/embedding.sql b/pgml-extension/examples/embedding.sql
index 4e6c5968d..2b97ba4cb 100644
--- a/pgml-extension/examples/embedding.sql
+++ b/pgml-extension/examples/embedding.sql
@@ -5,3 +5,4 @@ SELECT pgml.embed('Alibaba-NLP/gte-base-en-v1.5', 'hi mom', '{"device": "cuda",
SELECT pgml.embed('Alibaba-NLP/gte-base-en-v1.5', 'hi mom', '{"device": "cpu", "trust_remote_code": true}');
SELECT pgml.embed('hkunlp/instructor-xl', 'hi mom', '{"instruction": "Encode it with love"}');
SELECT pgml.embed('mixedbread-ai/mxbai-embed-large-v1', 'test', '{"prompt": "test prompt: "}');
+SELECT pgml.embed('sentence-transformers/all-MiniLM-L6-v2', 'hi mom');
diff --git a/pgml-extension/examples/transformers.sql b/pgml-extension/examples/transformers.sql
index 83975d45a..5cb23b5a0 100644
--- a/pgml-extension/examples/transformers.sql
+++ b/pgml-extension/examples/transformers.sql
@@ -11,10 +11,11 @@ SELECT pgml.embed('mixedbread-ai/mxbai-embed-large-v1', 'test', '{"prompt": "tes
SELECT pgml.transform_stream(
task => '{
"task": "text-generation",
- "model": "meta-llama/Meta-Llama-3-8B-Instruct",
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"model_type": "mistral",
"revision": "main",
- "device_map": "auto"
+ "device_map": "auto",
+ "token": "hf_123"
}'::JSONB,
input => 'AI is going to',
args => '{
diff --git a/pgml-sdks/pgml/c/example.c b/pgml-sdks/pgml/c/example.c
index fc85d6523..a2375f9dc 100644
--- a/pgml-sdks/pgml/c/example.c
+++ b/pgml-sdks/pgml/c/example.c
@@ -34,7 +34,7 @@ int main() {
}
// Test the TransformerPipeline
- TransformerPipelineC * t_pipeline = pgml_transformerpipelinec_new("text-generation", "meta-llama/Meta-Llama-3-8B-Instruct", NULL, NULL);
+ TransformerPipelineC * t_pipeline = pgml_transformerpipelinec_new("text-generation", "meta-llama/Meta-Llama-3.1-8B-Instruct", NULL, NULL);
GeneralJsonAsyncIteratorC * t_pipeline_iter = pgml_transformerpipelinec_transform_stream(t_pipeline, "\"AI is going to\"", "{\"max_new_tokens\": 100}", NULL);
while (!pgml_generaljsonasynciteratorc_done(t_pipeline_iter)) {
char * res = pgml_generaljsonasynciteratorc_next(t_pipeline_iter);
diff --git a/pgml-sdks/pgml/javascript/tests/typescript-tests/test.ts b/pgml-sdks/pgml/javascript/tests/typescript-tests/test.ts
index f35e8efbb..5fc5ce9fa 100644
--- a/pgml-sdks/pgml/javascript/tests/typescript-tests/test.ts
+++ b/pgml-sdks/pgml/javascript/tests/typescript-tests/test.ts
@@ -196,7 +196,7 @@ it("can rag", async () => {
aggregate: { join: "\n" },
},
completion: {
- model: "meta-llama/Meta-Llama-3-8B-Instruct",
+ model: "meta-llama/Meta-Llama-3.1-8B-Instruct",
prompt: "Some text with {CONTEXT}",
max_tokens: 10,
},
@@ -237,7 +237,7 @@ it("can rag stream", async () => {
aggregate: { join: "\n" },
},
completion: {
- model: "meta-llama/Meta-Llama-3-8B-Instruct",
+ model: "meta-llama/Meta-Llama-3.1-8B-Instruct",
prompt: "Some text with {CONTEXT}",
max_tokens: 10,
},
@@ -314,13 +314,13 @@ it("can order documents", async () => {
///////////////////////////////////////////////////
it("can transformer pipeline", async () => {
- const t = pgml.newTransformerPipeline("text-generation", "meta-llama/Meta-Llama-3-8B-Instruct");
+ const t = pgml.newTransformerPipeline("text-generation", "meta-llama/Meta-Llama-3.1-8B-Instruct");
const it = await t.transform(["AI is going to"], { max_tokens: 5 });
expect(it.length).toBeGreaterThan(0)
});
it("can transformer pipeline stream", async () => {
- const t = pgml.newTransformerPipeline("text-generation", "meta-llama/Meta-Llama-3-8B-Instruct");
+ const t = pgml.newTransformerPipeline("text-generation", "meta-llama/Meta-Llama-3.1-8B-Instruct");
const it = await t.transform_stream("AI is going to", { max_tokens: 5 });
let result = await it.next();
let output = [];
diff --git a/pgml-sdks/pgml/python/examples/rag_question_answering.py b/pgml-sdks/pgml/python/examples/rag_question_answering.py
index 555e50d87..43580a05b 100644
--- a/pgml-sdks/pgml/python/examples/rag_question_answering.py
+++ b/pgml-sdks/pgml/python/examples/rag_question_answering.py
@@ -80,7 +80,7 @@ async def main():
# Using OpenSource LLMs for Chat Completion
client = OpenSourceAI()
- chat_completion_model = "meta-llama/Meta-Llama-3-8B-Instruct"
+ chat_completion_model = "meta-llama/Meta-Llama-3.1-8B-Instruct"
console.print("Generating response using %s LLM..."%chat_completion_model)
response = client.chat_completions_create(
model=chat_completion_model,
diff --git a/pgml-sdks/pgml/python/tests/test.py b/pgml-sdks/pgml/python/tests/test.py
index b7367103a..f90b49e19 100644
--- a/pgml-sdks/pgml/python/tests/test.py
+++ b/pgml-sdks/pgml/python/tests/test.py
@@ -250,7 +250,7 @@ async def test_can_rag():
"aggregate": {"join": "\n"},
},
"completion": {
- "model": "meta-llama/Meta-Llama-3-8B-Instruct",
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"prompt": "Some text with {CONTEXT}",
"max_tokens": 10,
},
diff --git a/pgml-sdks/pgml/src/builtins.rs b/pgml-sdks/pgml/src/builtins.rs
index f8e913f2c..8cd627ae4 100644
--- a/pgml-sdks/pgml/src/builtins.rs
+++ b/pgml-sdks/pgml/src/builtins.rs
@@ -169,7 +169,7 @@ mod tests {
let builtins = Builtins::new(None);
let task = Json::from(serde_json::json!({
"task": "text-generation",
- "model": "meta-llama/Meta-Llama-3-8B-Instruct"
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct"
}));
let inputs = vec!["test1".to_string(), "test2".to_string()];
let results = builtins.transform(task, inputs, None).await?;
diff --git a/pgml-sdks/pgml/src/collection.rs b/pgml-sdks/pgml/src/collection.rs
index b0a814b4f..3ea421e8c 100644
--- a/pgml-sdks/pgml/src/collection.rs
+++ b/pgml-sdks/pgml/src/collection.rs
@@ -1185,7 +1185,7 @@ impl Collection {
/// "sql": "SELECT 'test'"
/// },
/// "chat": {
- /// "model": "meta-llama/Meta-Llama-3-8B-Instruct",
+ /// "model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
/// "messages": [
/// {
/// "role": "system",
diff --git a/pgml-sdks/pgml/src/lib.rs b/pgml-sdks/pgml/src/lib.rs
index 16ec25ece..33f9c0100 100644
--- a/pgml-sdks/pgml/src/lib.rs
+++ b/pgml-sdks/pgml/src/lib.rs
@@ -2301,7 +2301,7 @@ mod tests {
}
},
"completion": {
- "model": "meta-llama/Meta-Llama-3-8B-Instruct",
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"prompt": "Some text with {CONTEXT}",
"max_tokens": 10,
}
diff --git a/pgml-sdks/pgml/src/open_source_ai.rs b/pgml-sdks/pgml/src/open_source_ai.rs
index 1ed511c73..32a7dcfff 100644
--- a/pgml-sdks/pgml/src/open_source_ai.rs
+++ b/pgml-sdks/pgml/src/open_source_ai.rs
@@ -38,7 +38,7 @@ fn try_model_nice_name_to_model_name_and_parameters(
"task": "conversational",
"model": "meta-llama/Meta-Llama-3-8B-Instruct"
})
- .into(),
+ .into(),
)),
"meta-llama/Meta-Llama-3-70B-Instruct" => Some((
"meta-llama/Meta-Llama-3-70B-Instruct",
@@ -46,7 +46,31 @@ fn try_model_nice_name_to_model_name_and_parameters(
"task": "conversational",
"model": "meta-llama/Meta-Llama-3-70B-Instruct"
})
- .into(),
+ .into(),
+ )),
+ "meta-llama/Meta-Llama-3.1-8B-Instruct" => Some((
+ "meta-llama/Meta-Llama-3.1-8B-Instruct",
+ serde_json::json!({
+ "task": "conversational",
+ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct"
+ })
+ .into(),
+ )),
+ "meta-llama/Meta-Llama-3.1-70B-Instruct" => Some((
+ "meta-llama/Meta-Llama-3.1-70B-Instruct",
+ serde_json::json!({
+ "task": "conversational",
+ "model": "meta-llama/Meta-Llama-3.1-70B-Instruct"
+ })
+ .into(),
+ )),
+ "meta-llama/Meta-Llama-3.1-405B-Instruct" => Some((
+ "meta-llama/Meta-Llama-3.1-405B-Instruct",
+ serde_json::json!({
+ "task": "conversational",
+ "model": "meta-llama/Meta-Llama-3.1-405B-Instruct"
+ })
+ .into(),
)),
"microsoft/Phi-3-mini-128k-instruct" => Some((
"microsoft/Phi-3-mini-128k-instruct",
@@ -349,7 +373,7 @@ mod tests {
#[test]
fn can_open_source_ai_create() -> anyhow::Result<()> {
let client = OpenSourceAI::new(None);
- let results = client.chat_completions_create(Json::from_serializable("meta-llama/Meta-Llama-3-8B-Instruct"), vec![
+ let results = client.chat_completions_create(Json::from_serializable("meta-llama/Meta-Llama-3.1-8B-Instruct"), vec![
serde_json::json!({"role": "system", "content": "You are a friendly chatbot who always responds in the style of a pirate"}).into(),
serde_json::json!({"role": "user", "content": "How many helicopters can a human eat in one sitting?"}).into(),
], Some(10), None, Some(3), None)?;
@@ -360,7 +384,7 @@ mod tests {
#[sqlx::test]
fn can_open_source_ai_create_async() -> anyhow::Result<()> {
let client = OpenSourceAI::new(None);
- let results = client.chat_completions_create_async(Json::from_serializable("meta-llama/Meta-Llama-3-8B-Instruct"), vec![
+ let results = client.chat_completions_create_async(Json::from_serializable("meta-llama/Meta-Llama-3.1-8B-Instruct"), vec![
serde_json::json!({"role": "system", "content": "You are a friendly chatbot who always responds in the style of a pirate"}).into(),
serde_json::json!({"role": "user", "content": "How many helicopters can a human eat in one sitting?"}).into(),
], Some(10), None, Some(3), None).await?;
@@ -371,7 +395,7 @@ mod tests {
#[sqlx::test]
fn can_open_source_ai_create_stream_async() -> anyhow::Result<()> {
let client = OpenSourceAI::new(None);
- let mut stream = client.chat_completions_create_stream_async(Json::from_serializable("meta-llama/Meta-Llama-3-8B-Instruct"), vec![
+ let mut stream = client.chat_completions_create_stream_async(Json::from_serializable("meta-llama/Meta-Llama-3.1-8B-Instruct"), vec![
serde_json::json!({"role": "system", "content": "You are a friendly chatbot who always responds in the style of a pirate"}).into(),
serde_json::json!({"role": "user", "content": "How many helicopters can a human eat in one sitting?"}).into(),
], Some(10), None, Some(3), None).await?;
@@ -384,7 +408,7 @@ mod tests {
#[test]
fn can_open_source_ai_create_stream() -> anyhow::Result<()> {
let client = OpenSourceAI::new(None);
- let iterator = client.chat_completions_create_stream(Json::from_serializable("meta-llama/Meta-Llama-3-8B-Instruct"), vec![
+ let iterator = client.chat_completions_create_stream(Json::from_serializable("meta-llama/Meta-Llama-3.1-8B-Instruct"), vec![
serde_json::json!({"role": "system", "content": "You are a friendly chatbot who always responds in the style of a pirate"}).into(),
serde_json::json!({"role": "user", "content": "How many helicopters can a human eat in one sitting?"}).into(),
], Some(10), None, Some(3), None)?;
diff --git a/pgml-sdks/pgml/src/transformer_pipeline.rs b/pgml-sdks/pgml/src/transformer_pipeline.rs
index bb44e591a..3773b1357 100644
--- a/pgml-sdks/pgml/src/transformer_pipeline.rs
+++ b/pgml-sdks/pgml/src/transformer_pipeline.rs
@@ -231,7 +231,7 @@ mod tests {
internal_init_logger(None, None).ok();
let t = TransformerPipeline::new(
"text-generation",
- "meta-llama/Meta-Llama-3-8B-Instruct",
+ "meta-llama/Meta-Llama-3.1-8B-Instruct",
None,
None,
);