-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmodel_context_resolver.hpp
More file actions
53 lines (43 loc) · 1.58 KB
/
Copy pathmodel_context_resolver.hpp
File metadata and controls
53 lines (43 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#pragma once
#include "../config/config.hpp"
#include <string>
namespace acecode {
int resolve_model_context_window(
const AppConfig& config,
const std::string& provider_name,
const std::string& model,
int fallback_context_window
);
// Session-facing variant: never waits for remote `/models` endpoint metadata.
// It returns cached/local models.dev context when available, otherwise returns
// the provider-specific fallback (ACEModel: 250K) or fallback_context_window
// immediately and warms endpoint metadata in the background for future calls.
int resolve_model_context_window_nonblocking(
const AppConfig& config,
const std::string& provider_name,
const std::string& model,
int fallback_context_window
);
int resolve_model_profile_context_window(
const AppConfig& config,
const ModelProfile& profile,
int fallback_context_window
);
int resolve_model_profile_context_window_nonblocking(
const AppConfig& config,
const ModelProfile& profile,
int fallback_context_window
);
// Runtime session state also accepts a discovered model-pool window. A
// positive per-profile override remains authoritative over that discovered
// value; otherwise the pool value keeps its existing priority over
// local/cache/fallback resolution.
int resolve_runtime_model_profile_context_window_nonblocking(
const AppConfig& config,
const ModelProfile& profile,
int fallback_context_window,
int model_pool_context_window
);
// Test helper for process-local cache/in-flight state.
void reset_model_context_window_cache_for_test();
} // namespace acecode