MCPcopy Index your code
hub / github.com/ceifa/tiktoken-node / encoding_for_model

Function encoding_for_model

src/lib.rs:68–74  ·  view source on GitHub ↗
(model_name: String)

Source from the content-addressed store, hash-verified

66
67#[napi]
68pub fn encoding_for_model(model_name: String) -> Result<Encoding, Error> {
69 let encoding = tiktoken_rs::get_bpe_from_model(&model_name);
70 match encoding {
71 Ok(encoding) => Ok(Encoding { encoding }),
72 Err(err) => Err(Error::from_reason(err.to_string())),
73 }
74}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…