--- title: AssetFeed sidebarTitle: AssetFeed description: Text embeddings with assetfeed-embed-v1 in the LanceDB Python SDK. --- The Python SDK registers `assetfeed` for client-side text embedding with the [AssetFeed embeddings API](https://assetfeed.com/models/embeddings). Documents are sent with `input_type="document"` and searches with `input_type="query"`. Null and empty text values get a null vector without a request. Create an API key at [assetfeed.com/api-keys](https://assetfeed.com/api-keys), then install the optional client and set the key: ```bash Bash icon="terminal" pip install openai export ASSETFEED_API_KEY="your-api-key" ``` ```python Python icon="python" import lancedb from lancedb.embeddings import get_registry from lancedb.pydantic import LanceModel, Vector func = get_registry().get("assetfeed").create(dim=512) class Document(LanceModel): text: str = func.SourceField() vector: Vector(func.ndims()) = func.VectorField() db = lancedb.connect("./assetfeed-db") table = db.create_table("documents", schema=Document) table.add([{"text": "Bitcoin ETF inflows rose for a fifth week."}]) results = table.search("ETF flows").limit(3).to_list() ``` ## Null and empty text Null and empty text values get a null vector, and `table.add()` rejects a batch with a null vector under its default write policy. To keep those rows, make the text and vector columns nullable and pass `on_bad_vectors="null"`: ```python Python icon="python" from typing import Optional class NullableDocument(LanceModel): text: Optional[str] = func.SourceField() vector: Optional[Vector(func.ndims())] = func.VectorField() table = db.create_table("documents_nullable", schema=NullableDocument) table.add( [{"text": "Bitcoin ETF inflows rose for a fifth week."}, {"text": None}, {"text": ""}], on_bad_vectors="null", ) ``` Pass `on_bad_vectors="drop"` instead to skip those rows. ## Model and configuration | Model ID | Dimensions | Inputs per request | Truncation | |---|---|---|---| | `assetfeed/assetfeed-embed-v1` | 1024, 512 or 256 | up to 64 | queries at 512 tokens, documents at 1024 tokens | | Parameter | Default | Description | |---|---|---| | `name` | `assetfeed/assetfeed-embed-v1` | Model ID. | | `dim` | `1024` | Output dimensions: `1024`, `512` or `256`. | | `api_key` | `ASSETFEED_API_KEY` | Alternatively, a registry reference such as `$var:assetfeed-key`. | | `batch_size` | `64` | Maximum inputs per request, at most 64. | | `max_retries` | `7` | LanceDB's retry policy, applied to each request. | Requests go to `https://api.assetfeed.com/api/v1/models/embeddings` in the OpenAI embeddings format. See the [AssetFeed embeddings page](https://assetfeed.com/models/embeddings) for the model description and [pricing](https://assetfeed.com/pricing).