---
title: "Mistral 7B and BAAI on Workers AI vs. OpenAI Models for RAG"
description: "Swapping gpt-3.5-turbo for mistral-7b-instruct-v0.1 and text-embedding-ada-002 for BAAI's bge-base-en-v1.5 (both on Cloudflare Workers AI) in Neon's docs chatbot shows embeddings are close to interchangeable but text generation is not."
url: "https://swe.quest/articles/mistral-7b-and-baai-on-workers-ai-vs-openai-models-for-rag-30d70a2c28e85606"
canonical: "https://neon.com/blog/mistral-7b-and-baai-on-workers-ai-vs-openai-models-for-rag"
source: "Neon"
published: "2023-12-11"
difficulty: "medium"
kind: "Research"
reading_minutes: 7
tags: ["rag","llms","evals","inference"]
---

# Mistral 7B and BAAI on Workers AI vs. OpenAI Models for RAG

A post on [Neon](https://swe.quest/sources/neon.md), published 2023-12-11, 7 min read, Research. Original: [https://neon.com/blog/mistral-7b-and-baai-on-workers-ai-vs-openai-models-for-rag](https://neon.com/blog/mistral-7b-and-baai-on-workers-ai-vs-openai-models-for-rag)

## Summary

Swapping gpt-3.5-turbo for mistral-7b-instruct-v0.1 and text-embedding-ada-002 for BAAI's bge-base-en-v1.5 (both on Cloudflare Workers AI) in Neon's docs chatbot shows embeddings are close to interchangeable but text generation is not. Across eight Postgres questions, the two embedding models returned the same retrieved chunks 46% of the time at k=3 (42% at k=10), with Jaccard and TF-IDF cosine scores indicating substantial context overlap. Expert raters scored GPT-3.5 answers 3.8/5 versus 2.5/5 for Mistral 7B. Migrating embeddings to BGE looks viable and can cut vector storage, while replacing the generation model would noticeably hurt answer quality.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [RAG & retrieval](https://swe.quest/tags/rag.md) (AI & ML)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Evaluation](https://swe.quest/tags/evals.md) (AI & ML)
- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)

## Prerequisites

- RAG pipeline basics ([easy posts on RAG & retrieval](https://swe.quest/tags/rag.md?difficulty=easy))
- text embeddings ([easy posts on RAG & retrieval](https://swe.quest/tags/rag.md?difficulty=easy))
- semantic similarity search ([easy posts on Search](https://swe.quest/tags/search.md?difficulty=easy))

## Keywords

Mistral 7B, bge-base-en-v1.5, gpt-3.5-turbo, text-embedding-ada-002, Cloudflare Workers AI, Hugging Face Inference Endpoints, Neon

## Related posts

- [Building a RAG application with Llama 3.1 and pgvector](https://swe.quest/articles/building-a-rag-application-with-llama-3-1-and-pgvector-aa7660e0eb99da02.md): Neon · 2024-07-30 · Medium · 12 min read · RAG & retrieval, Vector search, PostgreSQL, LLMs, Python
  A small RAG pipeline built on Neon Postgres with pgvector as the vector store, OctoAI's gte-large embedding model producing 1024-dimensional vectors, and Llama 3.1 405B generating answers.
- [Mixtral 8x7B: What you need to know about Mistral AI’s latest model](https://swe.quest/articles/mixtral-8x7b-what-you-need-to-know-about-mistral-ai-s-latest-model-a28151710dbf752c.md): Neon · 2023-12-11 · Easy · 5 min read · LLMs, Inference & serving, RAG & retrieval
  Mixtral 8x7B, Mistral AI's new open model, supports 32k-token context, improves code generation and matches or beats Llama 2 70B and GPT-3.5 on benchmarks such as MMLU, MBPP and GSM-8K.
- [Building an AI-powered ChatBot using Vercel, OpenAI, and Postgres](https://swe.quest/articles/building-an-ai-powered-chatbot-using-vercel-openai-and-postgres-4fd423473384581f.md): Neon · 2023-03-09 · Medium · 13 min read · RAG & retrieval, PostgreSQL, Vector search, LLMs, Serverless
  A ChatGPT-style documentation assistant (Ask Neon) is built by storing OpenAI text-embedding-ada-002 vectors in Postgres with pgvector, retrieving context by cosine distance, and feeding it to text-davinci-003 from a Vercel Edge Function.
- [Building Data-Aware AI Applications with Heroku AI and LlamaIndex](https://swe.quest/articles/building-data-aware-ai-applications-with-heroku-ai-and-llamaindex-8f85403b0aabecc2.md): Heroku Engineering · 2025-08-19 · Medium · 4 min read · RAG & retrieval, Vector search, PostgreSQL, Python, LLMs
  A RAG stack on Heroku pairs LlamaIndex for ingestion, indexing and retrieval with Heroku Managed Inference (Claude 4 Sonnet via an OpenAI-compatible API), Cohere Embed Multilingual for embeddings, and Heroku Postgres with pgvector as the vector store.
- [Training 100x Cheaper Retrieval models Neon and Castform](https://swe.quest/articles/training-100x-cheaper-retrieval-models-neon-and-castform-05a64846d2e32056.md): Neon · 2026-08-05 · Easy · 5 min read · Model training, RAG & retrieval, PostgreSQL, AI agents, Search
  Castform uses data stored in Neon Postgres, exposed through Lakebase Search's BM25 and vector functions, to RL post-train a 4B open-source model for agentic retrieval.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
