mirror of
https://github.com/katanemo/plano.git
synced 2026-05-21 13:55:15 +02:00
Use better logs (#452)
This commit is contained in:
parent
76ec5cda68
commit
de221525de
10 changed files with 200 additions and 156 deletions
|
|
@ -3,7 +3,7 @@ use crate::{
|
|||
stats::{Gauge, IncrementingMetric},
|
||||
};
|
||||
use derivative::Derivative;
|
||||
use log::trace;
|
||||
use log::debug;
|
||||
use proxy_wasm::traits::Context;
|
||||
use serde::Serialize;
|
||||
use std::{cell::RefCell, collections::HashMap, fmt::Debug, time::Duration};
|
||||
|
|
@ -48,7 +48,7 @@ pub trait Client: Context {
|
|||
call_args: CallArgs,
|
||||
call_context: Self::CallContext,
|
||||
) -> Result<u32, ClientError> {
|
||||
trace!(
|
||||
debug!(
|
||||
"dispatching http call with args={:?} context={:?}",
|
||||
call_args,
|
||||
call_context
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use crate::configuration;
|
||||
use configuration::{Limit, Ratelimit, TimeUnit};
|
||||
use governor::{DefaultKeyedRateLimiter, InsufficientCapacity, Quota};
|
||||
use log::trace;
|
||||
use log::debug;
|
||||
use std::fmt::Display;
|
||||
use std::num::{NonZero, NonZeroU32};
|
||||
use std::sync::RwLock;
|
||||
|
|
@ -99,7 +99,7 @@ impl RatelimitMap {
|
|||
selector: Header,
|
||||
tokens_used: NonZeroU32,
|
||||
) -> Result<(), Error> {
|
||||
trace!(
|
||||
debug!(
|
||||
"Checking limit for provider={}, with selector={:?}, consuming tokens={:?}",
|
||||
provider,
|
||||
selector,
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
use log::trace;
|
||||
use log::{debug};
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn token_count(model_name: &str, text: &str) -> Result<usize, String> {
|
||||
trace!("getting token count model={}", model_name);
|
||||
debug!("getting token count model={}", model_name);
|
||||
//HACK: add support for tokenizing mistral and other models
|
||||
//filed issue https://github.com/katanemo/arch/issues/222
|
||||
|
||||
let updated_model = match model_name.starts_with("gpt") {
|
||||
false => {
|
||||
trace!(
|
||||
debug!(
|
||||
"tiktoken_rs: unsupported model: {}, using gpt-4 to compute token count",
|
||||
model_name
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue