Sign inSign up

javi98/python-api-car-price-ai

By javi98

Updated over 1 year ago

Docker image application Python with FastAPI to predict car prices using ML, RAG assistant.

Image
Languages & frameworks
Machine learning & AI
Data science
0

445

javi98/python-api-car-price-ai repository overview

Python API CarPriceAI

CarPriceAI

Application that implements an API in Python using the FastAPI framework, designed to predict car prices based on their characteristics, such as brand, model, mileage, among others. The machine learning model has been trained with a data set of more than 50,000 cars, allowing it to generate accurate and reliable price estimates.

In addition, the application includes a RAG (Retriever-Augmented Generation) as a virtual assistant, which helps users obtain information about cars and their characteristics in an interactive way. Additionally, it has an authentication system so that administrator users can retrain the model with new data, uploaded via CSV files.

Github repository: https://github.com/JAVI-CC/python-api-CarPriceAI



Setup
git clone https://github.com/JAVI-CC/python-api-CarPriceAI.git
cd python-api-CarPriceAI
docker compose up -d
docker compose exec ollama chmod +x ./docker-config/first_start_ollama.sh
docker compose exec ollama ./first_start_ollma.sh
docker compose exec app chmod +x ./docker-config/run.sh
docker compose exec app ./docker-config/run.sh

docker-compose.yml
#version: '3'
services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    image: javi98/python-api-car-price-ai:1.0.0
    container_name: python-api-car-price-ai-app
    restart: unless-stopped
    # command: fastapi run app/main.py --port 8000 # Production mode
    command: fastapi run app/main.py --port 8000 --reload # Development mode
    ports:
      - 8000:8000
    volumes:
      - ./:/code
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [ gpu ]
    depends_on:
      - db
      - ollama
  ollama:
    build:
      context: ./docker-config/ollama
      dockerfile: Dockerfile_Ollama
    image: javi98/ollama-llama3:1.0.0
    container_name: python-api-car-price-ai-ollama
    restart: unless-stopped
    ports:
      - 11434:11434
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [ gpu ]
  db:
    image: mariadb:11.6.2
    container_name: python-api-car-price-ai-db
    restart: unless-stopped
    env_file: .env
    ports:
      - "3306:3306"
    volumes:
      - db-data:/var/lib/mysql
  phpmyadmin:
    image: phpmyadmin:5.2.2
    container_name: python-api-car-price-ai-phpmyadmin
    restart: unless-stopped
    ports:
      - 8085:80
    environment:
      PMA_ARBITRARY: 1
      UPLOAD_LIMIT: 350M
    depends_on:
      - db
networks:
  python-api-car-price-ai:
    driver: bridge
volumes:
  db-data:

Once you have the containers deployed, you can access http://localhost:8000

Tag summary

Content type

Image

Digest

sha256:7d31487df

Size

9.4 GB

Last updated

over 1 year ago

docker pull javi98/python-api-car-price-ai