ai-dial-core
CLAUDE.md663 starsChanged 23 days agoApache-2.0View on GitHub
GitHub credentials are required for the private JClouds Maven package (hosted on GitHub Packages): At runtime, set AIDIAL_SETTINGS env var pointing to a JSON settings file (see sample/aidial.settings.json). AI DIAL Core is an HTTP reverse proxy / API gateway for LLMs built on Java 21 + Eclipse Vert.x (reactive, non-blocking). It exposes an OpenAI-compatible API and routes requests to backend AI providers (Azure OpenAI, AWS, GCP, etc.).
In this repository7 other files it gives its agents.
The file
We split this CLAUDE.md into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 89
Read docs/CODE_STYLE.md before writing or changing Java in this repo.
- Distinctive: line 122
Run checkstyle and the targeted test classes locally.
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Build & Run
GitHub credentials are required for the private JClouds Maven package (hosted on GitHub Packages):
# Set credentials via environment variables
export GPR_USERNAME=<github_user>
export GPR_PASSWORD=<github_token>
# Build (skip tests)
./gradlew build -x test
# Run all tests
./gradlew test
# Run tests for a specific module
./gradlew :server:test
# Run a single test class
./gradlew :server:test --tests "com.epam.aidial.core.server.ResourceApiTest"
# Run a single test method
./gradlew :server:test --tests "com.epam.aidial.core.server.ResourceApiTest.testWorkflow"
# Checkstyle
./gradlew checkstyleMain checkstyleTest
# Run locally
./gradlew :server:runAt runtime, set AIDIAL_SETTINGS env var pointing to a JSON settings file (see sample/aidial.settings.json).
Architecture
AI DIAL Core is an HTTP reverse proxy / API gateway for LLMs built on Java 21 + Eclipse Vert.x (reactive, non-blocking). It exposes an OpenAI-compatible API and routes requests to backend AI providers (Azure OpenAI, AWS, GCP, etc.).
Gradle Modules
| Module | Root Package | Responsibility |
config | com.epam.aidial.core.config | POJOs for the dynamic config (Config, Model, Application, Key, Role, Route, Interceptor, ToolSet, Upstream, Limit, …) + JSON validation |
storage | com.epam.aidial.core.storage | Blob storage abstraction via Apache JClouds (S3, GCS, Azure Blob, filesystem), Redis-backed resource service, resource descriptors, locking |
credentials | com.epam.aidial.core.credentials | OAuth2 token management, AES credential encryption, KMS integration (AWS/Azure/GCP) |
server | com.epam.aidial.core.server | Entry point (AiDial.java), HTTP proxy engine (Proxy.java), all controllers, services, security, rate limiting, upstream load balancing, telemetry |
openapi-annotations | com.epam.aidial.core.openapi.annotations | Custom annotations for describing OpenAPI operations, schemas, parameters, responses, headers, extensions, and reusable response profiles. |
openapi-generator | com.epam.aidial.core.openapi | Generates and validates the OpenAPI 3.0 specification from controller annotations, builds schemas and responses, assembles the specification, and merges it with the manually maintained OpenAPI document. |
Key Server Sub-packages
controller/— HTTP request handlers (chat completions, embeddings, file upload, resource CRUD, sharing, publications, toolsets, health check)service/— Business logic (ApplicationService, PublicationService, ShareService, RuleService, ToolSetService, CodeInterpreterService, …)security/— JWT validation (JWKS), API key store, AES encryption service, access controlupstream/— Load balancing: tiered + weighted random over upstream endpointslimiter/— Token-based and request-based rate limiting (per-minute/per-day per role)token/— Token usage stats tracking and per-provider response parsingfunction/— Request/response transformation middleware pipelinetracing/— OpenTelemetry span processingconfig/— Dynamic config hot-reload (FileConfigStore)
Configuration
Two config files govern the system:
- Static settings (
aidial.settings.json): Vert.x server/client options, blob storage provider, Redis connection, identity providers, encryption keys, metrics endpoints. Not hot-reloaded. - Dynamic config (
aidial.config.json): models, applications, API keys, roles, interceptors, routes, toolsets, rate-limit pricing. Hot-reloaded at runtime.
See sample/ for examples of both files; server/src/main/resources/aidial.settings.json contains the built-in defaults.
Tech Stack
- Java 21, Gradle 8, Lombok (via
io.freefair.lombokplugin) - Eclipse Vert.x 4.5 — async HTTP server/client (event-loop model)
- Apache JClouds — multi-cloud blob storage
- Redisson — Redis client (caching, distributed locks)
- Jackson 2.18 — JSON serialization
- Auth0 java-jwt + jwks-rsa — JWT/JWKS authentication
- Micrometer (Prometheus + OTLP) + OpenTelemetry SDK — metrics & tracing
- JUnit 5 + Mockito 5 + Vert.x JUnit 5 — testing; integration tests start the full stack with embedded Redis and OkHttp
MockWebServerfor upstream simulation - Checkstyle — Google Java Style, 180-char line limit (
checkstyle/checkstyle.xml)
Code Style
Read docs/CODE_STYLE.md before writing or changing Java in this repo. It covers naming, Vert.x event-loop rules, scope discipline, error handling, completing cross-cutting changes, tests, and documentation.
Process: spec-driven with OpenSpec 1.14.3
openspec/specs/ is the behaviour reference for the parts of Core it covers; read the relevant capability before
changing that code. The CLI is not installed globally. Where an OpenSpec skill or doc says openspec, run
npx -y @fission-ai/openspec@1.14.3. openspec/config.yaml holds the project rules the skills and workflows follow.
- Propose:
openspec/changes/<id>/withproposal.md, spec deltas,design.mdandtasks.md, created by/opsx:propose(theopenspec-proposeskill) or thesdd-proposeworkflow. Thennpx -y @fission-ai/openspec@1.14.3 validate <id> --strict. - Apply: implement
tasks.md, ticking each task:/opsx:apply, or thesdd-applyworkflow (implement, an independent verification, a three-lens review, fix). - Record and archive:
review.mdin the change folder, thennpx -y @fission-ai/openspec@1.14.3 archive <id> -y, which merges the deltas intoopenspec/specs; thenvalidate --specs --strict. Then one commit, staging explicit paths.
The workflows in .claude/workflows/ (sdd-baseline for specs of existing behaviour, sdd-propose, sdd-apply, and
sdd-audit after a series of changes) run this with subagents.
Checks (Git Bash, from the repo root)
Gradle 8.10 needs a JDK 21 as JAVA_HOME; a newer default JDK fails with "Unsupported class file major version".
export JAVA_HOME="<path to a JDK 21>"
./gradlew checkstyleMain checkstyleTest
./gradlew :server:test --tests "com.epam.aidial.core.server.SomeApiTest" # the classes the change touches
npx -y @fission-ai/openspec@1.14.3 validate --all --strictRun checkstyle and the targeted test classes locally; the full suite runs in CI after the push.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

