Entropic 2.3.8
Local-first agentic inference engine
Loading...
Searching...
No Matches
classification.h File Reference

Auto-generated classification prompt for the router model. More...

#include <entropic/entropic_export.h>
#include <string>
#include <vector>
Include dependency graph for classification.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  entropic::prompts::TierDescriptor
 Lightweight tier descriptor for classification prompt building. More...
 

Namespaces

namespace  entropic
 Activate model on GPU (WARM → ACTIVE).
 

Functions

ENTROPIC_EXPORT std::vector< std::string > entropic::prompts::interleave_examples (const std::vector< TierDescriptor > &tiers)
 Round-robin interleave few-shot examples across tiers.
 
ENTROPIC_EXPORT std::string entropic::prompts::build_classification_prompt (const std::vector< TierDescriptor > &tiers, const std::string &message, const std::vector< std::string > &history={}, const std::vector< std::string > &recent_tiers={})
 Auto-generate classification prompt from tier focus + examples.
 

Detailed Description

Auto-generated classification prompt for the router model.

Ports Python's build_classification_prompt() and _interleave_examples().

Version
1.8.1

Definition in file classification.h.

Function Documentation

◆ build_classification_prompt()

std::string entropic::prompts::build_classification_prompt ( const std::vector< TierDescriptor > &  tiers,
const std::string &  message,
const std::vector< std::string > &  history = {},
const std::vector< std::string > &  recent_tiers = {} 
)

Auto-generate classification prompt from tier focus + examples.

The trailing " -> " (with space) constrains the router model to output a single digit. Used with max_tokens=1 for classification.

Parameters
tiersOrdered tiers (index+1 = classification digit).
messageUser message to classify.
historyRecent user messages for context (optional).
recent_tiersRecent tier activations for continuity (optional).
Returns
Classification prompt string.
Version
1.8.1
Parameters
tiersOrdered tiers (index+1 = classification digit).
messageUser message to classify.
historyRecent user messages for context.
recent_tiersRecent tier activations for continuity.
Returns
Classification prompt string.
Version
2.0.0

Definition at line 125 of file classification.cpp.

◆ interleave_examples()

std::vector< std::string > entropic::prompts::interleave_examples ( const std::vector< TierDescriptor > &  tiers)

Round-robin interleave few-shot examples across tiers.

Cycling through tiers prevents recency bias — no single tier's examples dominate the tail of the prompt. The 0.6B router model is sensitive to example ordering.

Parameters
tiersOrdered tiers (index+1 = classification digit).
Returns
Lines formatted as: "example text" -> digit
Version
1.8.1
Parameters
tiersOrdered tiers (index+1 = classification digit).
Returns
Lines formatted as: "example text" -> digit
Version
1.8.1

Definition at line 41 of file classification.cpp.