GREELEY, Colo.  Health and law enforcement officials around the nation are scrambling to figure out how to regulate medical marijuana now that the federal government has decided it will no longer prosecute legal users or providers.

For years, since the first medical marijuana laws were passed in the mid-1990s, many local and state governments could be confident, if not complacent, knowing that marijuana would be kept in check because it remained illegal under federal law, and that hard-nosed federal prosecutors were not about to forget it.

But with the Justice Department’s announcement last week that it would not prosecute people who use marijuana for medical purposes in states where it is legal, local and state officials say they will now have to take on the job themselves.

In New Hampshire, for instance, where some state legislators are considering a medical marijuana law, there is concern that the state health department  already battered by budget cuts  could be hard-pressed to administer the system. In California, where there has been an explosion of medical marijuana suppliers, the authorities in Los Angeles and other jurisdictions are considering a requirement that all medical dispensaries operate as nonprofit organizations.