[dependencies.async-trait]
optional = true
version = "0.1.89"
[dependencies.async_tools]
optional = true
version = "=0.1.0"
[dependencies.backoff]
features = ["tokio"]
optional = true
version = "0.4.0"
[dependencies.base64]
optional = true
version = "0.22.1"
[dependencies.bytes]
optional = true
version = "1.10.1"
[dependencies.chrono]
optional = true
version = "0.4.42"
[dependencies.derive_tools]
optional = true
version = "0.50.0"
[dependencies.dotenv]
optional = true
version = "0.15"
[dependencies.error_tools]
optional = true
version = "0.35.0"
[dependencies.eventsource-stream]
optional = true
version = "0.2.3"
[dependencies.former]
optional = true
version = "2.37.0"
[dependencies.futures]
optional = true
version = "0.3.31"
[dependencies.futures-core]
optional = true
version = "0.3.31"
[dependencies.futures-util]
optional = true
version = "0.3.31"
[dependencies.mod_interface]
optional = true
version = "0.52.0"
[dependencies.rand]
optional = true
version = "0.9.2"
[dependencies.regex]
optional = true
version = "1.12.2"
[dependencies.reqwest]
default-features = false
features = ["json", "stream", "multipart", "rustls-tls"]
optional = true
version = "0.12.24"
[dependencies.reqwest-eventsource]
optional = true
version = "0.6.0"
[dependencies.secrecy]
optional = true
version = "0.10.3"
[dependencies.serde]
features = ["derive"]
optional = true
version = "1.0.228"
[dependencies.serde_json]
optional = true
version = "1.0.145"
[dependencies.serde_with]
optional = true
version = "3.15.1"
[dependencies.serde_yaml]
optional = true
version = "0.9.34"
[dependencies.tokio]
features = ["macros", "sync", "time", "rt-multi-thread"]
optional = true
version = "1.48.0"
[dependencies.tokio-stream]
optional = true
version = "0.1.17"
[dependencies.tokio-tungstenite]
optional = true
version = "0.28.0"
[dependencies.tracing]
optional = true
version = "=0.1.40"
[dependencies.tracing-subscriber]
optional = true
version = "=0.3.18"
[dependencies.url]
optional = true
version = "2.5.7"
[dependencies.workspace_tools]
features = ["secrets"]
optional = true
version = "0.10.0"
[dev-dependencies.tempfile]
version = "3.23.0"
[dev-dependencies.wiremock]
version = "0.6"
[[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"
[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", "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 = ["integration-tests", "env-config", "logging"]
integration-tests = ["inference", "embeddings", "models"]
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"
[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
[package]
authors = ["Kostiantyn Wandalen <wandalen@obox.systems>"]
autobenches = false
autobins = false
autoexamples = false
autolib = false
autotests = false
build = false
categories = ["algorithms", "development-tools"]
description = """
HuggingFace's API for accessing large language models (LLMs) and embeddings.
"""
documentation = "https://docs.rs/api_huggingface"
edition = "2021"
homepage = "https://github.com/Wandalen/api_llm/tree/master/api/huggingface"
keywords = ["fundamental", "general-purpose"]
license = "MIT"
name = "api_huggingface"
readme = "readme.md"
repository = "https://github.com/Wandalen/api_llm/tree/master/api/huggingface"
rust-version = "1.70.0"
version = "0.3.0"
[package.metadata.docs.rs]
all-features = false
features = ["full"]
[[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 = "debug_validation"
path = "tests/debug_validation.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 = "simple_inference_integration_test"
path = "tests/simple_inference_integration_test.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"