> For the complete documentation index, see [llms.txt](https://docs.unitlab.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.unitlab.ai/api-sdk-cli/pt/clis/cli-embedding-spaces.md).

# CLI: embedding spaces

CLI da Unitlab para embedding spaces: crie espaços de vetores, envie vetores de um arquivo JSONL e busque arquivos parecidos pelo terminal.

```bash
SPACE_ID=$(unitlab embeddings create clip-vit-b32 --dimensions 512 \
  --model-name openai/clip-vit-base-patch32 --json | jq -r .id)

unitlab embeddings upload "$SPACE_ID" vectors.jsonl
unitlab embeddings upsert "$SPACE_ID" "$ASSET_ID" --vector-file vector.json
unitlab embeddings search "$SPACE_ID" --vector-file query.json --limit 20 --level asset --json

unitlab embeddings list
unitlab embeddings detail "$SPACE_ID"
unitlab embeddings delete "$SPACE_ID" --yes
```

## Formatos de arquivo <a href="#file-formats" id="file-formats"></a>

| Arquivo             | Formato                                                                                                    |
| ------------------- | ---------------------------------------------------------------------------------------------------------- |
| `--vector-file`     | Um array JSON de números: `[0.12, -0.04, ...]`                                                             |
| JSONL para `upload` | Um objeto por linha: `{"asset_id": "...", "vector": [...], "frame_index": 120}`. `frame_index` é opcional. |

`upload` envia 1.000 linhas por requisição. `search` aceita `--project` para limitar os resultados a um projeto e `--level frame` para um resultado por frame de vídeo.

## Relacionado <a href="#related" id="related"></a>

[Embedding spaces](https://docs.unitlab.ai/api-sdk-cli/pt/sdks/embedding-spaces.md) · [Upsert e busca de vetores](https://docs.unitlab.ai/api-sdk-cli/pt/sdks/upsert-and-search-vectors.md)
