# Where to Find OpenMed Example Configurations: A Complete Guide to Setup Files

> Find OpenMed example configurations easily. This guide shows how to locate TOML setup files in the openmed/profiles directory and initialize your environment with config.toml.example.

- Repository: [Maziyar Panahi/openmed](https://github.com/maziyarpanahi/openmed)
- Tags: how-to-guide
- Published: 2026-06-13

---

**OpenMed stores its example configurations as TOML files in the `openmed/profiles/` directory and ships a root-level `config.toml.example` that you can copy to `~/.config/openmed/config.toml` to initialize your environment.**

The maziyarpanahi/openmed repository provides ready-to-use configuration templates that demonstrate how to structure the medical NLP library for different deployment scenarios. These OpenMed example configurations control critical runtime parameters—including device selection, authentication tokens, and logging levels—through a profile-based system defined in the source code.

## Configuration Reference and Schema

The authoritative definition of all supported configuration keys resides in **[`openmed/core/config.py`](https://github.com/maziyarpanahi/openmed/blob/main/openmed/core/config.py)**. This module contains the `OpenMedConfig` class, which specifies valid fields including `default_org`, `cache_dir`, `device`, `hf_token`, `log_level`, `timeout`, `use_medical_tokenizer`, `medical_tokenizer_exceptions`, `backend`, and `profile`. The file also defines `PROFILE_PRESETS`, which supplies fallback default values when specific keys are omitted from user-defined configuration files.

For detailed explanations of each field and advanced setup scenarios, consult **[`docs/configuration.md`](https://github.com/maziyarpanahi/openmed/blob/main/docs/configuration.md)** in the repository root. This documentation walks through the complete configuration layout and profile inheritance mechanism.

## Pre-Built Profile Templates

The repository ships three environment-specific profiles in the **`openmed/profiles/`** directory that you can copy directly into your local configuration:

### Development Profile ([`dev.toml`](https://github.com/maziyarpanahi/openmed/blob/main/dev.toml))

Located at **[`openmed/profiles/dev.toml`](https://github.com/maziyarpanahi/openmed/blob/main/openmed/profiles/dev.toml)**, this example enables debug-level logging and extended timeouts. It is optimized for local development workflows where verbose output and longer execution windows facilitate troubleshooting.

### Production Profile ([`prod.toml`](https://github.com/maziyarpanahi/openmed/blob/main/prod.toml))

The **[`openmed/profiles/prod.toml`](https://github.com/maziyarpanahi/openmed/blob/main/openmed/profiles/prod.toml)** file provides deployment-ready settings with warning-level logging and shorter timeouts. This configuration minimizes log volume and ensures strict timeout enforcement for production workloads.

### Test Profile ([`test.toml`](https://github.com/maziyarpanahi/openmed/blob/main/test.toml))

Found at **[`openmed/profiles/test.toml`](https://github.com/maziyarpanahi/openmed/blob/main/openmed/profiles/test.toml)**, this minimal configuration demonstrates how to disable the medical tokenizer toggle via the `use_medical_tokenizer` key. The project's test suite uses this profile to ensure deterministic behavior during automated testing.

## The Root Configuration Template

The **`openmed/config.toml.example`** file serves as the master template for the main configuration file. You should copy this file to `~/.config/openmed/config.toml` (or the path specified by the `OPENMED_CONFIG` environment variable) to establish your base settings. This top-level file determines which profile is active by default and can override any values defined in the built-in presets.

## How Configuration Loading Works

When you import OpenMed, the **`openmed.core.config.get_config()`** function automatically searches for the configuration file at **`~/.config/openmed/config.toml`** by default. You can override this location by setting the **`OPENMED_CONFIG`** environment variable to point to a specific file path.

The system supports profile activation through two mechanisms: setting the **`OPENMED_PROFILE`** environment variable (e.g., `export OPENMED_PROFILE=dev`), or programmatically calling **`OpenMedConfig.from_profile("<name>")`** in your Python code. The loader searches for profile files in the `profiles/` subdirectory within your configuration directory and applies them over the base configuration.

## End-to-End Implementation Examples

To observe how these configurations integrate into working applications, examine the example scripts that demonstrate the complete initialization flow:

- **[`examples/privacy_filter_unified.py`](https://github.com/maziyarpanahi/openmed/blob/main/examples/privacy_filter_unified.py)** demonstrates loading a configuration and executing inference pipelines
- **[`examples/privacy_filter_studio/app.py`](https://github.com/maziyarpanahi/openmed/blob/main/examples/privacy_filter_studio/app.py)** shows a web application implementation that reads configuration files and applies active profiles at runtime

These scripts automatically detect the configuration directory and initialize the OpenMed runtime with the specified device, logging, and tokenizer settings.

## Quick Start: Copy and Configure

Set up your local environment by copying the bundled example files and selecting a profile:

```bash

# Create the configuration directory structure

mkdir -p ~/.config/openmed/profiles

# Copy the example configuration to the default location

cp openmed/config.toml.example ~/.config/openmed/config.toml

# (Optional) Copy a specific profile configuration

cp openmed/profiles/dev.toml ~/.config/openmed/profiles/

# Activate the profile via environment variable

export OPENMED_PROFILE=dev

# Run an example script

python examples/privacy_filter_unified.py

```

## Summary

- OpenMed uses TOML configuration files stored in `~/.config/openmed/` by default, controlled by the `OpenMedConfig` class in [`openmed/core/config.py`](https://github.com/maziyarpanahi/openmed/blob/main/openmed/core/config.py)
- Three ready-to-use environment profiles are available: [`dev.toml`](https://github.com/maziyarpanahi/openmed/blob/main/dev.toml), [`prod.toml`](https://github.com/maziyarpanahi/openmed/blob/main/prod.toml), and [`test.toml`](https://github.com/maziyarpanahi/openmed/blob/main/test.toml) in the `openmed/profiles/` directory
- Copy `openmed/config.toml.example` to `~/.config/openmed/config.toml` to establish your base configuration
- Activate specific profiles using the `OPENMED_PROFILE` environment variable or the `OpenMedConfig.from_profile()` method
- Example scripts in `examples/` demonstrate complete configuration loading and model execution workflows

## Frequently Asked Questions

### Where does OpenMed look for configuration files by default?

OpenMed searches for [`config.toml`](https://github.com/maziyarpanahi/openmed/blob/main/config.toml) in the `~/.config/openmed/` directory. You can override this location by setting the `OPENMED_CONFIG` environment variable to point to a specific file path on your system.

### What is the difference between the dev and prod profiles?

The [`dev.toml`](https://github.com/maziyarpanahi/openmed/blob/main/dev.toml) profile configures debug-level logging and extended timeouts to facilitate troubleshooting during local development. In contrast, [`prod.toml`](https://github.com/maziyarpanahi/openmed/blob/main/prod.toml) uses warning-level logging and shorter timeouts to optimize performance and reduce log volume in production deployments.

### How do I activate a specific configuration profile?

You can activate a profile by setting the `OPENMED_PROFILE` environment variable to the profile name (e.g., `export OPENMED_PROFILE=dev`), or programmatically by calling `OpenMedConfig.from_profile("dev")` in your Python code. The system loads the corresponding TOML file from the `profiles/` subdirectory.

### Can I use the medical tokenizer without loading a configuration file?

While OpenMed provides built-in defaults through `PROFILE_PRESETS` in [`openmed/core/config.py`](https://github.com/maziyarpanahi/openmed/blob/main/openmed/core/config.py), you must explicitly set `use_medical_tokenizer` in a configuration file or profile to control this feature. The [`test.toml`](https://github.com/maziyarpanahi/openmed/blob/main/test.toml) example shows how to disable it, while production configurations typically enable it for specialized medical text processing.