> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lancedb.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Jina

## Text Embedding Models

Jina embeddings are used to generate embeddings for text and image data.
You also need to set the `JINA_API_KEY` environment variable to use the Jina API.

You can find a list of supported models under [https://jina.ai/embeddings/](https://jina.ai/embeddings/)

Supported parameters (to be passed in `create` method) are:

| Parameter | Type | Default Value | Description |
| - | - | - | - |
| `name` | `str` | `"jina-clip-v1"` | The model ID of the jina model to use |

Usage Example:

import os
import tempfile
from pathlib import Path

import lancedb
from lancedb.embeddings import EmbeddingFunctionRegistry
from lancedb.pydantic import LanceModel, Vector

os.environ\["JINA\_API\_KEY"] = os.environ\["JINA\_API\_KEY"]

jina\_embed = (
&#x20;   EmbeddingFunctionRegistry.get\_instance()
&#x20;   .get("jina")
&#x20;   .create(name="jina-embeddings-v2-base-en")
)

class TextModel(LanceModel):
&#x20;   text: str = jina\_embed.SourceField()
&#x20;   vector: Vector(jina\_embed.ndims()) = jina\_embed.VectorField()

data = \[\{"text": "hello world"}, \{"text": "goodbye world"}]

db = lancedb.connect(str(Path(tempfile.mkdtemp()) / "jina-text"))
tbl = db.create\_table("test", schema=TextModel, mode="overwrite")

tbl.add(data)


## Multimodal Embedding Models

Jina embeddings can also be used to embed both text and image data, only some of the models support image data and you can check the list
under [https://jina.ai/embeddings/](https://jina.ai/embeddings/)

Supported parameters (to be passed in `create` method) are:

| Parameter | Type | Default Value | Description |
| - | - | - | - |
| `name` | `str` | `"jina-clip-v1"` | The model ID of the jina model to use |

Usage Example:

import os
import tempfile
from pathlib import Path

import lancedb
import pandas as pd
import requests
from lancedb.embeddings import get\_registry
from lancedb.pydantic import LanceModel, Vector

os.environ\["JINA\_API\_KEY"] = os.environ.get("JINA\_API\_KEY", "jina\_\*")

db = lancedb.connect(str(Path(tempfile.mkdtemp()) / "jina-images"))
func = get\_registry().get("jina").create()

class Images(LanceModel):
&#x20;   label: str
&#x20;   image\_uri: str = func.SourceField()
&#x20;   image\_bytes: bytes = func.SourceField()
&#x20;   vector: Vector(func.ndims()) = func.VectorField()
&#x20;   vec\_from\_bytes: Vector(func.ndims()) = func.VectorField()

table = db.create\_table("images", schema=Images)
labels = \["cat", "cat", "dog", "dog", "horse", "horse"]
uris = \[
&#x20;   "http\://farm1.staticflickr.com/53/167798175\_7c7845bbbd\_z.jpg",
&#x20;   "http\://farm1.staticflickr.com/134/332220238\_da527d8140\_z.jpg",
&#x20;   "http\://farm9.staticflickr.com/8387/8602747737\_2e5c2a45d4\_z.jpg",
&#x20;   "http\://farm5.staticflickr.com/4092/5017326486\_1f46057f5f\_z.jpg",
&#x20;   "http\://farm9.staticflickr.com/8216/8434969557\_d37882c42d\_z.jpg",
&#x20;   "http\://farm6.staticflickr.com/5142/5835678453\_4f3a4edb45\_z.jpg",
]
image\_bytes = \[requests.get(uri).content for uri in uris]
table.add(
&#x20;   pd.DataFrame(\{"label": labels, "image\_uri": uris, "image\_bytes": image\_bytes})
)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.