{"id":26367506,"url":"https://github.com/litongjava/py-jina-embeddings-server","last_synced_at":"2025-08-30T22:19:18.150Z","repository":{"id":277625982,"uuid":"933023344","full_name":"litongjava/py-jina-embeddings-server","owner":"litongjava","description":"Jina Embeddings v3 API Service","archived":false,"fork":false,"pushed_at":"2025-02-28T08:13:50.000Z","size":24,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T21:17:25.090Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/litongjava.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-15T01:00:41.000Z","updated_at":"2025-02-28T08:13:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"2f0decad-19ad-4fa4-b0a2-f49abc7decf2","html_url":"https://github.com/litongjava/py-jina-embeddings-server","commit_stats":null,"previous_names":["litongjava/py-jina-embeddings-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/litongjava/py-jina-embeddings-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litongjava%2Fpy-jina-embeddings-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litongjava%2Fpy-jina-embeddings-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litongjava%2Fpy-jina-embeddings-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litongjava%2Fpy-jina-embeddings-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/litongjava","download_url":"https://codeload.github.com/litongjava/py-jina-embeddings-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litongjava%2Fpy-jina-embeddings-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272915518,"owners_count":25014622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-16T21:17:27.057Z","updated_at":"2025-08-30T22:19:18.114Z","avatar_url":"https://github.com/litongjava.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# py-jina-embeddings-server\n\nJina Embeddings v3 API Service\n\n## Overview\nThis project provides an HTTP API service for generating embeddings from text using the Jina-embeddings-v3 model with ONNX Runtime and the Robyn framework.\n\n## Requirements\n- **Python:** 3.8+\n- **Libraries:** numpy, onnxruntime, robyn, transformers\n\n## Installation\n\n1. Create a conda environment:\n   ```bash\n   conda create -n jina-embeddings python=3.9 -y\n   conda activate jina-embeddings\n   ```\n\n2. Install the required libraries using pip:\n   ```bash\n   pip install numpy onnxruntime robyn transformers\n   ```\n\n## Usage\n\n1. **Download the model:**\n   ```bash\n   mkdir ~/models/jina-embeddings-v3/onnx -p\n   cd ~/models/jina-embeddings-v3/onnx\n   wget https://huggingface.co/jinaai/jina-embeddings-v3/resolve/main/onnx/model.onnx\n   wget https://huggingface.co/jinaai/jina-embeddings-v3/resolve/main/onnx/model.onnx_data\n   ```\n\n2. **Run the server:**\n   Start the server by running the script:\n   ```bash\n   python server.py --model_path ~/models/jina-embeddings-v3/onnx/model.onnx\n   ```\n\n3. **Send a POST request to the `/v1/embeddings` endpoint:**\n   Example:\n   ```bash\n   curl -X POST http://localhost:10002/v1/embeddings \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\"input\": [\"Hello world\", \"你好，世界\"], \"task\": \"text-matching\"}'\n   ```\nresponse example\n```json\n{\n    \"object\": \"list\",\n    \"data\": [\n        {\n            \"object\": \"embedding\",\n            \"index\": 0,\n            \"embedding\": [\n            ]\n        }\n    ],\n    \"model\": \"text-embedding-3-large\",\n    \"usage\": {\n        \"prompt_tokens\": 5,\n        \"total_tokens\": 5\n    }\n}\n```\n## Dockerfile\n\nTo containerize the service, use the following `Dockerfile`:\n\n```Dockerfile\nFROM python:3.9-slim\n\n# Install wget (required to download the model)\nRUN apt-get update \u0026\u0026 apt-get install -y wget \u0026\u0026 rm -rf /var/lib/apt/lists/*\n\n# Download the model files into the specified directory\nRUN mkdir -p /models/jina-embeddings-v3/onnx \u0026\u0026 \\\n    cd /models/jina-embeddings-v3/onnx \u0026\u0026 \\\n    wget https://huggingface.co/jinaai/jina-embeddings-v3/resolve/main/onnx/model.onnx \u0026\u0026 \\\n    wget https://huggingface.co/jinaai/jina-embeddings-v3/resolve/main/onnx/model.onnx_data\n\nWORKDIR /app\n# Copy application code into the container\nCOPY . /app\n# Install required Python packages\nRUN pip install --no-cache-dir numpy onnxruntime robyn transformers\n\n# Set the default command with the model path specified\nCMD [\"python\", \"server.py\", \"--model_path\", \"/models/jina-embeddings-v3/onnx/model.onnx\"]\n```\n\n1. **Build the Docker image:**\n   ```bash\n   docker build -t litongjava/py-jina-embeddings-server:1.0.0 .\n   ```\n\n2. **Run the Docker container:**\n   ```bash\n   docker run -p 10002:10002 litongjava/py-jina-embeddings-server:1.0.0\n   ```\n\n## License\nThis project is licensed under the MIT License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitongjava%2Fpy-jina-embeddings-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flitongjava%2Fpy-jina-embeddings-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitongjava%2Fpy-jina-embeddings-server/lists"}