pub struct LocalLLMClient { /* private fields */ }Expand description
Client for OpenAI-compatible local LLM runtimes.
The struct mirrors the field layout of the hosted-provider clients
(OpenAIClient, OpenRouterClient) but stores the API key as
Option<String> because most local runtimes accept unauthenticated
requests. The request_timeout_seconds value is retained so it can be
embedded in timeout error messages.
Implementations§
Source§impl LocalLLMClient
impl LocalLLMClient
Sourcepub fn new(
api_key: Option<String>,
model: String,
temperature: f32,
max_tokens: u32,
retry_attempts: u32,
retry_delay_ms: u64,
base_url: String,
request_timeout_seconds: u64,
) -> Self
pub fn new( api_key: Option<String>, model: String, temperature: f32, max_tokens: u32, retry_attempts: u32, retry_delay_ms: u64, base_url: String, request_timeout_seconds: u64, ) -> Self
Construct a new LocalLLMClient with explicit parameters.
Sourcepub fn from_config(config: &AIConfig) -> Result<Self>
pub fn from_config(config: &AIConfig) -> Result<Self>
Create a LocalLLMClient from the unified AIConfig.
Validates that base_url is non-empty, emits the shared insecure-HTTP
warning (which already exempts loopback), and constructs an inner
reqwest::Client honoring request_timeout_seconds.
Trait Implementations§
Source§impl AIProvider for LocalLLMClient
impl AIProvider for LocalLLMClient
Source§fn analyze_content<'life0, 'async_trait>(
&'life0 self,
request: AnalysisRequest,
) -> Pin<Box<dyn Future<Output = Result<MatchResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn analyze_content<'life0, 'async_trait>(
&'life0 self,
request: AnalysisRequest,
) -> Pin<Box<dyn Future<Output = Result<MatchResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Analyze multimedia files and subtitle files for matching results. Read more
Source§fn verify_match<'life0, 'async_trait>(
&'life0 self,
verification: VerificationRequest,
) -> Pin<Box<dyn Future<Output = Result<ConfidenceScore>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn verify_match<'life0, 'async_trait>(
&'life0 self,
verification: VerificationRequest,
) -> Pin<Box<dyn Future<Output = Result<ConfidenceScore>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Verify file matching confidence. Read more
Source§impl Debug for LocalLLMClient
impl Debug for LocalLLMClient
Source§impl HttpRetryClient for LocalLLMClient
impl HttpRetryClient for LocalLLMClient
Source§fn retry_attempts(&self) -> u32
fn retry_attempts(&self) -> u32
Number of retry attempts.
Source§fn retry_delay_ms(&self) -> u64
fn retry_delay_ms(&self) -> u64
Delay between retries in milliseconds.
Source§async fn make_request_with_retry(
&self,
request: RequestBuilder,
) -> Result<Response>
async fn make_request_with_retry( &self, request: RequestBuilder, ) -> Result<Response>
Make an HTTP request with retry logic.
Source§impl PromptBuilder for LocalLLMClient
impl PromptBuilder for LocalLLMClient
Source§fn build_analysis_prompt(&self, request: &AnalysisRequest) -> String
fn build_analysis_prompt(&self, request: &AnalysisRequest) -> String
Build analysis prompt.
Source§fn build_verification_prompt(&self, request: &VerificationRequest) -> String
fn build_verification_prompt(&self, request: &VerificationRequest) -> String
Build verification prompt.
Source§fn get_analysis_system_message() -> &'static str
fn get_analysis_system_message() -> &'static str
System message for analysis prompt.
Source§fn get_verification_system_message() -> &'static str
fn get_verification_system_message() -> &'static str
System message for verification prompt.
Source§impl ResponseParser for LocalLLMClient
impl ResponseParser for LocalLLMClient
Source§fn parse_match_result(&self, response: &str) -> Result<MatchResult>
fn parse_match_result(&self, response: &str) -> Result<MatchResult>
Parse match result.
Source§fn parse_confidence_score(&self, response: &str) -> Result<ConfidenceScore>
fn parse_confidence_score(&self, response: &str) -> Result<ConfidenceScore>
Parse confidence score.
Auto Trait Implementations§
impl Freeze for LocalLLMClient
impl !RefUnwindSafe for LocalLLMClient
impl Send for LocalLLMClient
impl Sync for LocalLLMClient
impl Unpin for LocalLLMClient
impl UnsafeUnpin for LocalLLMClient
impl !UnwindSafe for LocalLLMClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more