Provider-agnostic AI features for Decidim. Currently supports summarization via OpenAI, DeepSeek, Anthropic Claude, and Ollama (self-hosted).
From RubyGems (once published):
gem "decidim-aixd"From a local path (during development):
gem "decidim-aixd", path: "path/to/decidim-modules/decidim-aixd"From GitHub:
gem "decidim-aixd", github: "aixdesign/decidim-module-aixd"Then run:
bundle installCreate config/initializers/decidim_aixd.rb:
OpenAI
Decidim::AIXD.configure do |config|
config.default_provider = :openai
config.providers = {
openai: {
api_key: ENV["OPENAI_API_KEY"],
model: "gpt-4o" # optional, defaults to gpt-4o
}
}
endDeepSeek
Decidim::AIXD.configure do |config|
config.default_provider = :deepseek
config.providers = {
deepseek: {
api_key: ENV["DEEPSEEK_API_KEY"],
uri_base: "https://api.deepseek.com/v1",
model: "deepseek-chat" # required — DeepSeek does not support gpt-4o
}
}
endAnthropic Claude
Decidim::AIXD.configure do |config|
config.default_provider = :anthropic
config.providers = {
anthropic: {
api_key: ENV["ANTHROPIC_API_KEY"]
}
}
endOllama (self-hosted)
Decidim::AIXD.configure do |config|
config.default_provider = :ollama
config.providers = {
ollama: {
base_url: "http://localhost:11434", # optional, this is the default
model: "llama3.2" # optional, this is the default
}
}
endDecidim::AIXD::Summarize.call(text: "Your long text here...") do
on(:ok) { |summary| puts summary }
on(:error) { |msg| puts "Error: #{msg}" }
endOptional parameters:
Decidim::AIXD::Summarize.call(
text: "Your long text here...",
locale: :ca, # target language for the summary (default: I18n.locale)
max_length: 500, # character cap (default: none)
prompt: "Be brief." # custom instruction prepended to the default prompt
)A summarization form is available at /aixd/summarize once the engine is mounted.
Once the module is proven and mature, different integration strategies will be considered:
- Merge into decidim-ai — contribute this module's functionality into the core
decidim-aigem, subject to community approval. - Keep it separate — continue developing AI + Design enhancements independently, outside the Decidim core module ecosystem.
- Join forces — identify other modules tackling similar problems and combine efforts.
- Ruby >= 3.0
- Decidim >= 0.28.0, < 0.32.0