How to run Mem0 with a self-hosted model on a cloud GPU
Rent a GPU on Deploy, then open a terminal in JupyterLab or over SSH. Install Mem0 with the pip install mem0ai line the Python quickstart prints, serve an ungated open-weight model on that machine, and point Memory.from_config at the Ollama or vLLM block the current docs print. Copy the search printout and the local Qdrant and history files before you destroy the instance, because destroying the instance deletes its disk.
An agent can rent the GPU and run this library against a model served on it. The agent pages are GPU compute for AI agents and the agent integration guide. Those pages are how an agent discovers a GPU and runs work on it. This page is the Mem0 open-source install. A general vLLM install is How to serve an OpenAI-compatible API with vLLM on a cloud GPU. A general SGLang install is How to run SGLang on a cloud GPU. Ollama’s install and port 11434 are How to run Ollama on a cloud GPU. An OpenAI-compatible engine whose CUDA 12 container tag is localai/localai:latest-gpu-nvidia-cuda-12 is How to run LocalAI on a cloud GPU. A gateway whose README prints uv tool install 'litellm[proxy]' is How to run LiteLLM Proxy in front of a self-hosted model on a cloud GPU. A memory agent whose local backend points at Ollama or an OpenAI-compatible URL is How to run Letta agents with a self-hosted model on a cloud GPU. CloudGPU’s hosted gateway is a different base URL: How do I use an OpenAI-compatible API for open models?. How published weight sizes are read: How much VRAM do I need to run an LLM?. A graph library whose Ollama section sets OpenAIGenericClient base_url to http://localhost:11434/v1 is How to run Graphiti with a self-hosted model on a cloud GPU. A library whose local Ollama guide sets LLM_ENDPOINT to http://localhost:11434 is How to run Cognee with a self-hosted model on a cloud GPU. The tunnel is How to use SSH port forwarding on a cloud GPU. If the process runs out of memory: How to fix CUDA out of memory on a cloud GPU. If the process raises no kernel image on an RTX 5090: How to fix CUDA no kernel image on an RTX 5090.
The LICENSE file begins with “Apache License Version 2.0, January 2004”, and the GitHub license field on 2026-11-14 was Apache-2.0.
The commands below are copied from the docs pages and from commit f1791daa86d469249c9b002f62644d58a1eb96a0, except the download lines marked as added. They were not run on a CloudGPU instance for this page. The Python quickstart constructs Memory() with no config. This page does not use that constructor. The docs also name other providers. This page does not copy those sections.
What the docs print about memory
The Ollama LLM page, the vLLM page, the Ollama embedder page, the Qdrant page, and the Python quickstart print no GPU GB figure. The Qwen/Qwen2.5-32B-Instruct README fetched on 2026-11-14 does not print a GPU GB number. It points at a benchmark page. This page does not copy a number from that other page. This page does not mark a catalog row as enough.
GET /v1/public/compute-capabilities does not list GPUs. It returns feature flags. The memory column is vram_gb from GET /v1/public/gpu-catalog (generated_at 2026-11-14T22:14:00.888Z). The catalog response also includes an availability field. This page does not copy it. Every catalog row below has min_gpu_count 1. Which listing you can start is on Deploy.
The catalog template list had no Mem0 template. It did have Ollama templates (jupyterlab-ollama, ollama-qwen3, ollama). Those templates are a different install. This page does not treat them as Mem0.
| Catalog name | vram_gb |
|---|---|
| RTX 2080 | 8 |
| RTX 3080 | 10 |
| RTX 2080 Ti | 11 |
| RTX 3080 Ti | 12 |
| V100 16G | 16 |
| A30 | 24 |
| RTX 3090 | 24 |
| RTX 4090 | 24 |
| RTX 4090D | 24 |
| RTX 4080 SUPER 32G | 32 |
| RTX 5090 | 32 |
| RTX 5090D | 32 |
| V100 32G | 32 |
| A100 40G | 40 |
| A800 40G | 40 |
| A40 | 48 |
| RTX 4090 48G | 48 |
| RTX 4090D 48G | 48 |
| RTX A6000 | 48 |
| Ascend 910B | 64 |
| NVIDIA RTX PRO 5000 72G | 72 |
| RTX PRO 5000 72G | 72 |
| A100 80G | 80 |
| A800 80G | 80 |
| H800 | 80 |
| RTX 6000D | 83 |
| H20 96G | 96 |
| RTX PRO 6000 96G | 96 |
| RTX PRO 6000 Max-Q | 96 |
| H20-3e 141G | 141 |
Install
The Python quickstart, read 2026-11-14, says Python 3.10 or higher. The install line, copied:
pip install mem0ai
The README on commit f1791daa86d469249c9b002f62644d58a1eb96a0 (committed 2026-11-06T16:53:06Z) also prints pip install mem0ai and npm install mem0ai. pyproject.toml on that commit says version = "2.2.1", license = "Apache-2.0", and requires-python = ">=3.10,<4.0". PyPI mem0ai info.version on 2026-11-14 was 2.2.1, requires_python >=3.10,<4.0, uploaded 2026-09-25T17:36:07.480270Z. The npm package mem0ai dist-tags.latest on 2026-11-14 was 3.3.1, license Apache-2.0, published 2026-09-25T17:44:47.902Z. The GitHub license field on 2026-11-14 was Apache-2.0. pushed_at was 2026-11-06T16:53:07Z. This page did not install the package.
The TypeScript examples on the Ollama pages import Memory from mem0ai/oss. This page did not run those examples.
Point the LLM at Ollama
The Ollama LLM page builds Memory.from_config with only an llm key, provider ollama. Its published Python snippet also assigns OPENAI_API_KEY and comments that the assignment is for the embedder. That assignment is the default embedder path. This page does not copy it. On commit f1791daa86d469249c9b002f62644d58a1eb96a0, EmbedderConfig.provider defaults to openai, and OpenAIEmbedding.__init__ reads OPENAI_API_KEY for that client. An llm-only from_config keeps that embedder. The block below keeps the page’s llm keys and adds the local embedder and the on-disk Qdrant path before from_config. No single docs page prints this dict. This page did not run it.
from mem0 import Memory
config = {
"llm": {
"provider": "ollama",
"config": {
"model": "mixtral:8x7b",
"temperature": 0.1,
"max_tokens": 2000,
}
},
"embedder": {
"provider": "ollama",
"config": {
"model": "nomic-embed-text",
"embedding_dims": 768,
}
},
"vector_store": {
"provider": "qdrant",
"config": {
"path": "/tmp/qdrant",
"embedding_model_dims": 768,
}
}
}
m = Memory.from_config(config)
The same page’s TypeScript example sets a server URL. Copied:
import { Memory } from 'mem0ai/oss';
const config = {
llm: {
provider: 'ollama',
config: {
model: 'llama3.1:8b', // or any other Ollama model
url: 'http://localhost:11434', // Ollama server URL
temperature: 0.1,
},
},
};
const memory = new Memory(config);
mixtral:8x7b is not llama3.1:8b. The Python example does not set ollama_base_url. On commit f1791daa86d469249c9b002f62644d58a1eb96a0, OllamaConfig sets ollama_base_url: Optional[str] = None, and OllamaLLM passes that value to Client(host=...). If model is empty, that file sets self.config.model = "llama3.1:70b". The docs example sets mixtral:8x7b, so that fallback is not the example. The same file raises ImportError with the text pip install ollama when the ollama library is missing. That line is from the source file. The Ollama LLM page does not print it. This page did not install that library and did not run Memory.from_config.
The page’s add call, copied:
messages = [
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
{"role": "user", "content": "I'm not a big fan of thriller movies but I love sci-fi movies."},
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
]
m.add(messages, user_id="alice", metadata={"category": "movies"})
How to run Ollama on a cloud GPU is the Ollama install. That server stays on the rented GPU. The Ollama LLM page does not print an SSH command.
Point the LLM at vLLM
The vLLM page prints pip install vllm. Its prerequisites section then prints two vllm serve lines. The first line names a repository whose owner this page does not copy. The second line, copied:
vllm serve Qwen/Qwen2.5-32B-Instruct --port 8000
The usage config sets llm.provider to vllm. The published snippet also assigns OPENAI_API_KEY and comments that it is used for the embedding model. That assignment is the default embedder path. This page does not copy it. The same llm-only dict leaves EmbedderConfig.provider at its default. The block below keeps the page’s llm keys and uses the same embedder and vector-store keys as the Ollama block. No single docs page prints this dict. This page did not run it.
config = {
"llm": {
"provider": "vllm",
"config": {
"model": "Qwen/Qwen2.5-32B-Instruct",
"vllm_base_url": "http://localhost:8000/v1",
"temperature": 0.1,
"max_tokens": 2000,
}
},
"embedder": {
"provider": "ollama",
"config": {
"model": "nomic-embed-text",
"embedding_dims": 768,
}
},
"vector_store": {
"provider": "qdrant",
"config": {
"path": "/tmp/qdrant",
"embedding_model_dims": 768,
}
}
}
m = Memory.from_config(config)
The page’s parameter table says vllm_base_url defaults to http://localhost:8000/v1 and can be set with VLLM_BASE_URL, and api_key defaults to vllm-api-key and can be set with VLLM_API_KEY. On the same commit, VllmConfig uses os.getenv("VLLM_BASE_URL") or http://localhost:8000/v1 when vllm_base_url is unset, and VllmLLM sets the model to Qwen/Qwen2.5-32B-Instruct when model is empty. The class constructs OpenAI(api_key=..., base_url=self.config.vllm_base_url). That OpenAI name is the client class in the file. This page did not run it.
The TypeScript example on that page sets baseURL to http://localhost:8000/v1 and apiKey to process.env.VLLM_API_KEY || "vllm-api-key". It imports Memory from mem0ai/oss. This page did not run it.
On 2026-11-14, GET https://huggingface.co/api/models/Qwen/Qwen2.5-32B-Instruct reported gated false, cardData.license apache-2.0, pipeline_tag text-generation, lastModified 2024-09-25T12:33:09.000Z, and sha 5ede1c97bbab6ce5cda5812749b4c0bdf79b18dd. The card README does not print a GPU GB number. It points at a benchmark page. This page does not treat 32B in that id as vram_gb.
The Mem0 files this page read do not print hf download. How to download a Hugging Face model prints pip install -U "huggingface_hub" and hf download. The block below is added on this page. This page did not download the repository.
# Added on this page. The vLLM page passes this id to vllm serve.
pip install -U "huggingface_hub"
hf download Qwen/Qwen2.5-32B-Instruct
How to serve an OpenAI-compatible API with vLLM on a cloud GPU is the general server install. The vLLM page’s own install line is pip install vllm. Those two install lines are not the same. This page did not install vLLM.
Ollama embedder and the local Qdrant path
The Ollama embedder page is the documented local embedding path. Its published Python snippet sets model to mxbai-embed-large and does not set embedding_dims. It also assigns OPENAI_API_KEY for the LLM. This page does not copy that assignment, and it does not pass that snippet to from_config on its own. The Python parameter table says model defaults to nomic-embed-text and embedding_dims defaults to 512. The TypeScript table says embeddingDims defaults to 768 for nomic-embed-text:latest. On the same commit, OllamaEmbedding.embed returns the vector Ollama sends and does not resize it. Qdrant.create_col uses embedding_model_dims as the collection size.
The assembled blocks above set model to nomic-embed-text, which is the Python table’s default, not the usage example’s mxbai-embed-large. They set embedding_dims and embedding_model_dims to 768. That 768 is the TypeScript table’s number. It is also the Dimension column for nomic-ai/nomic-embed-text-v1.5 in that model’s card table, fetched 2026-11-14 (gated false, cardData.license apache-2.0). The Python table’s 512 is not that number. The Qdrant table’s default embedding_model_dims is 1536, which is the quickstart’s figure for the default embedder. The quickstart also names on-disk Qdrant at /tmp/qdrant and SQLite history at ~/.mem0/history.db. VectorStoreConfig on that commit fills path with /tmp/qdrant when path is omitted, and MemoryConfig.history_db_path defaults to ~/.mem0/history.db. CloudGPU does not provide the vector store or the embedding model. Both stay on the machine you rent. This page did not call embed.
The quickstart’s search call is on Memory(), not on Memory.from_config. This page calls the same method on the m built above. The call, copied:
results = m.search("What do you know about me?", filters={"user_id": "alex"})
print(results)
The Ollama page’s add uses user_id="alice". The search call uses filters={"user_id": "alex"}. Those arguments are not the same. This page did not run m.search.
For a server you start on the instance, the SSH tunnel is How to use SSH port forwarding on a cloud GPU. The Mem0 pages do not print an SSH command. The TypeScript Ollama URL is http://localhost:11434. The vLLM page’s vllm_base_url is http://localhost:8000/v1. Those ports are not the same.
When it fails
CUDA out of memory. The Mem0 pages print no GPU GB figure. The Qwen/Qwen2.5-32B-Instruct card README does not print a GPU GB number. The vLLM page’s troubleshooting section says to try a smaller model or reduce max_model_len, and it prints vllm serve Qwen/Qwen2.5-32B-Instruct --max-model-len 4096. If the process raises CUDA out of memory, use how to fix CUDA out of memory on a cloud GPU. This page does not pick a smaller model id for you.
“CUDA error: no kernel image is available for execution on the device” on an RTX 5090. The README and pyproject.toml do not name compute capability 12.0. The RTX 5090 guide says that card is compute capability 12.0 (sm_120) and that PyTorch 2.7 and later, on a build for CUDA 12.8 or newer, is the line that announced support. This page did not install a torch wheel and did not re-test this library on an RTX 5090. Catalog RTX 5090 and RTX 5090D are 32. That is the catalog number only.
The vLLM server does not answer. The vLLM page’s troubleshooting section prints curl http://localhost:8000/health, and it says a 404 can come from a base URL that is missing /v1. The documented value is http://localhost:8000/v1. This page did not run that curl.
What to copy off, then destroy
print(results) is the quickstart’s search output. The quickstart also names /tmp/qdrant and ~/.mem0/history.db as the default local files for Memory() with no config. Copy the printed output and those paths before you destroy the instance. A Memory.from_config run that sets host and port is a different store than the /tmp/qdrant path. Save your work before you destroy a cloud GPU is the checklist. The terms say data on local instance storage is permanently deleted when the instance is destroyed.
The pricing page FAQ states the billing rule in these words:
Per-minute options have a 1-minute minimum; unused prepaid minutes are refunded when you destroy the instance. Some configurations use whole-hour billing with a 1-hour minimum; unused time within a charged hour is not refunded on voluntary stop. The billing period, minimum charge and initial prepayment are shown before confirmation. No subscription.
Prices are not copied here.
Frequently asked questions
What memory figure do the Mem0 docs print?
The Ollama LLM page, the vLLM page, the Ollama embedder page, the Qdrant page, and the Python quickstart print no GPU GB figure. The Qwen/Qwen2.5-32B-Instruct README fetched on 2026-11-14 does not print a GPU GB number. It points at a benchmark page. This page does not copy a number from that other page. This page does not mark a catalog row as enough. Which listing you can start is on https://cloudgpu.app/deploy.
Which install line does the quickstart print?
The Python quickstart prints pip install mem0ai and says Python 3.10 or higher. pyproject.toml on commit f1791daa86d469249c9b002f62644d58a1eb96a0 says version 2.2.1, license Apache-2.0, and requires-python 3.10 or newer and below 4.0. PyPI info.version on 2026-11-14 was 2.2.1, requires_python that same bound, uploaded 2026-09-25T17:36:07.480270Z. npm mem0ai dist-tags.latest was 3.3.1, license Apache-2.0, published 2026-09-25T17:44:47.902Z. This page did not install the package.
How does Memory.from_config point at a server on the GPU?
The Ollama LLM page sets llm.provider to ollama and model to mixtral:8x7b. That Python block does not set a URL. The TypeScript block on the same page sets url to http://localhost:11434 and model to llama3.1:8b. The vLLM page prints vllm serve Qwen/Qwen2.5-32B-Instruct --port 8000 and sets vllm_base_url to http://localhost:8000/v1. Those URLs are not the same. An llm-only from_config keeps EmbedderConfig.provider at its default, openai, and OpenAIEmbedding reads OPENAI_API_KEY. The blocks on this page add embedder.provider ollama, model nomic-embed-text, embedding_dims 768, and a Qdrant vector_store at /tmp/qdrant with embedding_model_dims 768 before from_config. The Python embedder table prints 512. The TypeScript table and the nomic-ai/nomic-embed-text-v1.5 card table print 768. This page uses 768. It does not use the no-config Memory() constructor, and it does not copy the hosted-provider pages.
What license does the file print?
The LICENSE file begins with Apache License Version 2.0, January 2004. The GitHub license field on 2026-11-14 was Apache-2.0. pyproject.toml on that commit says license Apache-2.0. npm mem0ai 3.3.1 lists license Apache-2.0.
Sources (read 2026-11-14)
- Mem0 Ollama LLM page, read 2026-11-14: https://docs.mem0.ai/components/llms/models/ollama . Python
Memory.from_configwithllm.providerollamaandmodelmixtral:8x7b. TypeScripturlhttp://localhost:11434andmodelllama3.1:8b.m.add(..., user_id="alice"). TheOPENAI_API_KEYassignment in the published snippet is not copied - Mem0 vLLM page, read 2026-11-14: https://docs.mem0.ai/components/llms/models/vllm .
pip install vllm. The second serve line isvllm serve Qwen/Qwen2.5-32B-Instruct --port 8000.vllm_base_urlhttp://localhost:8000/v1. Table defaultsvllm-api-keyandVLLM_BASE_URL. Troubleshooting curlhttp://localhost:8000/healthandvllm serve Qwen/Qwen2.5-32B-Instruct --max-model-len 4096. The first serve line’s repository id is not copied. The benefits section is not copied - Mem0 Ollama embedder page, read 2026-11-14: https://docs.mem0.ai/components/embedders/models/ollama . Usage example
modelmxbai-embed-large. Table defaultsnomic-embed-text,embedding_dims512,ollama_base_urlNone. TypeScriptnomic-embed-text:latest,urlhttp://localhost:11434,embeddingDims768. The assembledfrom_configdicts on this page usenomic-embed-textand 768, plus Qdrantpath/tmp/qdrantandembedding_model_dims768. They were not run - Mem0 Python quickstart, read 2026-11-14: https://docs.mem0.ai/open-source/python-quickstart .
pip install mem0ai. Python 3.10 or higher.m.search(..., filters={"user_id": "alex"}). DefaultMemory()note: Qdrant at/tmp/qdrant, SQLite at~/.mem0/history.db, 1536-dimension embeddings. This page does not use that constructor - Mem0 Qdrant page, read 2026-11-14: https://docs.mem0.ai/components/vectordbs/dbs/qdrant . Server example
hostlocalhost,port6333. Python tablepath/tmp/qdrant,embedding_model_dims1536 - mem0ai/mem0 commit
f1791daa86d469249c9b002f62644d58a1eb96a0, committed 2026-11-06T16:53:06Z. READMEpip install mem0aiandnpm install mem0ai.pyproject.tomlversion2.2.1, license Apache-2.0,requires-python>=3.10,<4.0.OllamaConfig.ollama_base_urldefault None.OllamaLLMfallback modelllama3.1:70bandpip install ollamain the import error.OllamaEmbeddingdefaultsnomic-embed-textandembedding_dims512, andembedreturns the vector unchanged.EmbedderConfig.providerdefaultopenai.OpenAIEmbedding.__init__readsOPENAI_API_KEY.Qdrant.create_colusesembedding_model_dimsas the collection size.VectorStoreConfigfillspathwith/tmp/{provider}whenpathis omitted.MemoryConfig.history_db_pathdefaults to~/.mem0/history.db.VllmConfigdefault URLhttp://localhost:8000/v1.VllmLLMdefault modelQwen/Qwen2.5-32B-Instruct. GitHub license field Apache-2.0.pushed_at2026-11-06T16:53:07Z. PyPImem0ai2.2.1, uploaded 2026-09-25T17:36:07.480270Z. npmmem0ai3.3.1, published 2026-09-25T17:44:47.902Z, license Apache-2.0 - Hugging Face model card
nomic-ai/nomic-embed-text-v1.5, read 2026-11-14: the model table lists Dimension 768.gatedfalse,cardData.licenseapache-2.0. The Ollama tagnomic-embed-textis not that repository id - Hugging Face model API
Qwen/Qwen2.5-32B-Instruct:gatedfalse,cardData.licenseapache-2.0,pipeline_tagtext-generation,lastModified2024-09-25T12:33:09.000Z,sha5ede1c97bbab6ce5cda5812749b4c0bdf79b18dd. The card README does not print a GPU GB number.hf downloadis added on this page and was not run - Public GPU memory: https://cloudgpu.app/v1/public/gpu-catalog (
generated_at2026-11-14T22:14:00.888Z).GET /v1/public/compute-capabilitiesreturned feature flags and no GPU list. The catalog had no Mem0 template
Cards you can start are on the Deploy page. Prices are on https://cloudgpu.app/pricing and are not repeated here.
Last updated: 2026-11-14.