Neither the EPO nor the UPC are EU institutions. However, this does not make Brexit irrelevant to the UPC Agreement.
Firstly, Unitary Patents (which will be handled exclusively by the UPC) are a creature of EU law.
Secondly, the UPC will from time to time be called upon to apply EU law in the context of the cases before it (eg in connection with the Regulations governing SPCs or the Directives governing the "Bolar" exemption or the patentability of "biotech" subject matter).
Thirdly, the UPC Agreement itself specifies that the Participating Member States MUST be EU Member States. Hence the question over whether the UK's imminent departure from the EU will effectively kill the Agreement.
Finally, there is the question of whether it is possible for a court (such as the UPC) having an "international" character to preside over matters involving EU law. This is no laughing matter. To illustrate: there is no obvious way of forcing the EPO (another international institution) to respect EU law, and we have all seen how that has worked out (eg with breaches of the ECHR). It is therefore vitally important to ensure that the UPC is subject to adequate checks and balances. This necessarily involves considering how (or whether) the UPC is FORCED to follow judgements of the Court of Justice of the EU. At present, it is not clear which (if any) mechanisms could ensure this post-Brexit (or, in the alternative, whether the UPC will even be able to ask the CJEU to provide its opinion on points of EU law).