zakerby / python-ollama-starter

A boilerplate project to build solution with LLM models using Ollama

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python Ollama Starter

A simple Flask app customized to work with LLM models using Ollama

Run Locally

Clone the project

  git clone https://github.com/zakerby/python-ollama-starter my-project

Go to the project directory

  cd my-project

Run Docker Compose

  docker-compose up -d

Endpoints test

To get available models

curl http://127.0.0.1:5000/ollama/available-models 

To create a new model

curl -X POST http://127.0.0.1:5000/ollama/create-model -H 'Content-Type: application/json' -d '{"model_name":"test", "base_model_name": "gemma:2b", "model_description": "I am a gardener, act as an helpful gardener for the users"}'    

To query an existing model

curl -X POST http://127.0.0.1:5000/ollama/query-model -H 'Content-Type: application/json' -d '{"model_name":"test", "query": "How are you?"}'

Roadmap

  • Add training model support

  • Add API key login mgmt

About

A boilerplate project to build solution with LLM models using Ollama


Languages

Language:Python 98.7%Language:Dockerfile 1.3%