{"id":50348073,"url":"https://github.com/redredchen01/manga-tagger","last_synced_at":"2026-05-29T20:01:31.656Z","repository":{"id":353317930,"uuid":"1182918830","full_name":"redredchen01/manga-tagger","owner":"redredchen01","description":"A backend service for automatically tagging manga covers using Local VLM and RAG","archived":false,"fork":false,"pushed_at":"2026-04-23T10:32:22.000Z","size":987,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-23T12:23:00.196Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/redredchen01.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-16T04:53:25.000Z","updated_at":"2026-04-23T10:32:26.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/redredchen01/manga-tagger","commit_stats":null,"previous_names":["redredchen01/manga-tagger"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/redredchen01/manga-tagger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redredchen01%2Fmanga-tagger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redredchen01%2Fmanga-tagger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redredchen01%2Fmanga-tagger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redredchen01%2Fmanga-tagger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redredchen01","download_url":"https://codeload.github.com/redredchen01/manga-tagger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redredchen01%2Fmanga-tagger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33668186,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"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":"2026-05-29T20:01:30.791Z","updated_at":"2026-05-29T20:01:31.650Z","avatar_url":"https://github.com/redredchen01.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Manga Cover Auto-Tagger\n\nLocal manga cover tagging service built with FastAPI, LM Studio, and ChromaDB.\n\n## Features\n\n- Multi-stage pipeline: VLM analysis, RAG retrieval, and tag synthesis\n- Local-first deployment with LM Studio support\n- FastAPI API for tagging, health checks, tag listing, and RAG ingestion\n- Streamlit UI for manual testing and dataset management\n- Mock-service mode for fast development without loading heavy models\n\n## Project Layout\n\n- `app/`: API, config, models, and service layer\n- `scripts/`: maintenance and initialization scripts\n- `tests/`: active automated tests\n- `data/`: tag library, RAG dataset, and ChromaDB data\n- `streamlit_app.py`: local frontend for testing the API\n\n## Quick Start\n\n### 1. Create a virtual environment\n\n```bash\npython -m venv venv\nvenv\\Scripts\\activate\n```\n\n### 2. Install dependencies\n\n```bash\npip install -e .\n```\n\n### 3. Configure environment\n\n```bash\ncopy .env.example .env\n```\n\nDevelopment mode:\n\n```env\nUSE_MOCK_SERVICES=true\nUSE_LM_STUDIO=false\n```\n\nLM Studio mode:\n\n```env\nUSE_MOCK_SERVICES=false\nUSE_LM_STUDIO=true\nLM_STUDIO_BASE_URL=http://127.0.0.1:1234/v1\nLM_STUDIO_VISION_MODEL=qwen3.6-35b-a3b-uncensored-hauhaucs-aggressive\nLM_STUDIO_TEXT_MODEL=qwen3.6-35b-a3b-uncensored-hauhaucs-aggressive\nLM_STUDIO_EMBEDDING_MODEL=Qwen/Qwen3-Embedding-8B-GGUF\n```\n\n### 4. Start the API\n\n```bash\npython start_server.py\n```\n\nAlternative:\n\n```bash\nuvicorn app.main:app --host 0.0.0.0 --port 8000 --reload\n```\n\n### 5. Open the docs\n\n- Swagger UI: `http://localhost:8000/docs`\n- Health check: `http://localhost:8000/api/v1/health`\n\n## API Endpoints\n\n### Tag a manga cover\n\n```bash\ncurl -X POST \"http://localhost:8000/api/v1/tag-cover\" ^\n  -H \"accept: application/json\" ^\n  -H \"Content-Type: multipart/form-data\" ^\n  -F \"file=@cover.jpg\" ^\n  -F \"top_k=5\" ^\n  -F \"confidence_threshold=0.5\" ^\n  -F \"include_metadata=true\"\n```\n\nExample response:\n\n```json\n{\n  \"tags\": [\n    {\n      \"tag\": \"catgirl\",\n      \"confidence\": 0.92,\n      \"source\": \"vlm+rag\",\n      \"reason\": \"Matched by visual features and supporting RAG results\"\n    }\n  ],\n  \"metadata\": {\n    \"processing_time\": 2.34,\n    \"rag_matches_count\": 3,\n    \"api_version\": \"2.0.0\"\n  }\n}\n```\n\n### Health check\n\n```bash\ncurl \"http://localhost:8000/api/v1/health\"\n```\n\n### List tags\n\n```bash\ncurl \"http://localhost:8000/api/v1/tags\"\n```\n\n### Add a reference image to RAG\n\n```bash\ncurl -X POST \"http://localhost:8000/api/v1/rag/add\" ^\n  -H \"accept: application/json\" ^\n  -H \"Content-Type: multipart/form-data\" ^\n  -F \"file=@reference.jpg\" ^\n  -F \"tags=[\\\"catgirl\\\",\\\"school_uniform\\\"]\" ^\n  -F \"metadata={\\\"source\\\":\\\"manual\\\"}\"\n```\n\n## Streamlit UI\n\nRun the frontend locally:\n\n```bash\nstreamlit run streamlit_app.py\n```\n\nThe UI expects the FastAPI server to be available at `http://127.0.0.1:8000/api/v1` by default.\n\n## Configuration Notes\n\nImportant settings in `.env`:\n\n```env\nAPI_HOST=0.0.0.0\nAPI_PORT=8000\nDEBUG=false\n\nUSE_LM_STUDIO=true\nUSE_MOCK_SERVICES=false\n\nLM_STUDIO_BASE_URL=http://127.0.0.1:1234/v1\nLM_STUDIO_API_KEY=lm-studio\nLM_STUDIO_VISION_MODEL=qwen3.6-35b-a3b-uncensored-hauhaucs-aggressive\nLM_STUDIO_TEXT_MODEL=qwen3.6-35b-a3b-uncensored-hauhaucs-aggressive\nLM_STUDIO_EMBEDDING_MODEL=Qwen/Qwen3-Embedding-8B-GGUF\nLM_STUDIO_EMBEDDING_DIM=4096\n\nCHROMA_DB_PATH=./data/chroma_db\nCHROMA_COLLECTION_NAME=manga_covers\nTAG_LIBRARY_PATH=./51標籤庫.json\n\nREQUEST_TIMEOUT=120\nLOG_LEVEL=INFO\n```\n\n## Development\n\nRun tests:\n\n```bash\npytest tests/ -q\n```\n\nInitialize or rebuild the RAG collection:\n\n```bash\npython scripts/init_rag.py\n```\n\n## Current Priorities\n\n- Keep route handlers thin and move orchestration into services\n- Improve tag library matching performance as the dataset grows\n- Add more targeted tests around LM Studio failure and fallback paths\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredredchen01%2Fmanga-tagger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredredchen01%2Fmanga-tagger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredredchen01%2Fmanga-tagger/lists"}