{"id":30892300,"url":"https://github.com/evilfreelancer/docker-clip-api","last_synced_at":"2026-02-14T11:03:17.181Z","repository":{"id":297976925,"uuid":"998463341","full_name":"EvilFreelancer/docker-clip-api","owner":"EvilFreelancer","description":"Dockerized CLIP API service","archived":false,"fork":false,"pushed_at":"2025-06-08T17:14:10.000Z","size":110,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-08T19:43:41.216Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","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/EvilFreelancer.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,"zenodo":null}},"created_at":"2025-06-08T16:59:03.000Z","updated_at":"2025-06-11T11:04:07.000Z","dependencies_parsed_at":"2025-06-08T18:35:04.947Z","dependency_job_id":null,"html_url":"https://github.com/EvilFreelancer/docker-clip-api","commit_stats":null,"previous_names":["evilfreelancer/docker-clip-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/EvilFreelancer/docker-clip-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvilFreelancer%2Fdocker-clip-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvilFreelancer%2Fdocker-clip-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvilFreelancer%2Fdocker-clip-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvilFreelancer%2Fdocker-clip-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EvilFreelancer","download_url":"https://codeload.github.com/EvilFreelancer/docker-clip-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvilFreelancer%2Fdocker-clip-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29443447,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T10:51:12.367Z","status":"ssl_error","status_checked_at":"2026-02-14T10:50:52.088Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-09-08T19:43:35.210Z","updated_at":"2026-02-14T11:03:17.159Z","avatar_url":"https://github.com/EvilFreelancer.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dockerized CLIP API service\n\nThis project provides a simple image classification API built using the CLIP family of models. It wraps the\nfunctionality into a Dockerized API service based\non [bentoml/CLIP-API-service](https://github.com/bentoml/CLIP-API-service).\n\n## Features\n\n* Use any Hugging Face-compatible CLIP model\n* Accepts images via URL or base64 string\n* Ranks a list of textual candidates against a given image\n* Dockerized for easy deployment\n\n## Getting Started\n\n### 1. Clone the Repository\n\n```shell\ngit clone https://github.com/EvilFreelancer/docker-clip-api.git\ncd docker-clip-api\ncp docker-compose.dist.yml docker-compose.yml\n```\n\n### 2. Configure the Model\n\nOpen `docker-compose.yml` and set the `CLIP_MODEL` environment variable. For example:\n\n```yaml\nCLIP_MODEL: openai/clip-vit-base-patch16\n```\n\nYou can choose any model from the [CLIP-compatible models](https://huggingface.co/models?search=clip) on Hugging Face.\n\n### 3. Build and Run the Service\n\n```shell\ndocker compose up -d --build\n```\n\nThe service will be available at http://localhost:3000.\n\n## API Reference\n\n### /rank\n\nRanks text candidates against one or more image queries using cosine similarity and probability scores.\n\nRequest Format\n\n* **queries**: A list of image inputs, either as img_uri or img_blob.\n* **candidates**: A list of text descriptions.\n\nSupported Image Formats\n\n* **img_uri**: A direct image URL\n* **img_blob**: A base64-encoded image string\n\n```shell\ncurl -X 'POST' \\\n  'http://localhost:3000/rank' \\\n  -H 'accept: application/json' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n  \"queries\": [\n    {\n      \"img_uri\": \"https://raw.githubusercontent.com/EvilFreelancer/docker-clip-api/refs/heads/main/assets/test_tshirt.jpg\"\n    }\n  ],\n  \"candidates\": [\n    {\"text\": \"t-shirt\"},\n    {\"text\": \"jeans\"},\n    {\"text\": \"jacket\"},\n    {\"text\": \"dress\"},\n    {\"text\": \"skirt\"},\n    {\"text\": \"shorts\"},\n    {\"text\": \"coat\"},\n    {\"text\": \"shoes\"},\n    {\"text\": \"hat\"},\n    {\"text\": \"sweater\"}\n  ]\n}'\n```\n\nSample Response\n\n```shell\n{\n  \"probabilities\": [\n    [\n      0.9982102324463897,\n      0.00001807320921286219,\n      ...\n      0.000036178202084800335\n    ]\n  ],\n  \"cosine_similarities\": [\n    [\n      0.29196685552597046,\n      0.18277397751808167,\n      ...\n      0.1897142380475998\n    ]\n  ]\n}\n```\n\n## License\n\nMIT License. See [LICENSE](./LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevilfreelancer%2Fdocker-clip-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevilfreelancer%2Fdocker-clip-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevilfreelancer%2Fdocker-clip-api/lists"}