The engine allows you to import your own model directly and prepares the environment based on your specifications. You can then use the model within the decision flow to support decision-making process. If you’ve trained your machine learning model in Python, Julia or R, you can import it into Decisimo, and use it to generate scores within decision flow.

Licensing: importing your own model is a licensed capability. If the Own model option is not offered when you create a model, it is not included in your plan -- LLM models remain available to everyone. Contact support to have it enabled.

The quick guide

  1. Dump your model to pickle file.
  2. Models → Add model.
  3. Define Python version, libraries, upload model.
  4. Define input variables and which fields from the data object shall be used.
  5. Press Save or CTRL+S key shortcut and wait for the model to be prepared.
  6. Add it to your decision flow.

Preparing your model

Your trained model must first be dumped in order to be imported and used in a decision flow.
Let's assume that you have a variable model with your trained (fitted) model.
Import pickle and export the model as a file in your preferred Python environment at this time.

import pickle with open(r'model.pkl' ,'wb') as f:   pickle.dump(model, f)

Once you have the pickle file, it is ready for import.

Importing your model

You must specify a few details when adding a model, including which Python version to use and which libraries to import.

Following are the input variables your model will use to make predictions. Define the data types of the variables and specify them in the order that your model anticipates. Failure will occur if the data types are incompatible.

There are three columns for each variable when defining it. the name, data type, and value mapping of the variable.

  • The variable name is only used within the Decisimo portal.
  • The data type is necessary to make sure python does not throw an exception.
  • Value mapping defines the attribute from the data object to use for model evaluation.

The engine will take the mapped value from the data object, force it to the specific data type, and pass it to your model.

How values are read

A value is read into a model input the same way rules, decision tables and scorecards read it. One value cannot mean two things inside one decision.

Input typeWhat is acceptedNotes
NUMBER, INTEGERplain numbers, numbers as text, thousands separators in either convention (1,234.50 and 1 234,50), currency codes and symbols, accounting negatives (1 234,50) = -1234.50, percentages, scientific notationtrue / false as text arrive as 1 and 0, the same as a real boolean. A value beyond the integer range is capped at the maximum rather than wrapping to a negative.
DATEISO dates and datetimes with or without a time zone, common local formats, a plain 4-digit year, Unix timestamps in seconds, and Java-style millisecond timestampsDates are read in UTC, so a run gives your model the same instant in testing as in production. A value that is not a date arrives as false.
STRINGany single value, trimmedLists and objects arrive as empty text.

Two things are worth knowing because they are easy to get wrong:

  • A list or an object is not a single value. If a mapping points at a whole node, or at a wildcard that matched several entries, a numeric input receives 1, and a text input receives empty text. Point the mapping at one value.
  • A date is not a number. A date reaching a NUMBER input is not converted to anything sensible, because there is no sensible answer. Map dates to DATE inputs.

Once you hit “save model”, the system will start preparing the environment for it. It may take a minute for it to be finished and ready for use.

StatusInformation
PREPARINGThe platform is preparing an environment for your model. It cannot be used in decision logic yet.
READYThe environment is ready and you can start using your model for decision logic.
FAILEDThe preparation of the environment for your model has failed.

prediction = model.predict_proba(data)

prediction = prediction.tolist()

return jsonify(prediction)

Testing the model

Once the model is ready to use, you can test it by the following 2 ways:

  1. Unit test: when testing, it shows which value to provide. After passing testing values and hitting the “Run test”, you can see whether the model works as expected.

  1. Object test: when doing object test, you need to select a data object and then run a test.

LLM Models

In addition to traditional machine learning models, Decisimo supports Large Language Model (LLM) integration. LLM models allow you to leverage AI services like OpenAI, Azure OpenAI, Google Gemini, Anthropic Claude, and other OpenAI-compatible providers (DeepSeek, Mistral, etc.) directly within your decision flows.

Creating an LLM Model

  1. Navigate to Models → Add model
  2. Select LLM as the model type
  3. Configure your LLM service connection
  4. Define your prompt template and variables
  5. Save the model

LLM Service Configuration

Before using an LLM model, you need to configure an LLM service. Each service requires:

FieldDescription
Service TitleHuman-readable name for the service
Service NameUnique identifier used internally
Endpoint URLThe API endpoint for the LLM provider
API TypeThe provider type (see supported providers below)
Default Model NameThe model to use (e.g., gpt-4o, claude-sonnet-4-20250514)
API KeyYour authentication key for the service

Supported API Types

API TypeProviderExample Endpoint
OpenAIOpenAI, DeepSeek, Mistral, and other OpenAI-compatible APIshttps://api.openai.com/v1/chat/completions
AzureAzure OpenAI Servicehttps://{resource}.cognitiveservices.azure.com/openai/deployments/{deployment}/chat/completions?api-version=2024-12-01-preview
GeminiGoogle Geminihttps://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent
AnthropicAnthropic Claudehttps://api.anthropic.com/v1/messages

Prompt Template

The prompt template defines what you send to the LLM. Use double curly braces {{variable_name}} to insert dynamic values from your data object:

Analyze the following customer application:
- Income: {{income}}
- Employment: {{employment_status}}
- Credit Score: {{credit_score}}

Provide a risk assessment.

LLM Variables

Define variables that map data from your input object to the prompt template:

Variable NameMappingDescription
income$.input.annual_incomeMaps the income field
employment_status$.input.employmentMaps employment status
credit_score$.input.scoreMaps credit score

Output Configuration

  • Output Attribute: JSON path where the LLM response is stored (e.g., $.output.llm_result)
  • Output Format: Optional JSON schema to validate/structure the response

How Output Format Works

When you define an Output Format schema, the engine automatically appends it to your prompt to guide the LLM's response structure. This ensures consistent, parseable JSON output across all supported providers (OpenAI, Gemini, Anthropic, Azure, etc.).

For example, if your prompt template is:

Analyze this customer and assess their risk level.
Customer age: {{age}}
Customer income: {{income}}

And your output format schema is:

{
  "risk_level": "string",
  "score": "number",
  "reasons": ["string"]
}

The engine will send the following combined prompt to the LLM:

Analyze this customer and assess their risk level.
Customer age: 35
Customer income: 75000

Respond with a valid JSON object matching this exact structure:
{
  "risk_level": "string",
  "score": "number",
  "reasons": ["string"]
}

This approach:

  • Works consistently across all LLM providers
  • Guides the model to return properly structured JSON
  • Enables automatic response parsing and validation
  • Allows you to use the structured output in downstream decision logic

Advanced Configuration

ParameterDescriptionDefault
TemperatureControls randomness (0 = deterministic, 1 = creative)0.7
Max TokensMaximum length of the response500
Top PNucleus sampling parameter1.0
Frequency PenaltyReduces repetition of tokens0.0
Presence PenaltyEncourages new topics0.0
TimeoutRequest timeout in seconds60

Parallel Execution

For improved reliability and consensus-based responses, you can configure parallel LLM calls:

ParameterDescription
Number of Parallel CallsHow many concurrent requests to make (1-10)
Consensus StrategyHow to select the final response
Min Consensus CountMinimum matching responses required
Consensus ThresholdSimilarity threshold for matching

Consensus Strategies

  • Majority: Select the response that appears most frequently
  • Unanimous: All responses must match
  • First: Use the first successful response
  • Most Complete: Use the longest/most detailed response
  • Best Quality: Score responses by completeness and structure

Using LLM in Decision Flows

Once your LLM model is saved, add it to your decision flow like any other model. The LLM response will be available at the configured output path for use in subsequent decision logic.

Performance Considerations

LLM calls are typically slower than rule-based logic. Consider:

  • Using webhook endpoints for long-running LLM operations (no timeout)
  • Setting appropriate timeout values based on your provider
  • Using parallel execution for critical decisions requiring consensus

Credentials

Fields that take an API key, token or password offer the credentials stored under Admin Center → Credentials. Pick one and the configuration keeps a reference (secret:openai_main) rather than the value.

You can still type a value in directly. It is taken into the vault when you save, and the field is left holding the reference — the credential itself never ends up in the stored configuration, an export or a release.