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

Source: https://djangotv.com/videos/django-day-copenhagen/2026/lionel-jouvet-ai-that-plays-nice-building-a-privacy-first-grant-review-tool-django-day-2026/
Date: 2026-10-13
Speakers: Speaker 1, Speaker 2, Speaker 3, Speaker 4
Text: lightly edited for readability (verbatim on the page)

## Transcript

**Speaker 1:** [00:00] I think we should give Lionel a big round of applause. This will be the last full talk of the day before we have a lot of lightning talks after. So, super exciting remainder of the day. Yeah, let's give Lionel a big round of applause. Okay.

**Speaker 2:** [00:19] Then thank you very much for having me and having us. I'm going to speak to you today about how we can play nice with LLMs when we are working in a Django environment. I'm going to first remind you: two years ago, I did kind of—it was about what we were working on, Django Llama. You know that if you want to use an LLM locally, Ollama has been for a long time a good way to run your local LLMs. And now I'm going to show you what it is. First, I want to give you some context 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

[01:05] all working with Django in different projects. First, Louisa: she's a firewoman. When there is something that goes wrong, she's the first one in line to put the fire down. You know that guy, probably. The one that is shouting at the LLM there is Julien, and Julien is a full stack developer who has been producing a Django web app that is used by our university and many other universities in Denmark to match scientists with funding. And we have Alex with another full stack here, who has been developing on a Django framework, using React as well, a web app for the Mission Ocean for the EU.

[01:50] And Doulé has also been developing with Django another web app that is used by many young universities in the 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, 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

[02:36] amount of time trying to get money to do more research. To be able to help the scientists, we have teams that are research supporters who are helping them to fill out the grants to be able to get money. And we behind them are there to be able to help our research supporters, too, and our scientists, to make tools that are dedicated to that. And that is what I'm going to show you today with this problem. The problem for research supporters, as you can see here, is that we have to deal with a lot of different types of funding, national and European. In here, to give you an idea, these are all the deadlines through the year of European funding, meaning that scientists come to a research supporter

[03:22] 20 at a time, three weeks before the deadline. The deadline can become a dead end, and they're 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—read the whole document. They have to look at the money behind it. It's so many things to do. I wish I had a drawing to be able to show. Yes, more or less, it's that. They have to do a lot in a very narrow time. And the applications they get can be from someone that just started kind of a draft for an application to someone that has already been spending a lot of time on it.

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

[04:55] 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 on Microsoft, we don't depend on Amazon, we don't depend on anyone. Then it is all self-contained, kind of a sandbox. And that starts to be interesting for us when a scientist is applying for a grant. A lot of these applications contain some intellectual property, some kind of advanced work. And we're trying not to leak it, as you would if you use LLMs that are not based in the EU, that are not GDPR-compliant.

[05:41] And I don't know if you heard about it, but even people from—what's their name?—the guys that give surveillance tools to a lot of nations are complaining about the way these LLM providers are dealing with their data. Then even if they are complaining about it, imagine 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. LLMs are 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 where

[06:31] the use of LLMs is less dangerous when it comes to intellectual property. And what we want to maintain is automation. We don't want to take away the job of our colleagues. People that have been working in research support have developed expertise over many years. They know exactly the right feeling to add to a proposal, to an application. And our goal here is to give them help for things that are not developed enough yet, so they can just put their brainpower into the things that really will make a difference. I'm telling you a lot of words, but I think I'll be giving you an overview of what this app is, to be able to

[07:17] explain what we do. I don't have my slides. There. Then, as you can see in here, we are working, so you will see what we have: the dashboard from this eScience Center. You can see that we have access to compute, we have access to storage, and 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

[08:03] is the fact that you have this static where you can put all your CSS. If you have JavaScript, that is code in different pages, you can all store that on the site, in one place. Everything is clean, and it is really exciting for that. The color scheme, as you can see, I'm not a graphic designer. Yeah, but it runs. What is interesting in this tool is that it's aimed at 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, obviously, to be able to read through a proposal, we use LLMs.

[08:49] This platform can run either locally on a laptop in Docker, using Ollama and running the LLM locally, totally outside of any internet connection, 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 directly into UCloud, into our own secure environment. And to be able to do an analysis, you need to be able to define what the grant type will be. Then if you have an EU application or a DFF, what is the other...

[09:38] Why now do the LLMs come in different places in 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 a European programme. You can select some proposal. I'm going to select it in here. You give it a name, Toto. Vous pouvez choisir si vous voulez le retourner localement ou online. Enline est à l'autre de votre computer. Then you are going to parse the document.

[10:25] It can be a PDF—I hate PDF. It can be a Word document, it can be 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? As you know, LLMs have a strong limitation, and it's often the 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 limit and mitigate this problem of loss of memory, we break the document into different parts that allow us to use different agents that we

[11:11] develop ourselves, where you can give a different persona a different question. For example, this is what you see me doing just now. The impact section: I'm going to look at my impact 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 is that—what is difficult with Django, more like—LLMs can be very slow to do the processing. And if you take a normal, naive way, as I did at the beginning, I had a lot of problems with breakups because there was the disconnection

[11:57] with my API. And what is important, too, is that 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 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.

[12:42] I'm using Nginx and Gunicorn to manage the different people. Many people can connect to the app. Then when you go into the app, you're first going to meet your Nginx, which is going to give you load. And after that, you're going to ask for an analysis to be done, an API call to the LLM, and that will be sent to your Gunicorn and to the Celery at the back, which is Python that is dealing with it.

[13:28] What is interesting is that at the beginning I had a problem, and I was trying to find a way on the same zytophilic line for the people that do like beer. It's a bit like when you go into a pub, and then you've been given your load and you ask the chef, “Now have we got my LLM to analyze it?” And you just leave your beer on the stand and say, “Wait for one minute. I'm just going to the jet. I'm coming back.” The problem is that the API can take much longer. And the first thing that will happen is your Nginx 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...

[14:13] With it. And then, after you have gunicons that come back, 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. Later, your work has been corrupted; your database is not happy. And a way to deal with it, to be able to work in between these two different life spans in the system, is to be able to use the database to deal with this workflow. And it had been the reason why I did that. I wanted to have a simple system. I wanted to use Django.

[14:59] As only Django as possible, trying not to add other layers or libraries. And this is Nginx and Gunicorn, using the database to be able to manage the work at the back, which was very practical. The other thing, I think, for a lot of you, when you want to develop a 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 20 to 50 people at the same time working on it, never more than that. And with this framework, I am kind of comfortable with this technical choice. Then, when I go and load an—

[15:44] I load the PDF, for example, then I will wait until we get the return. The parsing can be done either locally, or we sometimes use the Mistral API to be able to have a much higher-quality optical character recognition, OCR. As you know, parsing 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.

[16:33] 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 a 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 these server-sent events, we can actually do other things while that is running in the background. That allows the user to have more interaction with the tool. We start to be able to be dependent on the—

[17:19] Result to come back. In the development of this web app, it had often been the case that when you develop such a system, you have—in French, we say cahier des charges—everything is written down: what type of workflow you need to use, what type of architecture. The development of this web app has been organic through time. There has been a lot of feedback between the scientists, the research supporters, and me, 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 was in the background. I told you at the beginning that two years ago, when we started to work on this project, the only API—

[18:08] That was available for LLMs was ChatGPT, an 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 in OpenAI user rights, or in the cloud or any other American platform. The only path I had was Ollama, to be able to run it locally, where I could control the different LLMs 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.

[18:54] And then, because one of the limits of these models is, if you give them a full load of code, they forget everything, but they don't have a memory for it. And what we've seen in the past two years in the evolution of this type of local LLM is local LLMs that have much better capacities, context windows that started to be of the order of 30,000, 50,000 tokens reliably. And one of the ones that started to get my attention was the one developed by IBM, Granite. I don't know if any of you used the advantage. No.

[19:39] Good. The advantage of this platform is that the LLM they developed was actually for production, so 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 we use APIs that are much more powerful: first was Mistral. 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. The capacities are very reduced. Two weeks ago, the e-Science Center surprised us by giving us free inference for employees. Then, when you are an employee at SDU, you are given enough inference—

[20:24] 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 use the model behind it, GLM-5.3, that you may have heard about, which 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 is to protect as much as we can the—

[21:10] 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 model, where we are sure about the quality and security. The problem is, yeah, you need GPU hardware. It is very slow and has a very limited context window. Otherwise, we use the UCloud LLMs and GLM-5.3 at the moment, but it's going to be updated with time, or the Mistral API if they improve their model, where—

[21:55] We have up to—I like your system. Then the speed is brilliant. We have almost 600, 700 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, compared to the use of it. Then we come back to the thing about the OCR. Then the second part of the project that is difficult is that these documents, as soon as you give a template to a scientist—

[22:42] —they're going to mix it, mess it up. Then you have a nicely organized document: well, it's a big title, then you put your text here, the bold—and it comes back broken. And usually a lot of people in administration like to deal with PDFs. Each time you try to parse a PDF, you finish with a huge amount of imperfection, meaning that you have to be very clever when you do your sectioning of your different parts. Regex is really—even a very clever regex structure will miss things. Then we came up with a more hybrid way to do it.

[23:28] And it had been the Achilles' heel 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 it. You take your text, you do your chunking, and so there is a different reason for that. When you are a scientist, you never believe one person. You need peer review of your work. Then if you submit your proposal to one person, it's one person.

[24:13] When five people tell you the same thing, then you start to believe them. And it's a bit what we did in this tool as well. We configured a lot of different agents, personalities that will be specialized for a particular area of the feedback. Then, once we have our chunking done, we are able to mitigate this problem of the 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 a human to make sure that it has been cut properly at the right place. What it means, then, without an image—

[24:59] Then it is that in this tool, if you found that there is a problem with the slicing, you can always go and re-slice it manually to be able to do it. And I haven't found a way around it yet. Very frustrating. And, again, how do we integrate the LLM into the construction of this tool? You don't want to spend hours to define a new grant type. Then I developed this grant type architect. And here you can give it a name. If you click Go, you do a Mistral search, and it will try to retrieve as much information about the criteria for the grant and the language of grants.

[25:45] In the EU, must, should, could doesn't mean the same thing for everyone. And it is really important to know all this 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 automation that has been done using LLMs 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 needs to have a kind of character. There is a base prompt that you need because you need to be able to input all the context about that grant in particular.

[26:31] You need to be able to define the landscape of what this grant is about. But then you want it to be more critical if it is for mathematics, biology, 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 the text to be coded for each one of the feedback points, and so on. And then we build an LLM in the background and another agent that helped to build these prompts. Then we see that within the framework of Django, we were able to integrate this LLM to help assist in developing this tool.

[27:16] And we need to be careful because, yes, you know, when you ask an LLM to do something, you rarely get the right thing out. Then there's a very strong push behind making sure that the output of this LLM is correct when it comes to these architects, either for making a new grant type or persona, to make sure that within the prompt we have a very strong constraint on the format of the output, and then a lot of safety and validation to make it work. Can it go wrong? Yes. But not only LLMs make mistakes—

[28:02] When it comes to text, some others do. That's not an LLM. It could be a lazy large man or something? Then nothing bad can happen. Only good can happen. Then the horror story I had is one I need to share. You know, LLMs are always complacent. They always tell you it's good, it's good. Then I ask the LLM 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 buzzwords. I don't know. It reads like a wish list. What is there in note?

[28:48] One advice: 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 Connor. It's very important that a user, before giving it back to the scientist to read through, knows it can be a bit rough sometimes. To finish, as I told you, the tech stack that has been used in this project is Django, as much Django as we can. Postgres, that is saving—

[29:34] That makes the day when it comes to interacting with an unreliable connection to an LLM 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 Ollama is needed. Once you have the app running on Docker, the only component you need outside is Ollama, which will be running your local LLM.

**Speaker 1:** [30:10] Yeah, right on time. Thank you. And also, sometimes time for questions. Let's—let's, there is a question.

**Speaker 3:** [30:25] This one is from me. Thanks for your talk. How specific is the tool to grant reviews? Is it applicable to other use cases? Or is it because it sounded like a lot of it was just stuff you have to do in a lot of other cases as well?

**Speaker 2:** [30:46] Tell me if I ask—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:** [31:01] No, I meant more for other use cases of document ingestion, where it's not at all grant-related, just the whole thing of parsing the different documents and putting it in sections and putting context, and just having a system that works with the documents.

**Speaker 2:** [31:22] Yes, okay. 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 formatting. The goal of this app is to target the research support service, but a lot of these components can be reused outside. It can be used as well, not only for research funding, but by startups or if you want to build a different grant. But yeah, parsing documents is interesting.

**Speaker 1:** [32:01] Will it be open source, so everyone can—

**Speaker 2:** [32:06] I hope so

**Speaker 1:** [32:07] —goes with the reviewing.

**Speaker 2:** [32:09] We are speaking with management about having that available. We are extremely reliant on open source: Postgres, Docker, Django, Python, AI, or Mistral, though they're not really open source. We speak a lot about it. We may find ways where we could do that, but at the moment the universities see it as a competitive advantage, and that is why it is, yeah.

**Speaker 4:** [32:53] One of the interesting and challenging things when working with LLMs is the guardrails and the classic classifiers.

**Speaker 2:** [33:02] Yes.

**Speaker 4:** [33:03] Did you manage to go through that? I know the answer would be quite verbose, but just, if you can, sum up: how did you manage to work with classifiers and guardrails?

**Speaker 2:** [33:17] Then, to answer how to manage the output of the LLM and the setting up of guardrails, and the type of AI system we work with—LLMs, but other types of classifiers as well. With the guardrails, we are lucky in a way that it's unlikely that a scientist puts some weird prompt in their own document; they don't gain anything from it. The people who can access the web app need to be a member of SDU. Then we are protected in a way against misuse of it. There is feedback as well from the user, the research reporter, before handing it back out. Into the tests that have been done by the—

[34:03] It is in the testing phase at the moment, and we haven't seen any—outside of the edge case I showed you, there's not much of a problem now. For other types of algorithms, you probably are thinking of Jeff, 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 used as a classifier. We use other types of classification algorithms, like BERT, if you've heard about it. In our team, we do a lot of NLP, meaning that we try to use the simplest solution for a task.

[34:48] Then when it comes to an algorithm that allows us to classify text, there are 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:** [35:11] All right, that came in here. All right. But we did, yeah. So we'll have 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:** [35:39] Thank you so much.
