{"id":7785836,"url":"https://github.com/Dublit-Development/ollama-api","last_synced_at":"2025-07-17T05:31:13.456Z","repository":{"id":209097449,"uuid":"723226021","full_name":"Dublit-Development/ollama-api","owner":"Dublit-Development","description":"Deploy a RESTful API Server to interact with Ollama and Stable Diffusion","archived":false,"fork":false,"pushed_at":"2024-04-09T04:06:50.000Z","size":64695,"stargazers_count":57,"open_issues_count":1,"forks_count":4,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-11T22:09:19.987Z","etag":null,"topics":["ai","codellama","codellama-70b-instruct","llama2","machine-learning","mistral-7b","mixtral","ollama","serverless","stable-diffusion"],"latest_commit_sha":null,"homepage":"https://dublit.org/","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/Dublit-Development.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}},"created_at":"2023-11-25T01:57:56.000Z","updated_at":"2025-07-09T00:16:44.000Z","dependencies_parsed_at":"2023-12-15T03:38:33.757Z","dependency_job_id":"fa88f0f4-bf2f-45ed-89a7-10692330b7bd","html_url":"https://github.com/Dublit-Development/ollama-api","commit_stats":{"total_commits":99,"total_committers":3,"mean_commits":33.0,"dds":0.101010101010101,"last_synced_commit":"f6b8bfcb8e1ce17ee9321c923876b94ed230716e"},"previous_names":["dublit-development/ollama-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Dublit-Development/ollama-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dublit-Development%2Follama-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dublit-Development%2Follama-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dublit-Development%2Follama-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dublit-Development%2Follama-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dublit-Development","download_url":"https://codeload.github.com/Dublit-Development/ollama-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dublit-Development%2Follama-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265005352,"owners_count":23696586,"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":["ai","codellama","codellama-70b-instruct","llama2","machine-learning","mistral-7b","mixtral","ollama","serverless","stable-diffusion"],"created_at":"2024-04-11T21:12:45.667Z","updated_at":"2025-07-17T05:31:12.741Z","avatar_url":"https://github.com/Dublit-Development.png","language":"Python","readme":"# Ollama API: A UI and Backend Server to interact with Ollama and Stable Diffusion\nOllama is a fantastic software that allows you to get up and running open-source LLM models quickly alongside with Stable Diffusion this repository is the quickest way to chat with multiple LLMs, generate images and perform VLM analysis.  The complied code will deploy a Flask Server on your choice of hardware.  \n\nIt would be great if you can support the project and give it a ⭐️.\n\n![demo](/assets/demo.png)\n\n## Roadmap\n- **Apache Support**:  We plan to support a production service API using WSGI \n- **Restful Support** Creating a quick RESTful deployment to query your favorite models with ease\n- **Docker** Ensure deployment is seamless and simple using docker\n- **API Route Documentation** Documentation to create your own interfaces or interactions with the backend service\n\n## How to Run\n1. Complete all the prequisite steps\n2. Run the program `python3 app.py`\n\n![run](./assets/run_server.gif)\n\n\n#### Hardware Specs\nEnsure that you have a machine with the following Hardware Specifications:\n1. Ubuntu Linux or Macintosh (Windows is not supported)\n2. 32 GB of RAM\n3. 6 CPUs/vCPUs\n4. 50 GB of Storage\n5. NVIDIA GPU\n\n#### Prerequisites\n1. In order to run Ollama including Stable Diffusion models you must create a read-only HuggingFace API key.  [Creation of API Key](https://huggingface.co/docs/hub/security-tokens)\n2. Upon completion of generating an API Key you need to edit the config.json located in the `./app/config.json`\n\n![config](./assets/config_demo.gif)\n3. Install neccessary dependencies and requirements: \n\n```sh\n# Update your machine (Linux Only)\nsudo apt-get update\n# Install pip\nsudo apt-get install python3-pip \n# Navigate to the directory containing requirements.txt\n./app\n# Run the pip install command\npip install -r requirements.txt\n\n# Enable port 5000 (ufw)\nsudo ufw allow 5000\nsudo ufw status\n\n# CUDA update drivers \nsudo apt-get install -y cuda-drivers\n```\n\n### Front End Features\n\n- **Dynamic Model Selection**: Users can select from a range of installed language models to interact with.\n- **Installation Management**: Users can install or uninstall models by dragging them between lists.\n- **Chat Interface**: Interactive chat area for users to communicate with the chosen language model.\n- **Support for Text-to-Image Generation**: It includes a feature to send requests to a Stable Diffusion endpoint for text-to-image creation.\n- **Image Uploads for LLaVA**: Allows image uploads when interacting with the LLaVA model.\n\n### Frontend\n\n- **HTML**: `templates/index.html` provides the structure of the chat interface and model management area.\n- **JavaScript**: `static/js/script.js` contains all the interactive logic, including event listeners, fetch requests, and functions for managing models.\n- **CSS**: `static/css/style.css` presents the styling for the web interface.\n\n### Proxy-Backend\n\n- **Python with Flask**: `main.py` acts as the server, handling the various API endpoints, requests to the VALDI endpoint, and serving the frontend files. While python, this is more of a frontend file than backend; similar to cloud functions on firebase. It functions as a serverless backend endpoint, but is a proxy to your real backend\n\n### API Endpoints\nThis directly interacts with the Backend Server hosted on VALDI.\n\n- `/`: Serves the main chat interface.\n- `/api/chat`: Handles chat messages sent to different language models.\n- `/api/llava`: Specialized chat handler for the LLaVA model that includes image data.\n- `/txt2img`: Endpoint for handling text-to-image generation requests.\n- `/list-models`: Returns the list of available models installed on the server.\n- `/install-model`: Installs a given model.\n- `/uninstall-model`: Uninstalls a given model.\n- `/install`: Endpoint used for initial setup, installing necessary components.\n\n## Credits ✨\nThis project would not be possible without continous contributions from the Open Source Community.\n### Ollama\n[Ollama Github](https://github.com/jmorganca/ollama)\n\n[Ollama Website](https://ollama.ai/)\n\n### @cantrell\n[Cantrell Github](https://github.com/cantrell)\n\n[Stable Diffusion API Server](https://github.com/cantrell/stable-diffusion-api-server)\n\n### Valdi\nOur preferred HPC partner  🖥️\n\n[Valdi](https://valdi.ai/)\n\n[Support us](https://valdi.ai/signup?ref=YZl7RDQZ)\n\n### Replit\nOur preferred IDE and deployment platform  🚀\n\n[Replit](https://replit.com/)\n\n----\nCreated by [Dublit](https://dublit.org/) - Delivering Ollama to the masses\n\n## Troubleshooting\nOur prefered HPC provider is Valdi.  We access machine's securly by generating a privte and public key ssh file.  You will need to ensure the permissions are correct before accessing any machine.\n```sh\nchmod 600 Ojama.pem\n``` \n### Python versions\nWe support python versions 3.8 and above, however code can run more efficiently on most stable versions of python such as 3.10 or 3.11.  Here is a helpful guide as to how your python version can be updated.\n\nhttps://cloudbytes.dev/snippets/upgrade-python-to-latest-version-on-ubuntu-linux","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDublit-Development%2Follama-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDublit-Development%2Follama-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDublit-Development%2Follama-api/lists"}