{"id":31669596,"url":"https://github.com/branchingbad/gemini-api-tester","last_synced_at":"2025-10-28T08:51:30.241Z","repository":{"id":316844019,"uuid":"1065076561","full_name":"BranchingBad/gemini-api-tester","owner":"BranchingBad","description":"This project provides a complete environment to test the Google Gemini API using both a simple Flask web frontend and a standalone Python command-line interface (CLI) script. It uses Docker/Podman for containerization to ensure a consistent and portable setup.","archived":false,"fork":false,"pushed_at":"2025-09-29T23:15:53.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-08T01:53:03.903Z","etag":null,"topics":["dockerfile","flask-application","gemini","gemini-ai","gemini-api","gemini-flash","gemini-pro","imagen","python"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BranchingBad.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-27T02:52:47.000Z","updated_at":"2025-09-29T23:15:56.000Z","dependencies_parsed_at":"2025-09-27T04:25:26.705Z","dependency_job_id":"5057af64-b68b-42f8-a7a3-8e1f3efc87e6","html_url":"https://github.com/BranchingBad/gemini-api-tester","commit_stats":null,"previous_names":["branchingbad/gemini"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/BranchingBad/gemini-api-tester","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BranchingBad%2Fgemini-api-tester","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BranchingBad%2Fgemini-api-tester/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BranchingBad%2Fgemini-api-tester/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BranchingBad%2Fgemini-api-tester/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BranchingBad","download_url":"https://codeload.github.com/BranchingBad/gemini-api-tester/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BranchingBad%2Fgemini-api-tester/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281410760,"owners_count":26496368,"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-10-28T02:00:06.022Z","response_time":60,"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":["dockerfile","flask-application","gemini","gemini-ai","gemini-api","gemini-flash","gemini-pro","imagen","python"],"created_at":"2025-10-08T01:51:24.023Z","updated_at":"2025-10-28T08:51:30.218Z","avatar_url":"https://github.com/BranchingBad.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gemini API Tester\n\nThis project provides a complete environment to test the Google Gemini API using both a simple **Flask web frontend** and a **standalone Python command-line interface (CLI) script**. It uses **Docker/Podman** for containerization to ensure a consistent and portable setup.\n\n---\n\n## The following models are currently supported\n* **gemini-2.5-flash-lite (Lite)**\n* **gemini-2.5-flash** (Image input optional.)\n* **gemini-2.5-pro (Advanced)**\n\n## Image Generation Model\n* **gemini-2.5-flash-image-preview (Image Generation)** (Text-to-Image and conversational editing.) (Needs testing but I hit the qouta limit for the day)\n\n---\n\n## 1. Prerequisites\n\nYou must have the following installed:\n\n* **Python 3.9+** (For running the `gemini-test.py` script locally).\n* **Docker or Podman** (For running the web application).\n* **A Gemini API Key** (Set as an environment variable).\n\n### Setting the GEMINI_API_KEY\n\nThe backend and CLI script both require the `GEMINI_API_KEY` environment variable to be set. The API key is stored as an enviroment variable for security.\nMore information can be found at https://ai.google.dev/gemini-api/docs/api-key\n\n**Linux/macOS (For current session):**\n```bash\nexport GEMINI_API_KEY=\"YOUR_API_KEY_HERE\"\nWindows (Command Prompt):\nBash\n\nset GEMINI_API_KEY=\"YOUR_API_KEY_HERE\"\n2. Using the CLI Script (gemini-test.py)\nThe standalone Python script is useful for quick, command-line testing.\n\nUsage:\n\nBash\n\n# Default model (gemini-2.5-flash)\npython gemini-test.py \"Explain why the sky is blue.\"\n\n# Specify a different model\npython gemini-test.py --model gemini-2.5-pro \"Write a full whitepaper on the future of AI.\"\n\n# Image Generation Example (will save a .png file)\npython gemini-test.py --model gemini-2.5-flash-image-preview \"A photorealistic image of a futuristic castle on a moonlit ocean.\"\n3. Running the Web UI with Podman/Docker\nThe web application is containerized using the provided Dockerfile and is designed to run on port 5000 inside the container.\n\nStep 1: Build the Container Image\nThis command builds the image, tags it as gemini-frontend, and passes your local GEMINI_API_KEY environment variable into the image using a build argument.\n\nBash\n\npodman build -t gemini-frontend --build-arg GEMINI_API_KEY=$GEMINI_API_KEY .\n# OR (for Docker)\n# docker build -t gemini-frontend --build-arg GEMINI_API_KEY=$GEMINI_API_KEY .\nStep 2: Run the Container\nRun the image, mapping the container's internal port 5000 to an external port (e.g., 8080) on your host machine. You can manually replace $GEMINI_API_KEY with your API key if you wish. It is recomened to use an enviroment variable (attackers can check command line history for previously used keys. Ask Gemini why this is best practice if you need).\n\nBash\n\npodman run -d -p 8080:5000 --name gemini-app -e GEMINI_API_KEY=$GEMINI_API_KEY gemini-frontend\n# OR (for Docker)\n# docker run -d -p 8080:5000 --name gemini-app gemini-frontend\nStep 3: Access the Application\nOpen your web browser and navigate to:\n\nhttp://localhost:8080\n\nYou can now use the interface to test multimodal (image + text) and text-only models, as well as the new image generation model.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbranchingbad%2Fgemini-api-tester","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbranchingbad%2Fgemini-api-tester","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbranchingbad%2Fgemini-api-tester/lists"}