There are $2024$ people, which are knights and liars and some of them are friends. Every person is asked for the number of their friends and the answers were $0,1, \ldots, 2023$. Every knight answered truthfully, while every liar changed the real answer by exactly $1$. What is the minimal number of liars? 
1. **Restate the problem in graph theory terms**:
   - We have a simple graph \( G \) with 2024 vertices.
   - Each vertex represents a person, and the degree of each vertex represents the number of friends that person has.
   - Knights tell the truth about their number of friends, while liars change their answer by exactly 1.

2. **Define the degrees**:
   - Let \( d_1 \le d_2 \le \ldots \le d_{2024} \) be the degrees of the 2024 vertices.
   - The problem is to find the minimal number of liars, which translates to minimizing the sum of the absolute differences between the reported degrees and the actual degrees.

3. **Formulate the problem**:
   - We need to minimize \( \sum_{i=1}^{2024} |d_i - (i-1)| \).
   - This sum represents the total discrepancy between the reported degrees and the actual degrees.

4. **Analyze the discrepancy**:
   - The discrepancy for each knight is 0 because they tell the truth.
   - The discrepancy for each liar is 1 because they change their answer by exactly 1.

5. **Calculate the minimal number of liars**:
   - To minimize the sum \( \sum_{i=1}^{2024} |d_i - (i-1)| \), we need to consider the distribution of degrees.
   - The degrees \( d_i \) range from 0 to 2023.
   - The sum of the first 1012 degrees (0 to 1011) is \( \sum_{i=0}^{1011} i = \frac{1011 \cdot 1012}{2} = 511566 \).
   - The sum of the last 1012 degrees (1012 to 2023) is \( \sum_{i=1012}^{2023} i = \frac{(2023 \cdot 2024)}{2} - \frac{(1011 \cdot 1012)}{2} = 2049276 - 511566 = 1537710 \).

6. **Calculate the total discrepancy**:
   - The total discrepancy is \( \sum_{i=1}^{2024} |d_i - (i-1)| \ge (1012 + 1013 + \ldots + 2024) - (0 + 1 + \ldots + 1011) + \sum_{i=1}^{1012} d_i - \sum_{j=1013}^{2024} d_j \).
   - Simplifying, we get \( \sum_{i=1}^{2024} |d_i - (i-1)| \ge 1012^2 - 2 \cdot E(K_{1012}) = 1012 \).

7. **Construct the graph**:
   - In graph \( G \), there exists an edge between \( v_i \) and \( v_j \) if and only if \( i + j \ge 2025 \).
   - This construction ensures that the degrees are distributed in such a way that the minimal number of liars is achieved.

8. **Conclusion**:
   - The minimal number of liars is 1012.

The final answer is \(\boxed{1012}\).