| 2928 | } |
| 2929 | |
| 2930 | void rcli_get_context_info(RCLIHandle handle, int* out_prompt_tokens, int* out_ctx_size) { |
| 2931 | if (!handle) return; |
| 2932 | auto* engine = static_cast<RCLIEngine*>(handle); |
| 2933 | if (!engine->initialized) return; |
| 2934 | |
| 2935 | if (out_prompt_tokens) *out_prompt_tokens = engine->ctx_main_prompt_tokens; |
| 2936 | |
| 2937 | if (out_ctx_size) { |
| 2938 | if (engine->pipeline.using_metalrt()) { |
| 2939 | int mrt_ctx = engine->pipeline.metalrt_llm().context_size(); |
| 2940 | if (mrt_ctx <= 0) { |
| 2941 | int llm_ctx = engine->pipeline.llm().context_size(); |
| 2942 | mrt_ctx = llm_ctx > 0 ? llm_ctx : 4096; |
| 2943 | } |
| 2944 | *out_ctx_size = mrt_ctx; |
| 2945 | } else { |
| 2946 | *out_ctx_size = engine->pipeline.llm().context_size(); |
| 2947 | } |
| 2948 | } |
| 2949 | } |
| 2950 | |
| 2951 | // ============================================================================= |
| 2952 | // VLM (Vision Language Model) |