[package]
edition = "2021"
rust-version = "1.70"
name = "api_huggingface"
version = "0.4.1"
authors = ["Kostiantyn Mysnyk <wandalen@obox.systems>"]
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = """
HuggingFace's API for accessing large language models (LLMs) and embeddings.
"""
homepage = "https://github.com/Wandalen/api_llm/tree/master/api/huggingface"
documentation = "https://docs.rs/api_huggingface"
readme = "readme.md"
keywords = [
"fundamental",
"general-purpose",
]
categories = [
"algorithms",
"development-tools",
]
license = "MIT"
repository = "https://github.com/Wandalen/api_llm/tree/master/api/huggingface"
[package.metadata.docs.rs]
features = ["full"]
all-features = false
[features]
audio = [
"client",
"dep:base64",
]
basic = [
"inference",
"embeddings",
"models",
"env-config",
]
caching = ["client"]
circuit-breaker = ["reliability"]
client = [
"enabled",
"dep:former",
"dep:async_tools",
"dep:workspace_tools",
"dep:async-trait",
"dep:url",
"dep:reqwest",
"dep:tokio",
"dep:futures",
"dep:futures-core",
]
default = ["full"]
dynamic-config = ["reliability"]
embeddings = [
"client",
"dep:regex",
]
embeddings-batch = ["embeddings"]
embeddings-similarity = ["embeddings"]
enabled = [
"dep:mod_interface",
"dep:error_tools",
"dep:derive_tools",
"dep:serde",
"dep:serde_json",
"dep:secrecy",
]
env-config = ["dep:dotenv"]
failover = ["reliability"]
full = [
"enabled",
"integration",
"basic",
"inference-streaming",
"inference-retry",
"streaming-control",
"embeddings-similarity",
"embeddings-batch",
"model-constants",
"logging",
"sync",
"reliability",
"circuit-breaker",
"rate-limiting",
"failover",
"health-checks",
"performance-metrics",
"caching",
"token-counting",
"dynamic-config",
"vision",
"audio",
]
health-checks = ["reliability"]
inference = [
"client",
"dep:eventsource-stream",
"dep:reqwest-eventsource",
"dep:bytes",
"dep:rand",
"dep:chrono",
]
inference-parameters = ["inference"]
inference-retry = [
"inference",
"dep:backoff",
]
inference-streaming = [
"inference",
"dep:tokio-stream",
"dep:futures-util",
]
integration = [
"inference",
"embeddings",
"models",
"env-config",
"logging",
]
logging = [
"dep:tracing",
"dep:tracing-subscriber",
]
model-constants = []
models = ["client"]
performance-metrics = ["client"]
rate-limiting = ["reliability"]
reliability = ["client"]
streaming-control = [
"inference-streaming",
"dep:futures-core",
]
sync = ["client"]
token-counting = ["client"]
vision = [
"client",
"dep:base64",
]
[lib]
name = "api_huggingface"
path = "src/lib.rs"
[[example]]
name = "chat"
path = "examples/chat.rs"
[[example]]
name = "chat_cached_interactive"
path = "examples/chat_cached_interactive.rs"
required-features = [
"full",
"caching",
]
[[example]]
name = "huggingface_multi_turn_conversation"
path = "examples/huggingface_multi_turn_conversation.rs"
[[example]]
name = "hf_interactive_chat"
path = "examples/hf_interactive_chat.rs"
[[example]]
name = "inference_create"
path = "examples/huggingface_inference_create.rs"
[[example]]
name = "embeddings_create"
path = "examples/huggingface_embeddings_create.rs"
[[example]]
name = "huggingface_chat_conversational"
path = "examples/huggingface_chat_conversational.rs"
[[example]]
name = "document_semantic_search"
path = "examples/huggingface_document_semantic_search.rs"
[[example]]
name = "automated_content_generator"
path = "examples/huggingface_automated_content_generator.rs"
[[example]]
name = "developer_code_assistant"
path = "examples/huggingface_developer_code_assistant.rs"
[[example]]
name = "intelligent_qa_system"
path = "examples/huggingface_intelligent_qa_system.rs"
[[example]]
name = "multilingual_translator"
path = "examples/huggingface_multilingual_translator.rs"
[[example]]
name = "sentiment_content_analyzer"
path = "examples/huggingface_sentiment_content_analyzer.rs"
[[example]]
name = "educational_ai_tutor"
path = "examples/huggingface_educational_ai_tutor.rs"
[[example]]
name = "providers_api_demo"
path = "examples/providers_api_demo.rs"
[[test]]
name = "audio_tests"
path = "tests/audio_tests.rs"
[[test]]
name = "cache_tests"
path = "tests/cache_tests.rs"
[[test]]
name = "chatbot_example_test"
path = "tests/chatbot_example_test.rs"
[[test]]
name = "circuit_breaker_tests"
path = "tests/circuit_breaker_tests.rs"
[[test]]
name = "client_tests"
path = "tests/client_tests.rs"
[[test]]
name = "components_tests"
path = "tests/components_tests.rs"
[[test]]
name = "content_generator_example_test"
path = "tests/content_generator_example_test.rs"
[[test]]
name = "curl_diagnostics_tests"
path = "tests/curl_diagnostics_tests.rs"
[[test]]
name = "doc_spec_tests"
path = "tests/doc_spec_tests.rs"
[[test]]
name = "document_search_example_test"
path = "tests/document_search_example_test.rs"
[[test]]
name = "dynamic_config_tests"
path = "tests/dynamic_config_tests.rs"
[[test]]
name = "embeddings_tests"
path = "tests/embeddings_tests.rs"
[[test]]
name = "error_handling_tests"
path = "tests/error_handling_tests.rs"
[[test]]
name = "example_compilation_test"
path = "tests/example_compilation_test.rs"
[[test]]
name = "example_error_handling_test"
path = "tests/example_error_handling_test.rs"
[[test]]
name = "failover_tests"
path = "tests/failover_tests.rs"
[[test]]
name = "function_calling_tests"
path = "tests/function_calling_tests.rs"
[[test]]
name = "health_check_tests"
path = "tests/health_check_tests.rs"
[[test]]
name = "inference_tests"
path = "tests/inference_tests.rs"
[[test]]
name = "models_tests"
path = "tests/models_tests.rs"
[[test]]
name = "performance_metrics_tests"
path = "tests/performance_metrics_tests.rs"
[[test]]
name = "providers_api_integration_test"
path = "tests/providers_api_integration_test.rs"
[[test]]
name = "providers_api_tests"
path = "tests/providers_api_tests.rs"
[[test]]
name = "qa_system_example_test"
path = "tests/qa_system_example_test.rs"
[[test]]
name = "rate_limiting_tests"
path = "tests/rate_limiting_tests.rs"
[[test]]
name = "retry_tests"
path = "tests/retry_tests.rs"
[[test]]
name = "streaming_control_tests"
path = "tests/streaming_control_tests.rs"
[[test]]
name = "streaming_tests"
path = "tests/streaming_tests.rs"
[[test]]
name = "sync_api_tests"
path = "tests/sync_api_tests.rs"
[[test]]
name = "sync_cache_tests"
path = "tests/sync_cache_tests.rs"
[[test]]
name = "sync_streaming_tests"
path = "tests/sync_streaming_tests.rs"
[[test]]
name = "sync_token_counting_tests"
path = "tests/sync_token_counting_tests.rs"
[[test]]
name = "token_counting_tests"
path = "tests/token_counting_tests.rs"
[[test]]
name = "validation_tests"
path = "tests/validation_tests.rs"
[[test]]
name = "vision_tests"
path = "tests/vision_tests.rs"
[dependencies.async-trait]
version = "^0.1"
optional = true
[dependencies.async_tools]
version = "^0.1"
optional = true
[dependencies.backoff]
version = "^0.4"
features = ["tokio"]
optional = true
[dependencies.base64]
version = "^0.22"
optional = true
[dependencies.bytes]
version = "^1.10"
optional = true
[dependencies.chrono]
version = "^0.4"
optional = true
[dependencies.derive_tools]
version = "^0.68"
optional = true
[dependencies.dotenv]
version = "^0.15"
optional = true
[dependencies.error_tools]
version = "^0.40"
features = ["error_typed"]
optional = true
[dependencies.eventsource-stream]
version = "^0.2"
optional = true
[dependencies.former]
version = "^2.48"
optional = true
[dependencies.futures]
version = "^0.3"
optional = true
[dependencies.futures-core]
version = "^0.3"
optional = true
[dependencies.futures-util]
version = "^0.3"
optional = true
[dependencies.mod_interface]
version = "^0.64"
optional = true
[dependencies.rand]
version = "^0.10"
optional = true
[dependencies.regex]
version = "^1.12"
optional = true
[dependencies.reqwest]
version = "^0.13"
features = [
"json",
"stream",
"multipart",
"rustls",
]
optional = true
default-features = false
[dependencies.reqwest-eventsource]
version = "^0.6"
optional = true
[dependencies.secrecy]
version = "^0.10"
optional = true
[dependencies.serde]
version = "^1.0"
features = ["derive"]
optional = true
[dependencies.serde_json]
version = "^1.0"
optional = true
[dependencies.tokio]
version = "^1.52"
features = [
"macros",
"sync",
"time",
"rt-multi-thread",
]
optional = true
[dependencies.tokio-stream]
version = "^0.1"
optional = true
[dependencies.tracing]
version = "^0.1"
optional = true
[dependencies.tracing-subscriber]
version = "^0.3"
optional = true
[dependencies.url]
version = "^2.5"
optional = true
[dependencies.workspace_tools]
version = "^0.14"
features = ["secrets"]
optional = true
[dev-dependencies.tempfile]
version = "^3.27"
[lints.clippy]
absolute_paths = "allow"
arbitrary_source_item_ordering = "allow"
cast_precision_loss = "allow"
doc_include_without_cfg = "warn"
implicit_return = "allow"
inline_always = "allow"
items_after_statements = "allow"
missing_docs_in_private_items = "allow"
missing_inline_in_public_items = "warn"
mod_module_files = "allow"
module_name_repetitions = "allow"
pub_use = "allow"
question_mark_used = "allow"
single_call_fn = "allow"
std_instead_of_alloc = "allow"
std_instead_of_core = "warn"
undocumented_unsafe_blocks = "deny"
wildcard_imports = "allow"
[lints.clippy.pedantic]
level = "warn"
priority = -1
[lints.rust]
missing_debug_implementations = "warn"
missing_docs = "warn"
unsafe-code = "deny"
[lints.rust.future_incompatible]
level = "warn"
priority = -1
[lints.rust.rust_2018_idioms]
level = "warn"
priority = -1