🌐 AI搜索 & 代理 主页
Skip to content

Commit 58f8a9a

Browse files
authored
Merge branch 'master' into set-omp-num-threads
2 parents 99bebe2 + 730d523 commit 58f8a9a

File tree

73 files changed

+307
-252
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+307
-252
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ SELECT pgml.transform(
108108
```
109109

110110
## Tabular data
111-
- [47+ classification and regression algorithms](https://postgresml.org/docs/introduction/apis/sql-extensions/pgml.train/)
111+
- [47+ classification and regression algorithms](https://postgresml.org/docs/api/sql-extension/pgml.train/)
112112
- [8 - 40X faster inference than HTTP based model serving](https://postgresml.org/blog/postgresml-is-8x-faster-than-python-http-microservices)
113113
- [Millions of transactions per second](https://postgresml.org/blog/scaling-postgresml-to-one-million-requests-per-second)
114114
- [Horizontal scalability](https://github.com/postgresml/pgcat)

pgml-apps/pgml-chat/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ A command line tool to build and deploy a **_knowledge based_** chatbot using Po
33

44
There are two stages in building a knowledge based chatbot:
55
- Build a knowledge base by ingesting documents, chunking documents, generating embeddings and indexing these embeddings for fast query
6-
- Generate responses to user queries by retrieving relevant documents and generating responses using OpenAI and [OpenSourceAI API](https://postgresml.org/docs/introduction/apis/client-sdks/opensourceai)
6+
- Generate responses to user queries by retrieving relevant documents and generating responses using OpenAI and [OpenSourceAI API](https://postgresml.org/docs/api/client-sdk/opensourceai)
77

88
This tool automates the above two stages and provides a command line interface to build and deploy a knowledge based chatbot.
99

pgml-cms/blog/SUMMARY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
* [Introducing the OpenAI Switch Kit: Move from closed to open-source AI in minutes](introducing-the-openai-switch-kit-move-from-closed-to-open-source-ai-in-minutes.md)
55
* [Speeding up vector recall 5x with HNSW](speeding-up-vector-recall-5x-with-hnsw.md)
66
* [How-to Improve Search Results with Machine Learning](how-to-improve-search-results-with-machine-learning.md)
7+
* [Meet us at the 2024 Postgres Conference!](meet-us-at-the-2024-postgres-conference.md)
78
* [The 1.0 SDK is Here](the-1.0-sdk-is-here.md)
8-
* [PostgresML is going multicloud](postgresml-is-going-multicloud.md)
99
* [Using PostgresML with Django and embedding search](using-postgresml-with-django-and-embedding-search.md)
10+
* [PostgresML is going multicloud](postgresml-is-going-multicloud.md)
1011
* [pgml-chat: A command-line tool for deploying low-latency knowledge-based chatbots](pgml-chat-a-command-line-tool-for-deploying-low-latency-knowledge-based-chatbots-part-i.md)
1112
* [Announcing Support for AWS us-east-1 Region](announcing-support-for-aws-us-east-1-region.md)
1213
* [LLM based pipelines with PostgresML and dbt (data build tool)](llm-based-pipelines-with-postgresml-and-dbt-data-build-tool.md)

pgml-cms/blog/announcing-support-for-aws-us-east-1-region.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,8 @@ To demonstrate the impact of moving the data closer to your application, we've c
2727

2828
<figure><img src=".gitbook/assets/image (8).png" alt=""><figcaption></figcaption></figure>
2929

30-
\
31-
32-
3330
<figure><img src=".gitbook/assets/image (9).png" alt=""><figcaption></figcaption></figure>
3431

35-
\
36-
37-
3832
## Using the New Region
3933

4034
To take advantage of latency savings, you can [deploy a dedicated PostgresML database](https://postgresml.org/signup) in `us-east-1` today. We make it as simple as filling out a very short form and clicking "Create database".

pgml-cms/blog/generating-llm-embeddings-with-open-source-models-in-postgresml.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ Montana Low
1818

1919
April 21, 2023
2020

21-
PostgresML makes it easy to generate embeddings from text in your database using a large selection of state-of-the-art models with one simple call to **`pgml.embed`**`(model_name, text)`. Prove the results in this series to your own satisfaction, for free, by signing up for a GPU accelerated database.
21+
PostgresML makes it easy to generate embeddings from text in your database using a large selection of state-of-the-art models with one simple call to `pgml.embed(model_name, text)`. Prove the results in this series to your own satisfaction, for free, by signing up for a GPU accelerated database.
2222

2323
This article is the first in a multipart series that will show you how to build a post-modern semantic search and recommendation engine, including personalization, using open source models.
2424

25-
1. Generating LLM Embeddings with HuggingFace models
26-
2. Tuning vector recall with pgvector
27-
3. Personalizing embedding results with application data
28-
4. Optimizing semantic results with an XGBoost ranking model - coming soon!
25+
1. [Generating LLM Embeddings with HuggingFace models](generating-llm-embeddings-with-open-source-models-in-postgresml.md)
26+
2. [Tuning vector recall with pgvector](tuning-vector-recall-while-generating-query-embeddings-in-the-database.md)
27+
3. [Personalizing embedding results with application data](personalize-embedding-results-with-application-data-in-your-database.md)
28+
4. [Optimizing semantic results with an XGBoost ranking model](/docs/use-cases/improve-search-results-with-machine-learning)
2929

3030
## Introduction
3131

@@ -216,9 +216,6 @@ For comparison, it would cost about $299 to use OpenAI's cheapest embedding mode
216216
| GPU | 17ms | $72 | 6 hours |
217217
| OpenAI | 300ms | $299 | millennia |
218218

219-
\
220-
221-
222219
You can also find embedding models that outperform OpenAI's `text-embedding-ada-002` model across many different tests on the [leaderboard](https://huggingface.co/spaces/mteb/leaderboard). It's always best to do your own benchmarking with your data, models, and hardware to find the best fit for your use case.
223220

224221
> _HTTP requests to a different datacenter cost more time and money for lower reliability than co-located compute and storage._

pgml-cms/blog/introducing-the-openai-switch-kit-move-from-closed-to-open-source-ai-in-minutes.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ December 1, 2023
2121

2222
### Introduction
2323

24-
Last week's whirlwind of events with OpenAI CEO and founder Sam Altman stirred up quite a buzz in the industry. The whole deal left many of us scratching our heads about where OpenAI is headed. Between the corporate drama, valid worries about privacy and transparency, and ongoing issues around model performance, censorship, and the use of marketing scare tactics; it's no wonder there's a growing sense of dissatisfaction and distrust in proprietary models.&#x20;
24+
Last week's whirlwind of events with OpenAI CEO and founder Sam Altman stirred up quite a buzz in the industry. The whole deal left many of us scratching our heads about where OpenAI is headed. Between the corporate drama, valid worries about privacy and transparency, and ongoing issues around model performance, censorship, and the use of marketing scare tactics; it's no wonder there's a growing sense of dissatisfaction and distrust in proprietary models.
2525

2626
On the bright side, the open-source realm has emerged as a potent contender, not just in reaction to OpenAI's shortcomings but as a genuine advancement in its own right. We're all about making the benefits of open-source models accessible to as many folks as possible. So, we've made switching from OpenAI to open-source as easy as possible with a drop-in replacement. It lets users specify any model they’d like in just a few lines of code. We call it the OpenAI Switch Kit. Read on to learn more about why we think you’ll like it, or just try it now and see what you think.
2727

2828
### Is switching to open-source AI right for you?
2929

3030
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:
3131

32-
* **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.&#x20;
33-
* **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.&#x20;
34-
* **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.&#x20;
35-
* **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.&#x20;
32+
* **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.
33+
* **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.
34+
* **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.
35+
* **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.
3636

3737
### Try it now
3838

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
description: Announcing our sponsorship of the Postgres Conference in San Jose April 17-19
3+
---
4+
5+
# Meet us at the 2024 Postgres Conference!
6+
7+
<div align="left">
8+
9+
<figure><img src=".gitbook/assets/image.png" alt="Author" width="100"><figcaption></figcaption></figure>
10+
11+
</div>
12+
13+
Cassandra Stumer
14+
15+
March 20, 2023
16+
17+
Hey database aficionados, mark your calendars because something big is coming your way! We're thrilled to announce that we will be sponsoring the[ 2024 Postgres Conference](https://postgresconf.org/conferences/2024) – the marquee PostgreSQL conference event for North America.&#x20;
18+
19+
Why should you care? It's not every day you get to dive headfirst into the world of Postgres with folks who eat, sleep, and breathe data. We're talking hands-on workshops, lightning talks, and networking galore. Whether you're itching to sharpen your SQL skills or keen to explore the frontier of machine learning in the database, we've got you covered.
20+
21+
{% hint style="info" %}
22+
Save 25% on your ticket with our discount code: 2024\_POSTGRESML\_25
23+
{% endhint %}
24+
25+
PostgresML CEO and founder, Montana Low, will kick off the event on April 17th with a keynote about navigating the confluence of hardware evolution and machine learning technology.&#x20;
26+
27+
We’ll also be hosting a masterclass in retrieval augmented generation (RAG) on April 18th. Our own Silas Marvin will give hands-on guidance to equip you with the ability to implement RAG directly within your database.&#x20;
28+
29+
But wait, there's more! Our senior team will be at our booth at all hours to get to know you, talk shop, and answer any questions you may have. Whether it's about PostgresML, machine learning, or all the sweet merch we’ll have on deck.&#x20;
30+
31+
{% hint style="info" %}
32+
If you’d like some 1:1 time with our team at PgConf [contact us here](https://postgresml.org/contact). We’d be happy to prep something special for you.&#x20;
33+
{% endhint %}
34+
35+
So, why sit on the sidelines when you could be right in the thick of it, soaking up knowledge, making connections, and maybe even stumbling upon your next big breakthrough? Clear your schedule, grab your ticket, and get ready to geek out with us in San Jose.
36+
37+
See you there!

pgml-cms/blog/mindsdb-vs-postgresml.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ Both Projects integrate several dozen machine learning algorithms, including the
4747
| Full Text Search | - ||
4848
| Geospatial Search | - ||
4949

50-
\
51-
52-
5350
Both MindsDB and PostgresML support many classical machine learning algorithms to do classification and regression. They are both able to load ~~the latest LLMs~~ some models from Hugging Face, supported by underlying implementations in libtorch. I had to cross that out after exploring all the caveats in the MindsDB implementations. PostgresML supports the models released immediately as long as underlying dependencies are met. MindsDB has to release an update to support any new models, and their current model support is extremely limited. New algorithms, tasks, and models are constantly released, so it's worth checking the documentation for the latest list.
5451

5552
Another difference is that PostgresML also supports embedding models, and closely integrates them with vector search inside the database, which is well beyond the scope of MindsDB, since it's not a database at all. PostgresML has direct access to all the functionality provided by other Postgres extensions, like vector indexes from [pgvector](https://github.com/pgvector/pgvector) to perform efficient KNN & ANN vector recall, or [PostGIS](http://postgis.net/) for geospatial information as well as built in full text search. Multiple algorithms and extensions can be combined in compound queries to build state-of-the-art systems, like search and recommendations or fraud detection that generate an end to end result with a single query, something that might take a dozen different machine learning models and microservices in a more traditional architecture.
@@ -300,9 +297,6 @@ PostgresML is the clear winner in terms of performance. It seems to me that it c
300297
| translation\_en\_to\_es | t5-base | 1573 | 1148 | 294 |
301298
| summarization | sshleifer/distilbart-cnn-12-6 | 4289 | 3450 | 479 |
302299

303-
\
304-
305-
306300
There is a general trend, the larger and slower the model is, the more work is spent inside libtorch, the less the performance of the rest matters, but for interactive models and use cases there is a significant difference. We've tried to cover the most generous use case we could between these two. If we were to compare XGBoost or other classical algorithms, that can have sub millisecond prediction times in PostgresML, the 20ms Python service overhead of MindsDB just to parse the incoming query would be hundreds of times slower.
307301

308302
## Clouds

pgml-cms/blog/personalize-embedding-results-with-application-data-in-your-database.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ PostgresML makes it easy to generate embeddings using open source models from Hu
2222

2323
This article is the third in a multipart series that will show you how to build a post-modern semantic search and recommendation engine, including personalization, using open source models. You may want to start with the previous articles in the series if you aren't familiar with PostgresML's capabilities.
2424

25-
1. Generating LLM Embeddings with HuggingFace models
26-
2. Tuning vector recall with pgvector
27-
3. Personalizing embedding results with application data
28-
4. Optimizing semantic results with an XGBoost ranking model - coming soon!
25+
1. [Generating LLM Embeddings with HuggingFace models](generating-llm-embeddings-with-open-source-models-in-postgresml.md)
26+
2. [Tuning vector recall with pgvector](tuning-vector-recall-while-generating-query-embeddings-in-the-database.md)
27+
3. [Personalizing embedding results with application data](personalize-embedding-results-with-application-data-in-your-database.md)
28+
4. [Optimizing semantic results with an XGBoost ranking model](/docs/use-cases/improve-search-results-with-machine-learning)
2929

3030
<figure><img src=".gitbook/assets/image (24).png" alt=""><figcaption><p>Embeddings can be combined into personalized perspectives when stored as vectors in the database.</p></figcaption></figure>
3131

pgml-cms/blog/postgresml-as-a-memory-backend-to-auto-gpt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Adding PostgresML as a memory backend to Auto-GPT is a relatively simple process
8888
POSTGRESML_TABLENAME =autogpt_text_embeddings
8989
```
9090

91-
If you are using PostgresML cloud, use the hostname and credentials from the cloud platform.&#x20;
91+
If you are using PostgresML cloud, use the hostname and credentials from the cloud platform.
9292

9393
!!! note
9494

0 commit comments

Comments
 (0)