Back to the video

Lionel Jouvet - AI That Plays Nice: Building a Privacy-First Grant Review Tool

Transcript

By Speaker 1, Speaker 2, Speaker 3, Speaker 4. From Django Day Copenhagen 2026. Published October 13, 2026.

Watch the video Markdown version 5,619 words · auto-generated · en

Transcript

Automatically transcribed, so expect mistakes in names and technical terms. Filler words are removed.

Speaker 1

I think we should give Lionel a big round of applause. This will be the last full talk of the day before we will have a lot of lightning talks after. So super exciting remainder of the Today. Yeah, let's give Leona Hill a big round of applause. Okay.

Speaker 2

Then thank you very much for having me and having us. I'm going to speak to you some today about how we can play nice with LLMs. When we are working into a Django environment, I'm going to first remember you two years ago I did kind of It is about what we were working on, Django Lama. You know that if you want to use an LLM locally, OLAMA has been for a long time a good way to run your local LLMs. and then now I'm going to show you what it is. And first I want to give you some environment about what we are doing. Then first I have to speak about our team. Maeva was the first one to set up our team and we are

all working with Django in different projects. First Louisa, she's a fire woman. When there is a something that goes wrong, she's the first one in line to get the fur fire down. You know that guy probably. The one that is shouting at the LLM there is Julien and Julien is a full stack that have been producing a Django web app that is used to by our university and many other universities in Denmark. to match scientists with funding. And we have Alex with another full stack here that I've been developing on a Django framework. Using React as well, a web app for the mission ocean

for the EU and doulé that as well have been developing with Django another web app that is used by many young universities in EU Django has been the bread and butter for all of us. And we are a bit special for a group of developers. We are working in the administration of a university And then as you can hear from my accent, I come from the University of Southern Denmark, Southern, that's where my accent comes from. Yeah. The group in which we work is people that are research supporters, meaning When you are a scientist you spend an unholy

time trying to get money to do more research to be able to help the scientist We have teams that are research supporters that are help helping them to be able to fill up the grounds to be able to get money. And us behind we are there to be able to help our research supporters too, and our scientists, to make tools that are dedicated to that. And it is what I'm going to show you today with this problematic. Then the problematic for recherche supporter, as you can see here, it's we have to deal with a lot of different types of fundings, national and european. In here to give you an idea it is all the deadlines. through the year of European funding meaning that scientists come to a research supporter

20 at a time three weeks before the dead end the not dead end deadline it can become a dead end and asking them for support and help to read through their application to be able to improve it and often it is last minute. Then our colleagues I don't know how to say that exactly but They have to deal with so many things. They have to be able to review the whole d read the whole document. They have to look at the money behind. They have to it is so many things to do. I wish I had a drawing to be able to show yes, more or less is that. It's they have to do a lot in a very narrow time. And the application they get, this can be from someone that just started kind of a draft for an application to someone that have been already spending a lot of time on it

Meaning that for the research reporter it is very important to help the guys that already have something that is concrete, finished and for the one that just started the draft to be able to give quick feedback so they can move on. And it is what I'm targeting with that. Yes. One other thing that is probably of interest to you into the web apps I've mentioned earlier, my colleagues have been developing the or deploying these web apps on Asia then we in a lot of for a lot of you are using platforms that are available At SDU we have the eScience Center that have this supercomputer with servers that we can use.

And we have tiles we can access that are running ubuntu in the back and where we can deploy our own stuff which is really interesting for us because we gain sovereignty We don't depend of Microsoft, we don't depend of Amazon, we don't depend of anyone, then it is all self-contained, kind of a sandbox. And that's start to be interesting for us when a scientist is applying for ground. A lot of these applications contain some intellectual property, some kind of advanced work. And trying not to lick it as you would if you use LLMs that no are not based in the EU, that are not GDPR compliant.

And I don't know if you heard about it but even people from how what's their name the guys that give the surveillance tools to a lot of nations are complaining about the way the this L LM provider are dealing with their data. Then even if them are complaining about it, imagine that what it is for us. We all remember using Gmail at the beginning when they started to release free access to these emails We never thought that the data that we were putting in it could be used in such an extensive way. LLM is a really good way to capture even more of that. Then on our own small dimension at SDU we wanted to develop a set of tools that where

the use of LLM is less dangerous when it comes to intellectual property And what we vouch to maintain, it is an automatisation. We don't want to take away the job of our colleagues. People that have been working in research support have développed an expertise over many years. They know exactly the right feeling to add to a prop to an application. And our goal in here it is to give them the help for things that are not developed enough yet, so they can just put their brain power to the things that really will make a difference. I'm telling you a lot of words but I think it's I will be giving you an overview of what this app is. To be able to

Explain what we do. I don't have my classes. There. Then as you can see in here we are working so you will see what we have the dashboard from this e-science center. You can see that we have access to compute, we have access to storage and we now for the past 10 days, 15 days, we have access to inference. As you can see, we can run different types of modules and in here you can see Postgres, which is the database I'm using in the background, and Django, which is running the website one other thing I like very much with Django

it's the fact that you have this static where you can put all your CSS If you have JavaScript that is code that is in different pages, you can all store that on the side. One place Everything is clean and it is really exciting for that. The color scheme, then as you can see, I'm not a graphic designer. Yeah, but it runs. What is interesting in Twitch then this tool is aimed for a research supporter but other scientists as well to be able to analyze a proposal and give some feedback on it. To be able to do that, then as the obviously to be able to read through a proposal we use LLMs

This plateforme can run either locally on a laptop in Docker, using Olama and running the LLM locally, then totally outside of any connection with Internet. with strong limitations that I'm going to speak about later. Or use now either ten days ago we were using the API of Mistral, GDPR compliant servers and now we do the inference dire directly into the UCloud into our own secure environment. And to be able to do an analysis you need to be able to define what the ground type will be. Then if you have a EU application or a DFF, what is the another

Why now the LM for come in different places into this tool? This is one part that will do the analysis I'm going to show you how it works. You click on start analysis. You are going to choose one type of grant, in that case we a European programme. You can select some proposal. I'm going to select it in here. You give him a name, Toto Vous pouvez choisir si vous voulez le retourner localement ou online. Enline is à l'autre de votre computer. Then you the you are going to parse the document.

It can be a PDF I hate PDF. It can be a word document, it can be a markdown, and so on. And then automatically the tool is going to cut this document into the different sections that are interesting Why do we want to cut this document? It is as you know, LLM have a strong limitation and it's often it's a context window. You can feed them with a lot of information but very quickly they are going to forget stuff at the beginning, in the middle, at the end, to be able to limit and mitigate this problem of loss of memory We break the document in small in different parts that allow us to use different agents that we

develop ourselves. where you can give a different persona a different question. For example, this is what you see me doing just now. The NPAC section I'm going to look at my NPAC specialist with the question and finally the last part the implementation. I'm going to take my implementation specialist. And all the process is then set up in that way. Now what is interesting with Django est que this or what is this difficult more like with Django. LLM can be very slow to do the treatment And if you take a normal naive way as I did at the beginning, I had a lot of problems of breakup because there was the disconnection

with my API And what is important too, it's then you can see the analysis is running and you can start from standing in front of your computer, not doing anything, which is really annoying. But when you come back to your dashboard, you are looking at previous applications. What you can see on the top of the document is that you can still access the analysis and see that it is still running. Why I'm telling you all that it is I'm going now to explain how that was set up in Django to be able to do it. If I can get my presentation back. And at the beginning I was very naive in the way I implemented it.

I'm using engine X and Gunicorn into managing the different people. Many people can connect to the app. Then when you go into the app, then you are going first to meet your engine X that is going to give you load And then after you are going to ask for an analysis to be an analysis and an API call to the LLM to be done And that will be sent to your Unicorn and to the chef at the back which is Python that is dealing with it.

What is interesting it is at the beginning I had problem and I was trying to find a week on the same zytophilic line for the people that do like beer. It is that it's a bit like when you go into a pub and then you have been giving your load and you ask the chef, now have we like my LLM to analyze it. And you just leave the your beer on the on the stand and you say we need for one minute I'm just going to the jet I'm coming back. The problem with the API can take much longer And the first thing that will happen, it's your engine X that is going to tell you that's more than one minute, I'm pissed off. And the idea is yeah, there's something wrong with going

with it. And then after you have gunicons that come back And the process was already problématique. And then when you come back, you want to obtain your analysis and what you get is plenty d'erreurs. Lately your load, your work has been corrupted your database is not happy as are and a way to deal with it to be able to work in between these different two different life span dans le système a forme de pouvoir utiliser le database to dealer with this workflow And it had been the ground why I did that I wanted to have a simple system. I wanted to use Django

as a as only Django as possible, try not to add other layers, other libraries to put in. And this is Nginx and Unicorn format using the database to be able to manage the work at the back was very practical. The other thing that for I think for a lot of you when you want to develop Django environment you are ready to or you plan to have a huge amount of users In the infrastructure we have at SDU at the university, I'm likely to have twenty -fifty people at the same time that work on it, never more than that. And with this frame of work, I am kind of comfortable with this technical choice. Then when I go and I load an

I load the PDF for example, then I will wait until we get the return. The parsing can be done either locally or We use sometimes the Mistral API to be able to have a much higher quality optical character recognition, OCR. As you know, passing a PDF is really challenging. When you do it locally on your CPU, usually it's almost impossible to get the structure of it out. the titles for example. You can have tables kind of okay autofit. Usually the Mistral API for the OCR is much more stable

When it comes to the call to the LLM, then we can use our Postgres queue that allows us to Get the job done and we wait until we get in return. We don't keep our worker busy. That allows a much more stable flow And finally, when we have our process running too using this server send event we can actually do other things while that is running in the background you that allows the user to have more interaction with the tool, we start to be able to be dependent on the

result to come back. In the development of this web app, it had been often when you develop such a system, you have In French we say cahier descharges, everything is written down what the type of workflow you need to use, what the type of architecture. The development of this web app has been organic through time then it had been a long feedback in between the scientists the research supporter and me and to see what needed to be added to it, how we can improve and what is interesting as well. It is the type of evolution that were in the background I told you at the beginning that two years ago when we started to work on this project, the only API

that were available in four LLMs were ChatGPT, American system Mistral came in a bit later and no data could leave this app because at the time I had no trust at all into OpenAI user rights and into cloud or into any other American platform. The only path I had was OLAMA to be able to run it locally where I could control the different lm I was using. And I don't know if any of you use locally run LLMs. Any A few, okay. You use them to code as a helper. Helper, yes.

And then because one of the limits of these models is if you give them a full load of code, they forget ever everything but they don't have a memory for it. And what we saw in the past two years in evolution for this type of local LLM, we saw local LM that had much better capacities, context windows that started to be of the order of Thirty thousand, fifty thousand tokens reliably And one of the ones that started to got my attention was the one developed by IBM, the granite. I don't know if any of you used the advantage. No.

Good. Then the advantage of this platform it is the LEDM that they developed actually was for a production then it was much more stable than other LLMs that we can find, not as powerful but working pretty well. But now coming back to why now we use APIs that are much more powerful, first was Mistral had a good model a year and a half ago but never moved ahead and we have been stuck with the same model now for a long time and the capacity are very reduced. Two weeks ago the e-science center surprised us by g giving us free inference for employees. Then when you are an employee at SDU you have you are given enough inference

Quota to be able to vibe code the whole year to give an order of magnitude. But also to be able to run models such as this one to be able to ingest a lot and to be able to the model that is behind is GLM 5. 3 that you may have heard about that was released a month ago. And that gives us a very good large context window, one million tokens, and in addition a much higher quality output. Then yeah I'm speaking a lot about what it meant to us. And the constraint we have at the university, it is to protect as much as we can the

intellectual property. But then if these levels are really high from a health project, for example, where there is personal data involved, we would go to health Then we'll go to a local then we are sure about the quality the of security the problem is yeah you need a BPR hardware. It is very slow and a very limited context window Otherwise we use the UCloud LLMs and GLM five point three at the moment but is going to be updated with time, or Mistral API if they improve their model where

we have up to s up to I like your system. Then the speed are brilliant. We have almost six hundred, seven hundred token tokens per second, going quickly, good massive context window. In the case of Mistral actually the problem is it costs something for us to run. And what is interesting for you, what is the most expensive is not the inference, it is the optical character recognition. three compared or in the use of it. Then we come back to the thing about the OSC then the second part of the project that is difficult it is that these documents are as soon you give a template to a scientist

is going to mix it mess it up. Then you have a nicely organized well it's a big title, the you put your text here, the b You it comes back, it is broken. And usually a lot of people in administration like to deal with PDF Each time you try to parse PDF, you finish with a huge amount of imperfection Meaning that you have to be very clever when you do your section sectioning of your different parts. Regex is really even a very clever regex structure will miss then we came up with a more hybrid way to do it

And the it had been the akilli hill of this whole structure which is kind of the most annoying part because it should be the most benign way or the more obvious part of a project cutting a text in sections and yeah there's something of magic in tweet you take your text, you do your chunking and so there is a different reason for that. When you when you are a scientist, you never believe one person. You need you need to peer review your work. Then if you submit your proposal to one person it's one person.

When five percent to tell you the same thing, then you start to believe them. And it is a bit what we did into this tool as well. It's We configured a lot of different agents, personalities that will be specialized for a particular area of the feedback. Then for once we have our chunking that is done, then we are able to mitigate this problem of context window, the size of the part that will be treated. as well as getting some quality. But because of the fragility of the system, we still always need control of a human behind to make sure that it has been cut properly at the right place. What it means then without an image.

Then it is that in this tool if you found that there is a problem into the slicing you can always go and re-slice into like manually to be able to do it. And I haven't found a way around yet. Very frustrating and LLM again, then how do we integrate the LLM into the construction of this tool? You don't want to spend hours to dev to define a new grand type. Then I developed this grand type architect. And ici vous pouvez gagner un nom. Si vous cliquez go, vous faites une mistral search And it will try to retrieve as much information about the criteria for the ground and oh the lingua of grants

In the EU must, should, could, doesn't mean the same thing for everyone. And it is really important to know all these context to be able to build personas that are meaningful. You can also add your own criteria and it will be done automatically but there is a lot of automatisation that have been done using LLM to be able to build the persona for example and When you want to build your persona, that's not that one. The agent that is going to review the proposal they need to have kind of a character each one of them. There is a base prompt that you need because you need to be able to input all the context about that grant in particular

You need to be able to define what are the landscape of what this ground is about. But then after you want it to be more criticize for if it is for mathematics, for biology or for sociology, history. And then in here we develop another tool. A lot of our colleagues are not at all prompt engineers. They just want the tool to work. I want that the text will be coded for each one of the feedback and so on. And then we build as well an LM at the background and other region that helped to build this prompts Then we see that within the framework of Django we were able to integrate this LLM to help assist in to developing this tool

and we need to be careful because Yes, you know, when you ask L LM to do something, you rarely get the right thing out. Then there's a very strong push behind to be able to make that the output of this LLM is correct when it comes to these architects either for making a new ground type or persona to get sure that within the prompt that we do we have a very strong constraint on the format of the output and then after a lot of safety and validation to make it that it works. Can it go wrong Yes. And but not only LLM do mistakes,

when it comes to text Some other do. That's not an LLM. It could be. Lazy large man or something? Then nothing bad can happen. Only good happen. Then the horror story I had it is that one I need to share. You know LM are always complacent. They always to tell you it's good, it's good. Then I ask the LM to be a bit more rough That's what it gets out. Imagine you are a scientist, you spend a week working on this document and I don't know if you can read from here, but buzzboards. I don't know. It's read like a wish list. What is there in note?

unadvise, burn this draft Otherwise enjoy your rejection later. And that in the category parting shot. It makes me think of the scene in Terminator. Sarah Gondor. It's very important that a user before giving it back to the scientist to read through it, it can be a bit rough sometimes. To finish, as I told you, the text the text tags that have been used into this project it is Django, as much Django as we can. Postgres that is saving

that makes the day when it comes to interact with an unreliable connection to an LM API and for all the work that we do locally, a Docker, so we can move from one platform to another without too much trouble. Knowing that Only OLAMA is needed. Once you have the app running on Docker, the only thing, the only component you need outside is OLAMA that will be running your local LLM.

Speaker 1

Yeah, right on time. Thank you. And also sometimes Time for questions, like let's let's there is a question

Speaker 3

This one is from me. Thanks for your talk. How specific is the tool to grant reviews like what they call or if it be applicable to other use cases? Or is it because it sounded a lot of it was just like stuff you have to do in a lot of other cases. as well.

Speaker 2

Tell me if I ask pro if I reply properly. Then there's a lot of work to be done ahead to be able to get a proposal. Is that what you could no, okay then good I did well to rephrase.

Speaker 3

No, I meant more for like other use cases of document ingestion. Like where it's not at all grant related like just like the whole thing of parsing the different documents and putting it in section and putting context and just having a system. That works with the documents.

Speaker 2

Yes, okay. Then it is true that some of the components of this web app can be used otherwise. We are thinking of developing local tools to be able to do this PDF parsing and to be able formatting. The goal of this app is to target the research support service, but a lot of this component can be reused outside. It can be used as well, not only for research funding, but it can be used by startups or if you want to build a different ground. But yeah, passing document is interesting.

Speaker 1

Will it be open source? So everyone can

Speaker 2

I hope so

Speaker 1

goes with the reviewing.

Speaker 2

We are speaking for a long time with management about to be to have that disp available. We are extremely relevant on open source then on the sp Postgres on Docker on Django Python ZAI or Mistral besides they're not really open source but yeah then we speak a lot about it we may find ways where we could do that but it is At the moment the universities see it as a competitive advantage and then it is why it is yeah

Speaker 4

One of the interesting and challenging things when working with LLMs is the guardrails and the classic classifiers.

Speaker 2

Yes.

Speaker 4

Did you manage to go through? I know the answer would be quite verbose, but just if you can some sum up. How did you manage to work with classifiers and guard

Speaker 2

Then to answer how to manage the output of the LLM and the setting up guide rails and the type of AI system we work with than LLM but other type of classifier. In the guide race we are lucky in a way that we it's unlikely that a scientist put some weird prompt in their own document they don't gain anything from it. The people that can access the web app need to be the a member of SDU. Then we are protected in a way against misuse of it there is a feedback as well from the user by the research reporter before handing it back out. into the tests that have been done by the

it is in testing phase at the moment and we haven't seen any outside of the edge case i showed you there's no much problem now for other types of algorithms you probably are thinking of Jeff that that is a kind of did a buzz this past two weeks. where you can use some of these LLMs that are twisted to be able to you be used as a classifier we use other type of classification algorithm like BERT, if you heard about it. Then the then In our team we do a lot of NLP, meaning that we try to use the most simple solution for a task.

Then when it comes to an algorithm that allows to do a classification of text There is often lighter algorithms that can run mainly on CPU, for example. Access to GPU can be challenging. But we are playing with it too a lot.

Speaker 1

All right. That came in here. Alright. But we did yeah so we'll have we'll have some another short break for coffee at some point. But we're going to switch over to lightning talks immediately. Let's give Lionel a big applause.

Speaker 2

Thank you so much.