Inclusion Criteria:  Histologically or cytologically confirmed malignant peritoneal mesothelioma for which there has been no prior treatment. Given the indolent nature of well-differentiated papillary mesothelioma and multicystic mesothelioma, patients with these variants are not eligible for participation  All slides including performed immunostains from diagnostic tumor tissue together with pathology report for retrospective central pathology review Must have measurable disease per RECIST version (v) 1.1 Not pregnant and not nursing, because this study involves an agent that has known genotoxic, mutagenic and teratogenic effects. Therefore, for women of childbearing potential only, a negative pregnancy test done =< 28 days prior to registration is required Age >= 18 years Eastern Cooperative Oncology Group (ECOG) performance status 0-1 Leukocytes >= 2,500/mm^3 Absolute neutrophil count (ANC) >= 1,500/mm^3 Platelet count >= 100,000/mm^3 Creatinine clearance >= 45 mL/min/1.73 m^2 for patients with creatinine levels above institutional normal Total bilirubin =< 1.5 x upper limit of normal (ULN) Aspartate aminotransferase (AST) / alanine aminotransferase (ALT) =< 3.0 x upper limit of normal (ULN) Urine protein:creatinine (UPC) ratio < 1, or urine protein: =< 1+ No prior systemic therapy for peritoneal mesothelioma is allowed. No concurrent radiotherapy is allowed  No active or history of autoimmune disease or immune deficiency, including, but not limited to, myasthenia gravis, myositis, autoimmune hepatitis, systemic lupus erythematosus, rheumatoid arthritis, inflammatory bowel disease, antiphospholipid antibody syndrome, Wegener granulomatosis, Sjogren syndrome, Guillain-Barre syndrome, or multiple sclerosis, with the following exceptions:  Patients with a history of autoimmune-related hypothyroidism who are on thyroid-replacement hormone are eligible for the study Patients with controlled Type 1 diabetes mellitus who are on an insulin regimen are eligible for the study  Patients with eczema, psoriasis, lichen simplex chronicus, or vitiligo with dermatologic manifestations only (e.g., patients with psoriatic arthritis are excluded) are eligible for the study provided all of following conditions are met:  Rash must cover < 10% of body surface area Disease is well controlled at baseline and requires only low-potency topical corticosteroids No occurrence of acute exacerbations of the underlying condition requiring psoralen plus ultraviolet A radiation, methotrexate, retinoids, biologic agents, oral calcineurin inhibitors, or high-potency or oral corticosteroids within the previous 12 months No history of idiopathic pulmonary fibrosis, organizing pneumonia (e.g., bronchiolitis obliterans), drug-induced pneumonitis, or idiopathic pneumonitis, or evidence of active pneumonitis on screening chest computed tomography (CT) scan No prior allogeneic stem cell or solid organ transplantation Central nervous system (CNS) metastases must have been treated with local therapy (surgery, radiation, ablation) with systemic steroids tapered to a physiologic dose (10 mg or prednisone equivalent or less) Patients who have received live attenuated vaccines within 30 days of the first dose of trial treatment are eligible at the discretion of the investigator. All seasonal influenza vaccines and vaccines intended to prevent SARS-CoV-2 and coronavirus disease 2019 (COVID-19) are allowed No history of inadequately controlled hypertension (defined as systolic blood pressure > 150 mmHg and/or diastolic blood pressure > 100 mmHg) No history of hypertensive crisis or hypertensive encephalopathy No clinically significant cardiovascular disease, such as cerebrovascular accidents within 6 months prior to randomization, myocardial infarction within 6 months prior to randomization, unstable angina, New York Heart Association (NYHA) grade II or greater congestive heart failure (CHF), or serious cardiac arrhythmia uncontrolled by medication or potentially interfering with study treatment No clinically significant cardiovascular disease, such as cerebrovascular accidents within 12 months prior to randomization, myocardial infarction within 12 months prior to randomization, unstable angina, New York Heart Association (NYHA) grade II or greater CHF, or serious cardiac arrhythmia uncontrolled by medication or potentially interfering with study treatment No significant vascular disease (e.g., aortic aneurysm requiring surgical repair or recent arterial thrombosis) within 6 months prior to randomization No history of grade >= 4 venous thromboembolism No history or evidence upon physical or neurological examination of central nervous system No history of grade >= 2 hemoptysis (defined as >= 2.5 mL of bright red blood per episode) within 1 month prior to screening No history or evidence of inherited bleeding diathesis or significant coagulopathy at risk of bleeding (i.e., in the absence of therapeutic anticoagulation) No major surgical procedure or significant traumatic injury within 28 days prior to initiation of study treatment (diagnostic laparoscopy is allowed as part of diagnosing peritoneal mesothelioma) No core biopsy or other minor surgical procedure, excluding placement of a vascular access device, within 7 days prior to initiation of study treatment Placement of a vascular access device should be at least 2 days prior to initiation of study treatment No active infection requiring IV antibiotics at the time of initiation of study treatment No history of abdominal fistula, gastrointestinal (GI) perforation, intra-abdominal abscess, or active GI bleeding within 6 months prior to randomization No serious, non-healing wound, active ulcer, or untreated bone fracture No other malignancy within 5 years prior to randomization, except for localized cancer in situ, such as basal or squamous cell skin cancer Patients with a creatinine clearance between 45 and 79 mL/min should not use ibuprofen or other nonsteroidal anti-inflammatory drug (NSAIDs) for 2 days before, the day of, and 2 days following pemetrexed administration  No treatment with immunosuppressive medication (including, but not limited to, corticosteroids, cyclophosphamide, azathioprine, methotrexate, thalidomide, and anti-TNF-alpha agents) within 2 weeks prior to initiation of study treatment, or anticipation of need for systemic immunosuppressive medication during study treatment, with the following exceptions:  Patients who received acute, low-dose systemic immunosuppressant medication or a one-time pulse dose of systemic immunosuppressant medication (e.g., 48 hours of corticosteroids for a contrast allergy) may be eligible for the study Patients who received mineralocorticoids (e.g., fludrocortisone), corticosteroids for chronic obstructive pulmonary disease (COPD) or asthma, or low-dose corticosteroids for orthostatic hypotension or adrenal insufficiency are eligible for the study