llmprism 0.4.0

A unified, fluent Rust interface for integrating Large Language Model providers -- a Rust port of the PHP Prism library.
Documentation
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2021"
rust-version = "1.88"
name = "llmprism"
version = "0.4.0"
authors = ["Soon To Zen <ayimdomnic@outlook.com>"]
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "A unified, fluent Rust interface for integrating Large Language Model providers -- a Rust port of the PHP Prism library."
readme = "README.md"
keywords = [
    "llm",
    "ai",
    "openai",
    "anthropic",
    "genai",
]
categories = [
    "api-bindings",
    "asynchronous",
]
license = "MIT"
repository = "https://github.com/ayimdomnic/llmprism"

[package.metadata.docs.rs]
all-features = true

[features]
anthropic = ["http"]
cli = [
    "dep:clap",
    "http",
]
deepseek = ["openai"]
default = []
elevenlabs = ["http"]
full = [
    "openai",
    "anthropic",
    "groq",
    "deepseek",
    "mistral",
    "xai",
    "openrouter",
    "perplexity",
    "zai",
    "ollama",
    "voyageai",
    "elevenlabs",
    "gemini",
]
gemini = ["http"]
groq = ["openai"]
http = [
    "dep:reqwest",
    "dep:reqwest-middleware",
    "dep:reqwest-retry",
    "dep:eventsource-stream",
    "dep:partial-json-fixer",
]
mcp = ["dep:rmcp"]
mistral = ["openai"]
ollama = ["openai"]
openai = ["http"]
openrouter = ["openai"]
perplexity = ["openai"]
tracing = ["dep:tracing"]
voyageai = ["http"]
xai = ["openai"]
zai = ["openai"]

[lib]
name = "llmprism"
path = "src/lib.rs"

[[bin]]
name = "llmprism"
path = "src/bin/llmprism.rs"
required-features = ["cli"]

[[example]]
name = "anthropic_streaming"
path = "examples/anthropic_streaming.rs"

[[example]]
name = "anthropic_structured_output"
path = "examples/anthropic_structured_output.rs"

[[example]]
name = "anthropic_text_generation"
path = "examples/anthropic_text_generation.rs"

[[example]]
name = "anthropic_tool_calling"
path = "examples/anthropic_tool_calling.rs"

[[example]]
name = "mcp_tool_calling"
path = "examples/mcp_tool_calling.rs"

[[example]]
name = "streaming"
path = "examples/streaming.rs"

[[example]]
name = "structured_output"
path = "examples/structured_output.rs"

[[example]]
name = "testing_with_fake_provider"
path = "examples/testing_with_fake_provider.rs"

[[example]]
name = "text_generation"
path = "examples/text_generation.rs"

[[example]]
name = "tool_calling"
path = "examples/tool_calling.rs"

[[test]]
name = "anthropic_structured_streaming"
path = "tests/anthropic_structured_streaming.rs"

[[test]]
name = "anthropic_text"
path = "tests/anthropic_text.rs"

[[test]]
name = "audio"
path = "tests/audio.rs"

[[test]]
name = "elevenlabs"
path = "tests/elevenlabs.rs"

[[test]]
name = "embeddings"
path = "tests/embeddings.rs"

[[test]]
name = "error_handling"
path = "tests/error_handling.rs"

[[test]]
name = "gemini"
path = "tests/gemini.rs"

[[test]]
name = "images"
path = "tests/images.rs"

[[test]]
name = "mcp"
path = "tests/mcp.rs"

[[test]]
name = "middleware"
path = "tests/middleware.rs"

[[test]]
name = "moderation"
path = "tests/moderation.rs"

[[test]]
name = "ollama"
path = "tests/ollama.rs"

[[test]]
name = "openai_compatible"
path = "tests/openai_compatible.rs"

[[test]]
name = "openai_text"
path = "tests/openai_text.rs"

[[test]]
name = "persistence"
path = "tests/persistence.rs"

[[test]]
name = "rate_limit_retries"
path = "tests/rate_limit_retries.rs"

[[test]]
name = "stream_loop"
path = "tests/stream_loop.rs"

[[test]]
name = "structured"
path = "tests/structured.rs"

[[test]]
name = "structured_repair"
path = "tests/structured_repair.rs"

[[test]]
name = "structured_streaming"
path = "tests/structured_streaming.rs"

[[test]]
name = "tenancy"
path = "tests/tenancy.rs"

[[test]]
name = "tool_loop"
path = "tests/tool_loop.rs"

[[test]]
name = "tracing_middleware"
path = "tests/tracing_middleware.rs"

[[test]]
name = "voyageai"
path = "tests/voyageai.rs"

[[bench]]
name = "middleware"
path = "benches/middleware.rs"
harness = false

[[bench]]
name = "provider_options"
path = "benches/provider_options.rs"
harness = false
required-features = ["http"]

[[bench]]
name = "schema"
path = "benches/schema.rs"
harness = false

[[bench]]
name = "stream_loop"
path = "benches/stream_loop.rs"
harness = false

[[bench]]
name = "tool_loop"
path = "benches/tool_loop.rs"
harness = false

[dependencies.async-stream]
version = "0.3"

[dependencies.async-trait]
version = "0.1"

[dependencies.clap]
version = "4"
features = ["derive"]
optional = true

[dependencies.eventsource-stream]
version = "0.2"
optional = true

[dependencies.futures]
version = "0.3"

[dependencies.partial-json-fixer]
version = "0.5"
optional = true

[dependencies.reqwest]
version = "0.12"
features = [
    "json",
    "stream",
    "multipart",
    "rustls-tls",
]
optional = true
default-features = false

[dependencies.reqwest-middleware]
version = "0.4"
features = [
    "json",
    "multipart",
]
optional = true

[dependencies.reqwest-retry]
version = "0.7"
optional = true

[dependencies.rmcp]
version = "3.1"
features = [
    "client",
    "transport-child-process",
    "transport-streamable-http-client-reqwest",
]
optional = true
default-features = false

[dependencies.serde]
version = "1"
features = ["derive"]

[dependencies.serde_json]
version = "1"

[dependencies.thiserror]
version = "2"

[dependencies.tokio]
version = "1"
features = [
    "macros",
    "rt",
    "sync",
    "time",
]

[dependencies.tracing]
version = "0.1"
optional = true

[dev-dependencies.criterion]
version = "0.8"
features = ["async_tokio"]

[dev-dependencies.tokio]
version = "1"
features = [
    "macros",
    "rt-multi-thread",
    "sync",
    "time",
]

[dev-dependencies.tracing-subscriber]
version = "0.3"

[dev-dependencies.wiremock]
version = "0.6"