Maintainers
Pricing
Enterprise
More
More
Documentation
Try Live
Rankings
Install
Blog
Docs7
Ask
New
Add Docs
Reflex Server
https://docs.rs/crate/reflex-server/0.2.2/
Admin
Reflex Server is an OpenAI-compatible HTTP gateway for Reflex cache.
Tokens:
7,253
Snippets:
67
Trust Score:
9.1
Update:
3 months ago
Context
Chat
Benchmark
Latest
Show doc for...
Code
Info
Show Results
Tokens:
Raw
Copy
Link
Tokens:
Raw
Copy
Link
### Run Reflex Server in Development Source: https://docs.rs/crate/reflex-server Starts the reflex-server in development mode. Requires Qdrant to be running. ```bash # Requires Qdrant running (gRPC on 6334) docker run -d -p 6334:6334 -p 6333:6333 qdrant/qdrant RUST_LOG=debug cargo run -p reflex-server ``` -------------------------------- ### Run Reflex Server in Release Source: https://docs.rs/crate/reflex-server/0.2.2/source/README.md Starts the reflex-server in release mode for production use. ```bash cargo run -p reflex-server --release ``` -------------------------------- ### Run Reflex Server in Development Source: https://docs.rs/crate/reflex-server/0.2.2/source/README.md Starts the reflex-server in development mode. Requires Qdrant to be running. Logs are set to debug level. ```bash # Requires Qdrant running (gRPC on 6334) docker run -d -p 6334:6334 -p 6333:6333 qdrant/qdrant RUST_LOG=debug cargo run -p reflex-server ``` -------------------------------- ### Python OpenAI SDK Example Source: https://docs.rs/crate/reflex-server Demonstrates how to use the OpenAI Python SDK to interact with the Reflex server's chat completions endpoint. ```python from openai import OpenAI client = OpenAI(base_url="http://localhost:8080/v1", api_key="sk-your-key") resp = client.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": "Explain quicksort"}], ) ``` -------------------------------- ### Docker Compose for Reflex Server Source: https://docs.rs/crate/reflex-server Launches the reflex-server and its dependencies using Docker Compose. Run from the repository root. ```bash docker compose up -d ``` -------------------------------- ### Run Reflex Server with Docker Compose Source: https://docs.rs/crate/reflex-server/0.2.2/source/README.md Launches the reflex-server and its dependencies using Docker Compose from the repository root. ```bash docker compose up -d ``` -------------------------------- ### Run Reflex Server in Release Mode Source: https://docs.rs/crate/reflex-server Builds and runs the reflex-server in release mode for production use. ```bash cargo run -p reflex-server --release ``` -------------------------------- ### Configure Agent with OpenAI SDK Source: https://docs.rs/crate/reflex-server/0.2.2/source/README.md Sets environment variables for the OpenAI base URL and API key, then demonstrates using the openai Python SDK to interact with the reflex-server's chat completions endpoint. ```bash export OPENAI_BASE_URL=http://localhost:8080/v1 export OPENAI_API_KEY=sk-your-key ``` ```python from openai import OpenAI client = OpenAI(base_url="http://localhost:8080/v1", api_key="sk-your-key") resp = client.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": "Explain quicksort"}], ) ``` -------------------------------- ### Run Reflex Server Integration Tests Source: https://docs.rs/crate/reflex-server/0.2.2/source/README.md Executes real integration tests for the reflex-server crate, which require Qdrant to be running. ```bash REFLEX_QDRANT_URL=http://localhost:6334 cargo test -p reflex-server --test integration_real ``` -------------------------------- ### Configure Agent with OpenAI SDK Source: https://docs.rs/crate/reflex-server Sets environment variables to point your agent to the Reflex server and configures the OpenAI SDK client. ```bash export OPENAI_BASE_URL=http://localhost:8080/v1 export OPENAI_API_KEY=sk-your-key ``` -------------------------------- ### Build Log for reflex-server 0.2.2 Source: https://docs.rs/crate/reflex-server/0.2.2/builds/2771352 The complete build log for reflex-server 0.2.2, detailing the Docker commands executed, build output, and final artifact generation. ```text # build log [INFO] running `Command { std: "docker" "create" "-v" "/home/cratesfyi/workspace-builder/builds/reflex-server-0.2.2/target:/opt/rustwide/target:rw,Z" "-v" "/home/cratesfyi/workspace-builder/builds/reflex-server-0.2.2/source:/opt/rustwide/workdir:ro,Z" "-v" "/home/cratesfyi/workspace-builder/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/home/cratesfyi/workspace-builder/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "DOCS_RS=1" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "6442450944" "--cpus" "6" "--user" "1001:1001" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:845e597a41426bbf2703be69acdb67d10b6de511142d05cba7bbe119c898b2c7" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "rustdoc" "--lib" "-Zrustdoc-map" "--config" "build.rustdocflags=[\"--cfg\", \"docsrs\", \"-Z\", \"unstable-options\", \"--emit=invocation-specific\", \"--resource-suffix\", \"-20251228-1.94.0-nightly-21cf7fb3f\", \"--static-root-path\", \"/-/rustdoc.static/\", \"--cap-lints\", \"warn\", \"--extern-html-root-takes-precedence\"]" "--offline" "-Zunstable-options" "--config=doc.extern-map.registries.crates-io=\"https://docs.rs/{pkg_name}/{version}/x86_64-unknown-linux-gnu\"" "-Zrustdoc-scrape-examples" "-j6" "--target" "x86_64-unknown-linux-gnu", kill_on_drop: false } [INFO] [stderr] WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap. [INFO] [stdout] 02b76e5560824cd4b53bf84633d58134a4f45b989e38517b5f37976ac0e767ba [INFO] running `Command { std: "docker" "start" "-a" "02b76e5560824cd4b53bf84633d58134a4f45b989e38517b5f37976ac0e767ba", kill_on_drop: false }` [INFO] [stderr] warning: target filter specified, but no targets matched; this is a no-op [INFO] [stderr] Documenting reflex-server v0.2.2 (/opt/rustwide/workdir) [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.62s [INFO] [stderr] Generated /opt/rustwide/target/x86_64-unknown-linux-gnu/doc/reflex_server/index.html [INFO] running `Command { std: "docker" "inspect" "02b76e5560824cd4b53bf84633d58134a4f45b989e38517b5f37976ac0e767ba", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "02b76e5560824cd4b53bf84633d58134a4f45b989e38517b5f37976ac0e767ba", kill_on_drop: false }` [INFO] [stdout] 02b76e5560824cd4b53bf84633d58134a4f45b989e38517b5f37976ac0e767ba ``` -------------------------------- ### Run Reflex Server Tests Source: https://docs.rs/crate/reflex-server Executes the unit tests for the reflex-server crate. ```bash cargo test -p reflex-server ``` -------------------------------- ### Build Reflex Server with GPU Features Source: https://docs.rs/crate/reflex-server Compiles the reflex-server with specific GPU acceleration features like Metal for Apple Silicon or CUDA for NVIDIA. ```bash cargo run -p reflex-server --release --no-default-features --features metal ``` -------------------------------- ### Build Command for reflex-server Source: https://docs.rs/crate/reflex-server/0.2.2/builds/2771352/x86_64-unknown-linux-gnu_json.txt The command executed to build the reflex-server crate, including Docker configuration, target platform, and rustdoc flags. Note the use of nightly Rust and specific rustdoc options for JSON output and external crate mapping. ```text # build log [INFO] running `Command { std: "docker" "create" "-v" "/home/cratesfyi/workspace-builder/builds/reflex-server-0.2.2/target:/opt/rustwide/target:rw,Z" "-v" "/home/cratesfyi/workspace-builder/builds/reflex-server-0.2.2/source:/opt/rustwide/workdir:ro,Z" "-v" "/home/cratesfyi/workspace-builder/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/home/cratesfyi/workspace-builder/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "DOCS_RS=1" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "6442450944" "--cpus" "6" "--user" "1001:1001" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:845e597a41426bbf2703be69acdb67d10b6de511142d05cba7bbe119c898b2c7" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "rustdoc" "--lib" "-Zrustdoc-map" "--config" "build.rustdocflags=[\"--cfg\", \"docsrs\", \"-Z\", \"unstable-options\", \"--output-format\", \"json\", \"--static-root-path\", \"/-/rustdoc.static/\", \"--cap-lints\", \"warn\", \"--extern-html-root-takes-precedence\"]" "--offline" "-Zunstable-options" "--config=doc.extern-map.registries.crates-io=\"https://docs.rs/{pkg_name}/{version}/x86_64-unknown-linux-gnu\"" "-Zrustdoc-scrape-examples" "-j6" "--target" "x86_64-unknown-linux-gnu", kill_on_drop: false }` [INFO] [stdout] 902c382685c33cec15af13ae2d772c8054d1aa6ed0e5a4ff88d48663a652eb3b [INFO] [stderr] WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap. [INFO] running `Command { std: "docker" "start" "-a" "902c382685c33cec15af13ae2d772c8054d1aa6ed0e5a4ff88d48663a652eb3b", kill_on_drop: false }` [INFO] [stderr] warning: target filter specified, but no targets matched; this is a no-op [INFO] [stderr] Documenting reflex-server v0.2.2 (/opt/rustwide/workdir) [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.32s [INFO] running `Command { std: "docker" "inspect" "902c382685c33cec15af13ae2d772c8054d1aa6ed0e5a4ff88d48663a652eb3b", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "902c382685c33cec15af13ae2d772c8054d1aa6ed0e5a4ff88d48663a652eb3b", kill_on_drop: false }` [INFO] [stdout] 902c382685c33cec15af13ae2d772c8054d1aa6ed0e5a4ff88d48663a652eb3b ``` -------------------------------- ### Run Real Integration Tests for Reflex Server Source: https://docs.rs/crate/reflex-server Executes integration tests that require a running Qdrant instance. Ensure REFLEX_QDRANT_URL is set. ```bash REFLEX_QDRANT_URL=http://localhost:6334 cargo test -p reflex-server --test integration_real ``` -------------------------------- ### Readiness Check Source: https://docs.rs/crate/reflex-server/0.2.2/source/README.md Indicates whether the Reflex Server is ready to serve traffic. ```APIDOC ## GET /ready ### Description Checks the readiness of the Reflex Server to handle requests. ### Method GET ### Endpoint /ready ``` -------------------------------- ### Cargo Rustdoc Command Source: https://docs.rs/crate/reflex-server/0.2.2/builds/3598773/x86_64-unknown-linux-gnu.txt The command executed to build the documentation for the reflex-server crate. ```bash # build log [INFO] running `Command { std: "docker" "exec" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "DOCS_RS=1" "-w" "/opt/rustwide/workdir" "--user" "1001:1001" "b635dd817fe90779d22660cd64e15c32557df5810dce9555cdfd423dd8f036ce" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "rustdoc" "--lib" "-Zrustdoc-map" "--config" "build.rustdocflags=[\"--cfg\", \"docsrs\", \"-Z\", \"unstable-options\", \"--emit=invocation-specific\", \"--resource-suffix\", \"-20260615-1.98.0-nightly-01dfd7924\", \"--static-root-path\", \"/-/rustdoc.static/\", \"--cap-lints\", \"warn\", \"--extern-html-root-takes-precedence\"]" "--offline" "-Zunstable-options" "--config=doc.extern-map.registries.crates-io=\"https://docs.rs/{pkg_name}/{version}/x86_64-unknown-linux-gnu\"" "-Zrustdoc-scrape-examples" "-j6" "--target" "x86_64-unknown-linux-gnu", kill_on_drop: false }` [INFO] [stderr] warning: target filter specified, but no targets matched; this is a no-op [INFO] [stderr] Documenting reflex-server v0.2.2 (/opt/rustwide/workdir) [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.02s [INFO] [stderr] Generated /opt/rustwide/target/x86_64-unknown-linux-gnu/doc/reflex_server/index.html [INFO] running `Command { std: "docker" "inspect" "b635dd817fe90779d22660cd64e15c32557df5810dce9555cdfd423dd8f036ce", kill_on_drop: false }` ``` -------------------------------- ### Docker Build Command Source: https://docs.rs/crate/reflex-server/0.2.2/builds/2771352/x86_64-unknown-linux-gnu.txt The command executed to build the reflex-server documentation within a Docker container. It specifies build configurations, target platform, and various environment variables. ```bash # build log [INFO] running `Command { std: "docker" "create" "-v" "/home/cratesfyi/workspace-builder/builds/reflex-server-0.2.2/target:/opt/rustwide/target:rw,Z" "-v" "/home/cratesfyi/workspace-builder/builds/reflex-server-0.2.2/source:/opt/rustwide/workdir:ro,Z" "-v" "/home/cratesfyi/workspace-builder/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/home/cratesfyi/workspace-builder/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "DOCS_RS=1" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "6442450944" "--cpus" "6" "--user" "1001:1001" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:845e597a41426bbf2703be69acdb67d10b6de511142d05cba7bbe119c898b2c7" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "rustdoc" "--lib" "-Zrustdoc-map" "--config" "build.rustdocflags=[\"--cfg\", \"docsrs\", \"-Z\", \"unstable-options\", \"--emit=invocation-specific\", \"--resource-suffix\", \"-20251228-1.94.0-nightly-21cf7fb3f\", \"--static-root-path\", \"/-/rustdoc.static/\", \"--cap-lints\", \"warn\", \"--extern-html-root-takes-precedence\"]" "--offline" "-Zunstable-options" "--config=doc.extern-map.registries.crates-io=\"https://docs.rs/{pkg_name}/{version}/x86_64-unknown-linux-gnu\"" "-Zrustdoc-scrape-examples" "-j6" "--target" "x86_64-unknown-linux-gnu", kill_on_drop: false }` ``` -------------------------------- ### Rustc and Docs.rs Versions Source: https://docs.rs/crate/reflex-server/0.2.2/builds/2771352/x86_64-unknown-linux-gnu.txt Displays the versions of the Rust compiler and the docs.rs build tool used for this specific build. ```text # rustc version rustc 1.94.0-nightly (21cf7fb3f 2025-12-28) # docs.rs version docsrs 0.1.0 (e6d7c66e 2025-12-21 ) ``` -------------------------------- ### Readiness Check Endpoint Source: https://docs.rs/crate/reflex-server Indicates whether the Reflex server is ready to handle requests. This is useful for load balancers and orchestration systems. ```APIDOC ## GET /ready ### Description Checks if the Reflex server is ready to serve traffic. ### Method GET ### Endpoint /ready ``` -------------------------------- ### Docs.rs Version Source: https://docs.rs/crate/reflex-server/0.2.2/builds/2771352/x86_64-unknown-linux-gnu_json.txt Indicates the version of the docs.rs service used during the build. This can be helpful for diagnosing issues related to documentation generation or hosting. ```text # docs.rs version docsrs 0.1.0 (e6d7c66e 2025-12-21 ) ``` -------------------------------- ### VCS Information Source: https://docs.rs/crate/reflex-server/0.2.2/source/.cargo_vcs_info.json This JSON object contains version control system information, including the Git SHA and the path within the VCS. ```json { "git": { "sha1": "039b34af59319e715410914d6fb7afcb7862feab" }, "path_in_vcs": "crates/reflex-server" } ``` -------------------------------- ### Chat Completions Endpoint Source: https://docs.rs/crate/reflex-server/0.2.2 An OpenAI-compatible endpoint for chat completions. ```APIDOC ## POST /v1/chat/completions ### Description Handles chat completion requests compatible with the OpenAI API. ### Method POST ### Endpoint /v1/chat/completions ### Parameters #### Request Body - **model** (string) - Required - The model to use for completion. - **messages** (array) - Required - A list of messages comprising the conversation so far. - **role** (string) - Required - The role of the author of the message (e.g., 'user', 'assistant'). - **content** (string) - Required - The content of the message. ### Request Example ```json { "model": "gpt-4o", "messages": [ {"role": "user", "content": "Explain quicksort"} ] } ``` ### Response #### Success Response (200) - **choices** (array) - A list of completion choices. - **message** (object) - **content** (string) - The content of the completion message. This is Tauq-encoded. ### Response Example ```json { "choices": [ { "message": { "content": "Tauq-encoded explanation of quicksort..." } } ] } ``` ``` -------------------------------- ### Docs.rs Version Source: https://docs.rs/crate/reflex-server/0.2.2/builds/3598773/x86_64-unknown-linux-gnu.txt Displays the version of the docs.rs tool used for generating documentation. ```text # docs.rs version docsrs 0.0.0 (886bc7a22b1adc4b387ce1343447fe3af98d9ce5 2026-06-14 ) ``` -------------------------------- ### Docker Container Output Source: https://docs.rs/crate/reflex-server/0.2.2/builds/2771352/x86_64-unknown-linux-gnu.txt Standard output and error messages from the Docker build process, including warnings and the final documentation generation status. ```text [INFO] [stderr] WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap. [INFO] [stdout] 02b76e5560824cd4b53bf84633d58134a4f45b989e38517b5f37976ac0e767ba [INFO] running `Command { std: "docker" "start" "-a" "02b76e5560824cd4b53bf84633d58134a4f45b989e38517b5f37976ac0e767ba", kill_on_drop: false }` [INFO] [stderr] warning: target filter specified, but no targets matched; this is a no-op [INFO] [stderr] Documenting reflex-server v0.2.2 (/opt/rustwide/workdir) [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.62s [INFO] [stderr] Generated /opt/rustwide/target/x86_64-unknown-linux-gnu/doc/reflex_server/index.html [INFO] running `Command { std: "docker" "inspect" "02b76e5560824cd4b53bf84633d58134a4f45b989e38517b5f37976ac0e767ba", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "02b76e5560824cd4b53bf84633d58134a4f45b989e38517b5f37976ac0e767ba", kill_on_drop: false }` [INFO] [stdout] 02b76e5560824cd4b53bf84633d58134a4f45b989e38517b5f37976ac0e767ba ``` -------------------------------- ### Chat Completions Endpoint Source: https://docs.rs/crate/reflex-server An OpenAI-compatible endpoint for chat completions. It processes user messages and returns AI-generated responses, leveraging the Reflex cache. ```APIDOC ## POST /v1/chat/completions ### Description Provides chat completions compatible with the OpenAI API. This endpoint processes messages and returns AI-generated content. ### Method POST ### Endpoint /v1/chat/completions ### Request Body - **model** (string) - Required - The model to use for generating completions. - **messages** (array) - Required - A list of messages comprising the conversation. - **role** (string) - Required - The role of the author of the message (e.g., 'user', 'assistant'). - **content** (string) - Required - The content of the message. ### Response #### Success Response (200) - **choices** (array) - A list of completion choices. - **message** (object) - The message content. - **content** (string) - The generated content, Tauq-encoded. ### Response Status Responses include `X-Reflex-Status` header with values like `hit-l1-exact`, `hit-l3-verified`, or `miss`. ``` -------------------------------- ### Rustc Version Source: https://docs.rs/crate/reflex-server/0.2.2/builds/3598773/x86_64-unknown-linux-gnu.txt Displays the version of the Rust compiler used for the build. ```text # rustc version rustc 1.98.0-nightly (01dfd7924 2026-06-15) ``` -------------------------------- ### Rust Compiler Version Source: https://docs.rs/crate/reflex-server/0.2.2/builds/2771352/x86_64-unknown-linux-gnu_json.txt Displays the version of the Rust compiler used for the build. This information is crucial for understanding compiler-specific behaviors or potential compatibility issues. ```text # rustc version rustc 1.94.0-nightly (21cf7fb3f 2025-12-28) ``` -------------------------------- ### Health Check Source: https://docs.rs/crate/reflex-server/0.2.2/source/README.md Provides a basic health status of the Reflex Server. ```APIDOC ## GET /healthz ### Description Checks the health of the Reflex Server. ### Method GET ### Endpoint /healthz ``` -------------------------------- ### Health Check Endpoint Source: https://docs.rs/crate/reflex-server Provides a health check for the Reflex server. This endpoint can be used to monitor the server's operational status. ```APIDOC ## GET /healthz ### Description Checks the health status of the Reflex server. ### Method GET ### Endpoint /healthz ```