{"id":19444484,"url":"https://github.com/sirbuig/host-gemini-ai","last_synced_at":"2025-04-25T01:30:42.364Z","repository":{"id":233396303,"uuid":"787068641","full_name":"sirbuig/host-gemini-ai","owner":"sirbuig","description":"Short and fast tutorial on how to host Gemini 1.5 Pro on a local environment without an API key.","archived":false,"fork":false,"pushed_at":"2024-07-07T09:34:52.000Z","size":11,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-07-07T10:46:08.282Z","etag":null,"topics":["debian","gemini","gemini-ai","os-linux","tutorial","ubuntu","vertex-ai"],"latest_commit_sha":null,"homepage":"","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/sirbuig.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}},"created_at":"2024-04-15T20:37:14.000Z","updated_at":"2024-07-07T09:34:49.000Z","dependencies_parsed_at":"2024-04-16T03:06:51.361Z","dependency_job_id":"2eecca61-a31e-4eb2-a468-eeb915e7b739","html_url":"https://github.com/sirbuig/host-gemini-ai","commit_stats":null,"previous_names":["sirbuig/host-gemini-ai"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sirbuig%2Fhost-gemini-ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sirbuig%2Fhost-gemini-ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sirbuig%2Fhost-gemini-ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sirbuig%2Fhost-gemini-ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sirbuig","download_url":"https://codeload.github.com/sirbuig/host-gemini-ai/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223976319,"owners_count":17234751,"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","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":["debian","gemini","gemini-ai","os-linux","tutorial","ubuntu","vertex-ai"],"created_at":"2024-11-10T16:07:16.650Z","updated_at":"2024-11-10T16:07:17.468Z","avatar_url":"https://github.com/sirbuig.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# How to host Gemini AI on a local environment\n\n[![Python \u003e= 3.8](https://img.shields.io/badge/Python-\u003e=3.8-blue.svg)](https://www.python.org/downloads/)\n[![Linux](https://img.shields.io/badge/OS-Linux-blue.svg)](https://www.kernel.org/)\n![Debian 9+](https://img.shields.io/badge/Debian-9%2B-red)\n![Ubuntu 18.04+](https://img.shields.io/badge/Ubuntu-18.04%2B-orange)\n![Gemini](https://img.shields.io/badge/Gemini-1.5%20Pro-8E75B2)\n\n\u003cbr\u003e\n\nThis is a super fast tutorial on how to host Gemini AI on a local environment. This guide is mostly for users from EU who don't have (yet) access to the Gemini API.\n\nAlthough the tutorials from Google are far more comprehensive, for a newbie they can be quite overwhelming so this contains only the bare minimum to experiment with the Gemini models.\n\nEven if the links provided will perhaps be useful, for more elaborate projects I advise you to follow another guide.\n\n\u003cbr\u003e\n\n\u003e [!WARNING]\n\u003e These steps were tested on Ubuntu 22.04 LTS and Linux Mint 21.3 \"Virginia\".\n\u003e If you have a different OS (not Debian-based) or a different version you can still follow the tutorial, however you will have to check the links/ search for alternatives. The steps remain the same.\n\n\u003cbr\u003e\n\n## I - Vertex AI\n\nUsing [Google Cloud Computing Service](https://cloud.google.com/?hl=en) connect to the _Free Trial_, then **Try Gemini 1.5 Pro**. You will be redirected to **Vertex AI**.\n\u003cbr\u003e\nCreate a new project (remember the name) and experiment with the models and settings.\n\n\u003cbr\u003e\n\n## II - [Virtualenv](https://cloud.google.com/python/docs/reference/aiplatform/latest/index.html)\n\nClone this repo and open the terminal.\n\n```shell\npip install virtualenv\nvirtualenv \u003cyour-env\u003e\nsource \u003cyour-env\u003e/bin/activate\npython3 -m pip install -r requirements.txt\n```\n\n\u003e [!NOTE]\n\u003e If you encounter `Command 'virtualenv' not found`, use `sudo apt install python3-virtualenv` instead.\n\n\u003cbr\u003e\n\n## III - [Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev)\n\nInstall the [gcloud CLI](https://cloud.google.com/sdk/docs/install#deb).\n\nFor a faster setup use the script.\n\n\u003e [!NOTE]\n\u003e If you do not have the same OS or you have a different version of it, please follow the guide from the link provided adjusted to your case!\n\n```shell\nchmod +x script.sh\n./script.sh\n```\n\nYou will be redirected to a login screen, then asked to choose the project (see Step I). Follow the steps accordingly.\n\nIf succesful, you will be redirected to this [page](https://cloud.google.com/sdk/auth_success).\n\nNow create your credential file using\n`gcloud auth application-default login`.\n\nIf succesful, you should see the same [page](https://cloud.google.com/sdk/auth_success) again.\n\n\u003cbr\u003e\n\n## IV - [Google Cloud console](https://cloud.google.com/storage/docs/discover-object-storage-console)\n\nFor enabling PDF prompts and analysis, the object must be uploaded in a Bucket. Follow the steps accordingly.\n\n\u003cbr\u003e\n\n## V - Have fun!\n\nModify `main.py` to your liking and enjoy the newest Gemini model!\n\nDon't forget `python3 main.py` to run it.\n\n\u003cbr\u003e\n\n\u003e [!TIP]\n\u003e If you have any suggestions or you want to add explanations/ commands or you faced some errors I did not, you are free to contribute!\n\u003e\n\u003e This is a quick guide I made in the middle of the night after some hours spent figuring out how I can use Gemini locally.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsirbuig%2Fhost-gemini-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsirbuig%2Fhost-gemini-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsirbuig%2Fhost-gemini-ai/lists"}