Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FynnCloud-Embeddings

OpenAI-compatible multimodal embedding service for FynnCloud. Runs jina-clip-v2 behind a FastAPI server to generate 1024-dimensional vectors from text and images.

Used by the backend for semantic file search (pgvector cosine similarity).

Running locally

python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reload

The model weights get downloaded on first launch (~2 GB).

Docker

docker build -t fynncloud-embeddings .
docker run -p 8000:8000 fynncloud-embeddings

The Dockerfile bakes the model weights into the image so there's no download at runtime.

API

POST /v1/embeddings

Standard OpenAI embedding format. Supports text strings, arrays of text strings, and multimodal content parts.

Text request

{
  "input": "hello world",
  "model": "jinaai/jina-clip-v2"
}

Multimodal request (Text + Image)

{
  "input": [
    {
      "type": "text",
      "text": "photo of a mountain"
    },
    {
      "type": "image_url",
      "image_url": {
        "url": "data:image/jpeg;base64,iVBORw0KGgo..."
      }
    }
  ],
  "model": "jinaai/jina-clip-v2"
}

Response

{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "embedding": [0.012, -0.034, ...],
      "index": 0
    },
    {
      "object": "embedding",
      "embedding": [0.056, 0.078, ...],
      "index": 1
    }
  ],
  "model": "jinaai/jina-clip-v2",
  "usage": {
    "prompt_tokens": 8,
    "total_tokens": 8
  }
}

GET /v1/models

Lists available models (OpenAI format).

GET /health

Returns server status.

Config

Environment variables:

Variable Default Description
MODEL_NAME jinaai/jina-clip-v2 HuggingFace model ID
PORT 8000 Server port
WORKERS 1 Uvicorn worker count (each loads a full model copy)
LOG_LEVEL info Logging level

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages