We extracted the start and end points in the link layer.
Can I buffer at the start and end points? (Size 0.001)
layer = iface.activeLayer()
for f in layer.getFeatures():
geom = f.geometry().asPolyline()
start_point = QgsPoint(geom[0])
end_point = QgsPoint(geom[-1])