Two years ago, the jazz scene was reeling: Bohemian Caverns, a U Street landmark that had played host to Duke Ellington, Miles Davis and Ramsey Lewis, closed in March 2016, beset by financial problems. The grottolike basement was a central part of the city's jazz community, and its demise was the culmination of a multiyear run of bad news in local jazz.

The Black Fox Lounge, Cafe Nema, U-topia and HR-57 had all disappeared. Capital Bop's D.C. Jazz Loft, a series dedicated to stripped-down performances, was gentrified out of a series of venues. The restored Howard Theatre, where Ellington and Count Basie played, cut most of its jazz programming as its financial woes soared, and the Atlas Performing Arts Center scaled back jazz performances.

Now, after much hand-wringing about the state of local jazz, musicians are talking about Washington's jazz clubs with a new sense of optimism. But some things have changed: The scene has evolved significantly, with smaller venues in the District and its surrounding suburbs helping to fill the void of Bohemian Caverns and other lost venues. Musicians are exploring opportunities beyond the usual hot spots, playing Saturday night gigs in the basement bar at the Graham Hotel in Georgetown, or taking the stage at Alice's Jazz and Cultural Society, an all-ages, alcohol-free spot in Brookland.

The scene is "more dispersed," says Will Stephens, a drummer who runs the popular D.C. Jazz Jam at the Brixton, a freewheeling weekly session that attracts more than 20 performers in any given gathering. "But there are more venues and more opportunity."

Of course, the staples have never abandoned jazz. On Monday, the Bohemian Caverns Jazz Orchestra marked the release of its new album, "Bohemiana" — featuring original songs and new arrangements by longtime pianist Dan Roberts — at Blues Alley, the celebrated club that has showcased the genre in Georgetown for more than 60 years. Twins Jazz has been a fixture on U Street since 2000, even if some musicians grumble that out-of-towners get better slots than locals. The Kennedy Center, under the leadership of Jason Moran, the artistic director for jazz, brings stellar talent to its KC Jazz Club. The Westminster Church in Southwest Washington continues to offer concerts and fish fries on Friday nights, as it has for two decades.

But the Bohemian Caverns Jazz Orchestra is playing venues as far-flung as the Arc of Southeast Washington and the Levine School of Music in Silver Spring instead of relying on the familiarity of their long-running Monday night spot at the Caverns. "Everyone knew where to find us," says saxophonist Brad Linde, the co-founder of the Bohemian Caverns Jazz Orchestra. "Now, it's 'Go to a website which hopefully is up to date.' "

Other musicians, such as saxophonist Herb Scott, have taken it upon themselves to find new gigs at restaurants. The music draws customers in, allowing them to see the next generation of jazz musicians, often for no cover charge. "Restaurants realized it's a competitive advantage to have live jazz," says Scott, the founder of the nonprofit Capitol Hill Jazz Foundation and a fixture around the city's venues.

In the 14th Street NW area, for example, Omrao Brown, who owned the Caverns, books shows at Sotto, a basement lounge underneath Ghibellina on 14th Street's restaurant row. The venue rebooted itself last year to feel more like a jazz club and now brings in some of the area's best young trios and quartets. Marvin, at 14th and U streets NW, home to popular DJ dance parties, began hosting live music on its first floor in November. Now jazz, R&B and funk acts — including the Elijah Jamal Balbed Quartet, Sin Miedo, Kris Funn and Cornerstore — are featured on the small stage.

The one downside for musicians, of course, is that the food and drinks can be as much of an attraction as the music. While musicians appreciate the exposure, Scott says, "at the same time, a lot of the younger, emerging artists are not satisfied being background musicians."

Music venues outside the established jazz neighborhoods are picking up slack. College Park's MilkBoy ArtHouse finds room for jazz musicians as part of a monthly "visiting artist" series, amid its schedule of Sublime tribute bands and amateur comedy nights. Saxophonist Sarah Hughes, who performs at Sotto and other venues in the region, says she feels at home playing experimental jazz at Rhizome, an arts space in Takoma, which often has jazz-focused lineups. "I feel so supported by the people who book the space and by the audience who listens so very sensitively," she says.

Jazz lovers can still tune into jam sessions at Mr. Henry's on Capitol Hill on Wednesdays or at the Brixton on Sundays, where musicians can hone their chops. Any Sunday night, in the U Street pub's cozy second-floor bar, you might see nervous musicians taking the stage for the first time, then hear Scott trading host solos with well-known saxophonists Balbed and Fred Foss.

Stephens, who launched the D.C. Jazz Jam at the now-closed Dahlak in 2009, says he sought to make the event "welcoming, whether you're a student learning, or a hobbyist, or a performing musician."

Most musicians see such efforts as a sign that things are continuing to look up.

"It ebbs and flows," says Linde, of the Bohemian Caverns Jazz Orchestra. "But it's starting to come back."

If you go

The Alex, in the Graham Hotel: 1075 Thomas Jefferson St. NW. Live music Saturday from 8 to 11 p.m.

Blues Alley : 1073 Wisconsin Ave. NW.

The Brixton : 901 U St. NW. Jam session Sunday from 6:30 to 9:30 p.m.

Epicure : 11104 Lee Hwy., Fairfax. Live jazz on Sunday nights, jam session on third Sunday of the month.

Marvin : 2007 14th St. NW. Live music Wednesday through Saturday and holiday Sundays.

MilkBoy ArtHouse : 7416 Baltimore Ave., College Park.

Mr. Henry's : 601 Pennsylvania Ave. SE. Jam session on Wednesday, live jazz on Friday and Saturday.

Rhizome : 6950 Maple St. NW.

Sotto : 1610 14th St. NW. Live music Tuesday through Saturday. $15 cover most Friday and Saturday performances.

Twins Jazz : 1344 U St. NW.