This depends on the type of diabetes you have and the medication you are using, if any, to control your blood sugar levels.
Type 1 diabetes: DO NOT USE KETOGENIC DIETS
Type 2 diabetes: Ketogenic diets are safe for most people with recently diagnosed type 2 diabetes controlled on diet and lifestyle.
If you have started medication, this will usually initially be metformin, which is not a contraindication for starting a keto diet. However, your doctor will probably have to reduce the dose as the diet itself brings your blood sugar levels under control.
Patients with type 2 diabetes who have been started on other blood-sugar-lowering medication (eg. insulin, sulphonylureas, SGLTs inhibitors) MUST NOT initiate a ketogenic diet without speaking to their doctor, as the medication will need to be changed.

