The general recommendation I was given when I joined consulting was to stay for at least 2-3 years or until my first promotion to complete either the analyst or associate "programs" and get the full learning experience. Not sure to what extent it matters to tech firms though...
What ultimately matters is what you want to achieve in your career and to what extent can consulting help you get there. If you have a compelling offer in a sector where you see yourself in the future, why not go for it now? I see many people staying in consulting because the next level is "only" 1-2 years away, and the more time they have invested, the harder they find it to leave eventually.
2 pieces of advice though
- If you are no entirely sure yet, it might be worth taking some time off to reflect and not to make a rushed decision.
- If you have made the decision but haven't secured your next job yet, think about what you would want to get out of the experience in terms of knowledge, learning and connections in the remaining time.