{"id":14064820,"url":"https://github.com/bitswired/semantic-caching","last_synced_at":"2026-03-17T23:50:04.910Z","repository":{"id":182889121,"uuid":"654754835","full_name":"bitswired/semantic-caching","owner":"bitswired","description":"Explore semantic caching to reduce your OpenAI/LLM API bill","archived":false,"fork":false,"pushed_at":"2023-07-21T19:46:44.000Z","size":72,"stargazers_count":10,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-04T03:35:02.340Z","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/bitswired.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2023-06-16T21:51:08.000Z","updated_at":"2024-05-03T08:09:52.000Z","dependencies_parsed_at":"2023-07-22T02:24:19.546Z","dependency_job_id":null,"html_url":"https://github.com/bitswired/semantic-caching","commit_stats":null,"previous_names":["bitswired/semantic-caching"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bitswired/semantic-caching","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitswired%2Fsemantic-caching","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitswired%2Fsemantic-caching/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitswired%2Fsemantic-caching/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitswired%2Fsemantic-caching/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitswired","download_url":"https://codeload.github.com/bitswired/semantic-caching/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitswired%2Fsemantic-caching/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30635834,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T22:38:22.569Z","status":"ssl_error","status_checked_at":"2026-03-17T22:38:11.804Z","response_time":56,"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":"2024-08-13T07:04:06.094Z","updated_at":"2026-03-17T23:50:04.834Z","avatar_url":"https://github.com/bitswired.png","language":"Python","readme":"# Semantic Caching Evaluation 🚀\nExplore semantic caching to reduce your OpenAI/LLM API bill\n\n\nThis repository contains a Python application that demonstrates the use of semantic caching in searching for similar questions in a cache. It compares the performance of two different embedding methods: OpenAI and ONNX.\n\n## Features 🌟\n\n- Streamlit web application to test and evaluate semantic caching.\n- CLI for testing exact, semantic, and no cache.\n- ONNX and OpenAI embeddings.\n- FAISS search for fast similarity search.\n\n## Installation 🛠️\n\nTo install this project, you need to have Python 3.10 installed. Then, follow these steps:\n\n1. Clone the repository\n\n2. Enter the project directory\n\n3. Install the project: `poetry install`\n\n4. Set up your OpenAI API key in the `.env` file.\n\n## Usage 🎮\n\n### CLI\n\nTo run the CLI, use the following command:\n\n```bash\npoetry run cli run \u003ccache_type\u003e\n```\n\nReplace `\u003ccache_type\u003e` with `no_cache`, `semantic_cache`.\n\n### Streamlit Web App\n\nTo run the Streamlit web app, use the following command:\n\n```bash\npoetry run webapp\n```\n\nThe app will be available at `localhost:8501`.\n\n## Project Structure 📁\n\n- `pyproject.toml`: TOML file that contains the project metadata and dependencies.\n- `scripts/`: Folder containing the Streamlit app and CLI scripts.\n- `semantic_caching/`: Folder containing the core caching logic.\n- `cache/`: Folder to store cache files (FAISS indices and SQLite databases).\n\n## Dependencies 📚\n\n- langchain\n- openai\n- streamlit\n- python-dotenv\n- gptcache\n- tiktoken\n- rich\n- torch\n- typer\n\n## Contributing 🤝\n\nWe welcome contributions to this project! Please feel free to submit issues or pull requests.\n\n## License ⚖️\n\nThis project is licensed under the MIT License.","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitswired%2Fsemantic-caching","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitswired%2Fsemantic-caching","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitswired%2Fsemantic-caching/lists"}