Skip to main content

fastembed-cloud

Cloud text embeddings via AINative API. Drop-in replacement for fastembed — same interface, no model downloads, no ONNX runtime.

Why?

fastembed is great, but requires downloading 100MB+ ONNX models locally. fastembed-cloud gives you the same API backed by a free cloud service — zero setup, zero downloads.

fastembed fastembed-cloud
First-run latency 30-120s (model download) 0s
Disk usage 100MB-1GB per model 0
ONNX runtime Required Not needed
Offline support Yes No (cloud API)
Cost Free (local compute) Free (AINative API)

Install

pip install fastembed-cloud

Quick Start

from fastembed_cloud import CloudTextEmbedding

# Auto-provisions a free API key on first run
model = CloudTextEmbedding()

# Single query
embedding = model.query_embed("What is semantic search?")
print(f"Dimensions: {len(embedding)}")  # 384

# Batch embedding
docs = ["First document", "Second document", "Third document"]
embeddings = model.embed(docs)
print(f"Embedded {len(embeddings)} documents")

Models

Model Dimensions ID
BGE-small-en-v1.5 384 BAAI/bge-small-en-v1.5 (default)
BGE-base-en-v1.5 768 BAAI/bge-base-en-v1.5
BGE-large-en-v1.5 1024 BAAI/bge-large-en-v1.5
BGE-M3 (multilingual) 1024 bge-m3
model = CloudTextEmbedding(model_name="bge-m3")
embedding = model.query_embed("Multilingual embedding")
print(len(embedding))  # 1024

Smart Hybrid: Local + Cloud

TextEmbedding automatically uses local fastembed if installed, cloud otherwise:

from fastembed_cloud import TextEmbedding

model = TextEmbedding()
print(model.is_cloud)  # True if fastembed not installed

embeddings = model.embed(["works either way"])

Install fastembed alongside for local-first with cloud fallback:

pip install fastembed-cloud[local]

Authentication

Credentials are resolved in this order:

  1. api_key parameter: CloudTextEmbedding(api_key="your-key")
  2. AINATIVE_API_KEY environment variable
  3. ZERODB_API_KEY environment variable (shared with ZeroDB ecosystem)
  4. ~/.zerodb/credentials.json (auto-saved from any ZeroDB tool)
  5. Auto-provisioning (free 72-hour account, claim to keep permanently)

Auto-Provisioning

On first use with no credentials, fastembed-cloud automatically provisions a free account:

$ python -c "from fastembed_cloud import CloudTextEmbedding; CloudTextEmbedding().query_embed('test')"

  No API key found — provisioning a free AINative account for embeddings...

  Auto-provisioned! Free embeddings API ready.

  API Key:   zdb_abc12345...
  Expires:   72 hours
  Saved to:  ~/.zerodb/credentials.json

  To keep access permanently, claim your account:
  https://ainative.studio/signup

Batch Embedding

Handles large datasets efficiently with automatic batching:

model = CloudTextEmbedding(batch_size=100)

# Automatically batches into chunks of 100
large_dataset = ["document " + str(i) for i in range(10000)]
embeddings = model.embed(large_dataset)

Use with Vector Databases

Qdrant

from qdrant_client import QdrantClient
from fastembed_cloud import CloudTextEmbedding

client = QdrantClient(":memory:")
model = CloudTextEmbedding()

docs = ["AI is transforming healthcare", "Machine learning for finance"]
embeddings = model.embed(docs)

client.add(
    collection_name="my_docs",
    documents=docs,
    embeddings=embeddings,
)

ChromaDB

import chromadb
from fastembed_cloud import CloudTextEmbedding

client = chromadb.Client()
collection = client.create_collection("my_docs")
model = CloudTextEmbedding()

docs = ["First doc", "Second doc"]
embeddings = model.embed(docs)

collection.add(
    documents=docs,
    embeddings=embeddings,
    ids=["id1", "id2"],
)

API Reference

CloudTextEmbedding

Always uses the cloud API.

CloudTextEmbedding(
    model_name="BAAI/bge-small-en-v1.5",  # Model to use
    api_key=None,                           # API key (auto-resolved)
    base_url=None,                          # API URL (default: api.ainative.studio)
    batch_size=64,                          # Max texts per API call
    normalize=True,                         # Normalize to unit vectors
)

Methods:

  • embed(documents, batch_size=None) — Embed a list of texts. Returns list[list[float]].
  • query_embed(query) — Embed a single query. Returns list[float].
  • passage_embed(texts) — Alias for embed() (fastembed compatibility).

Properties:

  • dim — Embedding dimensions (e.g., 384 for bge-small).
  • model_name — Resolved model name.

TextEmbedding

Smart hybrid: local fastembed if available, cloud otherwise.

TextEmbedding(
    model_name="BAAI/bge-small-en-v1.5",
    api_key=None,
    **kwargs,
)

Properties:

  • is_cloud — True if using cloud API, False if using local fastembed.

License

MIT

Metadata

Release files for fastembed-cloud 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fastembed-cloud 0.1.0
File Size Uploaded Provenance
fastembed_cloud-0.1.0.tar.gz 12.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for fastembed-cloud 0.1.0
File Interpreter ABI Platform
fastembed_cloud-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.6 kB

Release files / fastembed_cloud-0.1.0.tar.gz

Download URL fastembed_cloud-0.1.0.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
70266a7eb609869ad975d690867a9ac6f9a6712d937a63002388f5c44143c56a
BLAKE2b-256 checksum
How to use checksums
1a98c15b1766c1db7c9de49fd4f0b22982eda1227b95407adba7b5e13860530e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / fastembed_cloud-0.1.0-py3-none-any.whl

Download URL fastembed_cloud-0.1.0-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2f3e8e7d000fc3ce06fbb5ce6f9f17d3f837756e3dd739a0a95b3ca64313d5d7
BLAKE2b-256 checksum
How to use checksums
f5bf0dc05ed039cd107387855044df449e466057f2cfce4cb007cbe2ace655ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Security for fastembed-cloud 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page