PhariaEngine allows you to execute Cognitive Business Units called Skills. These Skills can be written in any language which compiles to WebAssembly (Wasm). We provide a SDK and dedicated support for Python. PhariaEngine handles the interaction between these Skills and drivers for functionality like inference and retrieval via the Cognitive System Interface (CSI). Writing Skills for PhariaEngine is more constrained then shipping an end to end use case in a custom Docker container. Yet these constraints allow us to make opinionated decisions for the Skill developer. We strive to take away only the decisions and responsibilities a Skill developer may find "boring" (such as authentication, parallelization of inference calls). In more technical terms, we aim to reduce the accidental complexity the Skill developer has to engage with.
Note
Until now, PhariaEngine has been deployed as part of the PhariaAI product suite. Making PhariaEngine independent of PhariaAI a smooth experience is currently work in progress. Opensourcing this repository is one step towards that goal. This is the beginning of a journey and we are constantly improving.
If you are excited about the PhariaEngine idea, please reach out or start contributing.
- WebAssembly Skills: Hosts AI methodology written in Python and makes it available via HTTP endpoints
- Flexible Inference Backends: Works with Aleph Alpha inference or any OpenAI-compatible backend
- OpenTelemetry Tracing: Integrated observability with support for OpenTelemetry backends like Langfuse and Langsmith, following GenAI semantic conventions
- Model Context Protocol (MCP): Dynamic tool discovery and invocation through MCP servers with per-namespace configuration
The Engine is part of the PhariaAI product suite. However, it can also be configured to run standalone with any OpenAI-compatible inference backend. If operated outside of PhariaAI, some features are not available. These include RAG capabilities offered by the DocumentIndex, features like explainability that are offered by the Aleph Alpha inference and the integration with the Pharia IAM service.
Next to the Rust toolchain, there are some prerequisites you will need to install once:
# We need the Wasm target to be able to compile the skills
rustup target add wasm32-wasip2
# We need wasm-tools to strip skill binaries
cargo install wasm-tools
# Create an .env file and set the missing values
cp .env.example .envNow, you can run the Engine with
cargo run# Create an .env.test file and set the missing values
cp .env.test.example .env.test
# We recommend cargo nextest, but cargo test also works
cargo install cargo-nextest --locked
cargo nextest run --workspace --all-featuresNote that some tests require access to a PhariaAI instance.
To deselect tests against OpenAI, run cargo nextest run --features test_no_openai.
cargo fmt -- --check
cargo clippy --workspace --all-features --all-targets -- -D warningsBuild the image with
podman build . --tag pharia-engineThen, run the container with
podman run -v ./config.toml:/app/config.toml -p 8081:8081 --env-file .env pharia-engineYou can find more details on how to configure the Engine in the OPERATING.md.
Podman on MacOS requires a separate virtual machine run by the user. To compile PhariaEngine, at least 4 GiB of RAM are needed and 8 GiB are recommended. You set this up with
podman machine init
podman machine set --memory 8192
podman machine startReleasing in this repository is automated with release-pls.
- For every commit to the
mainbranch, release-pls creates a release Pull Request. - Review the release Pull Request and add new changes, if necessary, by amending the commit directly.
- Merge the release Pull Request and release-pls will release the updated packages.
The Engine organizes Skills in namespaces.
Each namespace can be configured to pull Skills from either a remote OCI registry or a local directory. Configuration examples can be found in the .env.example file.
The Engine comes configured with a test-beta namespace that hosts some hard-coded skills. You can invoke the hello skill with
curl -v 127.0.0.1:8081/v1/skills/test-beta/hello/message-stream \
-H 'Content-Type: application/json' \
-d '"Homer"'