28using AdapterFactory = std::function<std::unique_ptr<ChatAdapter>(
29 const std::string&,
const std::string&)>;
38 AdapterFactory factory;
51const std::array<AdapterEntry, 4>& adapter_table() {
52 static const std::array<AdapterEntry, 4> table{{
53 {
"qwen35", [](
auto& t,
auto& p) {
54 return std::make_unique<Qwen35Adapter>(t, p); }},
55 {
"qwen36", [](
auto& t,
auto& p) {
56 return std::make_unique<Qwen36Adapter>(t, p); }},
57 {
"gemma4", [](
auto& t,
auto& p) {
58 return std::make_unique<Gemma4Adapter>(t, p); }},
59 {
"nemotron3", [](
auto& t,
auto& p) {
60 return std::make_unique<Nemotron3Adapter>(t, p); }},
72std::string to_lower(
const std::string& name) {
73 std::string lower = name;
74 std::transform(lower.begin(), lower.end(), lower.begin(),
75 [](
unsigned char c) { return std::tolower(c); });
97 const std::string& name,
98 const std::string& tier_name,
99 const std::string& identity_prompt)
101 const std::string lower = to_lower(name);
102 for (
const auto& entry : adapter_table()) {
103 if (lower == entry.key) {
104 logger->info(
"Adapter created: type={}, tier={}",
105 entry.key, tier_name);
106 return entry.factory(tier_name, identity_prompt);
109 if (lower !=
"generic") {
110 logger->warn(
"Unknown adapter '{}', falling back to generic", name);
112 logger->info(
"Adapter created: type=generic, tier={}", tier_name);
113 return std::make_unique<GenericAdapter>(tier_name, identity_prompt);
Adapter factory — create adapters by name.
Gemma 4 chat adapter (v2.1.9, gh#46).
GenericAdapter — default ChatML adapter with JSON tool calls.
spdlog initialization and logger access.
ENTROPIC_EXPORT std::shared_ptr< spdlog::logger > get(const std::string &name)
Get or create a named logger.
Activate model on GPU (WARM → ACTIVE).
std::unique_ptr< ChatAdapter > create_adapter(const std::string &name, const std::string &tier_name, const std::string &identity_prompt)
Create adapter by name.
Nemotron 3 chat adapter (v2.1.9, gh#47).
Qwen 3.6 chat adapter (v2.1.9, gh#45).