Config folder
A config in NeMo Guardrails is the set of files that describe one guarded assistant: config.yml for the model, instructions and rails, and .co files for the Colang rules.
Last updated: 30 Sep, 2026 · NeMo Guardrails 0.24.1
The keyword guard lived inside the application. NeMo moves the rules into files, so they can be read, reviewed and changed without touching Python.
In the clip, the app imports RailsConfig and LLMRails. RailsConfig takes the rules, the Colang content and the YAML content; LLMRails hands those rules to the model. The app builds the config from two strings with RailsConfig.from_content.
Syntax:
config = RailsConfig.from_path("config") # a folder: config.yml + any .co files
config = RailsConfig.from_content( # or two strings, as in the video
colang_content=COLANG, yaml_content=YAML)
rails = LLMRails(config) # the runtime that applies themThe folder
A config folder holds config.yml and any number of .co files, whose names are yours. Later lessons add config.py for Python the folder needs, and prompts.yml for prompts. This course keeps the files in the current folder and loads it with from_path(".").
my_assistant/
config.yml # model, instructions, which rails run
rails.co # Colang: define user / bot / flow
main.py # your code: RailsConfig.from_path(".")config.yml
The model entry and the video's instructions for the IT assistant. The next two lessons explain each block.
models:
- type: main
engine: openai
model: openai/gpt-oss-120b
api_key_env_var: GROQ_API_KEY
parameters:
base_url: https://api.groq.com/openai/v1
temperature: 0
instructions:
- type: general
content: |
You are an Enterprise IT Assistant specialising in Kubernetes,
Intel hardware, and enterprise networking.
Only answer questions about these topics.
Answer in one or two short sentences.Loading the folder
from nemoguardrails import RailsConfig
config = RailsConfig.from_path(".")
print(config.models[0].engine, config.models[0].model)
print(config.instructions[0].content.splitlines()[0])
print(config.colang_version)openai openai/gpt-oss-120b You are an Enterprise IT Assistant specialising in Kubernetes, 1.0
What was loaded
- The model: engine
openai, modelopenai/gpt-oss-120b. - The instructions, read from the YAML block.
- Colang 1.0, the version this course uses. It is the default when
colang_versionis not set.
Loading the same config from a string
The video's notebook and app use from_content with YAML and Colang held in Python strings, which is handy in a notebook. The result is the same object.
from nemoguardrails import RailsConfig
YAML_BASE = open("config.yml").read()
config = RailsConfig.from_content(yaml_content=YAML_BASE)
print(config.models[0].model)
print(config.rails.input.flows)openai/gpt-oss-120b []
[] is the list of input rails: none yet. The first one arrives in Input rails.
from_path vs from_content
| from_path | from_content | |
|---|---|---|
| Rules live in | Files in a folder | Python strings |
| Good for | Applications, code review, the server | Notebooks and quick tests |
| Python actions | config.py in the folder loads itself | Registered by hand |
Where each fits
- A notebook experiment, as the video's notebook builds one config per experiment with
from_content. - An application or the NeMo server, which reads folders.
from_path reads every .yml and .co file in the folder. A stray .co file left from an experiment is loaded too, and its flows run.Related
- Previous: Blocking a message with an if
- Next: Main model and API key
- Reference: Configuration overview
- Add
colang_version: "2.x"to config.yml and printconfig.colang_version. - Rename config.yml to settings.yml and load the folder again.
This is what real progress feels like.