Git Product home page Git Product logo

django-local-ai's Introduction

Django local AI

Run a local AI from Django with Llama.cpp

Install

Clone the repository and install the dependencies:

git clone https://github.com/emencia/django-local-ai
cd django-local-ai
make install

In case of an error Failed to build llama-cpp-python try this and run again:

source .venv/bin/activate
export SETUPTOOLS_USE_DISTUTILS=stdlib
pip install --upgrade --force-reinstall setuptools

Get a language model

To make this work you need a Llama.cpp gguf quantitized language model. We will use Mistral 7B Instruct from this repository:

cd some/dir/where/to/put/your/models
wget https://huggingface.co/TheBloke/Mistral-7B-Instruct-v0.1-GGUF/resolve/main/mistral-7b-instruct-v0.1.Q4_K_M.gguf

Settings

Change the LLM_MODELS_DIR setting in main/settings.py to your model directory path.

Change the LLM_DEFAULT_MODEL setting in main/settings.py if you want to use another model. Use an absolute path.

Run

Run the http server:

make run

Create a superuser:

make superuser

Open the frontend at localhost:8000 and the admin at localhost:8000/admin/

django-local-ai's People

Contributors

mmaudet avatar synw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

mmaudet

django-local-ai's Issues

Impressive, but I don't get the Vue-Django link

Hi there,
Very nice project, I love the idea!
After download and using your (great!) make routines, I had my first Emencia generated email.
As a former marketing director myself, it's impressive (and maybe too long) 😄

I can see the Django LM tasks table, but I see the Demo page is hard coded, not linked to Django DB LM tasks.
I wonder why it's not linked.
What is the use of Django, besides the generate view?

Bonne journée à toute votre équipe !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.