Ollama Web UI

Elmustapha Abourar
3 min readMar 20, 2024

Ollama Web UI is a web application that helps users who have Ollama installed locally to utilize its API through an interactive web application that I developed over the course of five days.

“In this project, I chose to utilize NextJs, a powerful React Framework that provides the capability to handle server-side rendering efficiently. Next.js enables smooth communication between the front and back end, enhancing performance significantly. For styling this application, I prefer to style my components using Tailwind CSS, as it integrates seamlessly with Next.js. Additionally, I highly recommend using Shadcn, a collection of reusable components that can be installed via NPM or simply copied and pasted into your project’s UI components folder. This library gives a responsive and good looking design to the app and easy to modify.

The main function of this web application is to provide a platform where users can generate various type of content, including code, music, videos, and images. the users can achieves this through the integration of several APIs :

  • For code generation and conversation , this project utilizes the Ollama Api that you can grab it from this GitHub repository. This Api can be installed locally on your machine, allowing to run models and pull models directly from the terminal. Once installed you can interact with the Ollama Api with the model of your choice, Link of model. You can integrate your project with the Ollama Api using Ollama JavaScript Library
end point to interact with the ollama API
  • For music and video generation, significant resources are required, and the process can be time consuming. While one option is to install an image generator model such as Stable Diffusion locally on the machine, this approach demands considerable time and GPU usage. Therefore i opted to utilize the Replicate integrated Model (paid) for this purpose. with Replicate, you can interact directly with their Api to access the necessary resources and model and their hash identifier. you can install Replicate library using NPM.
End point for interacting with the Replicate API
  • For the image generator, I had the option to choose between OpenAI and Replicate. After careful consideration, I decided to utilize OpenAI due to its pricing. In the project, users can generate up to 5 images, each available in 3 different aspect ratios.

All these features are accessible through a user-friendly interface, which includes a sidebar for easy navigation between different sections of the application. To get started, simply read the README for the project, clone it, and add all the necessary API keys to the environment file (.env) inside the project directory.

For further explanations or questions, feel free to reach out to me via my LinkedIn account.

--

--

Elmustapha Abourar

Software Engineer Student @Holberton School & Pro Dancers Choreographer DeeJay / Beat Maker