Code Apps overview
Code Apps are Python applications that you write, deploy, and run directly inside DIAL Chat. The platform handles hosting, scaling, and lifecycle management — similar to how cloud providers handle serverless functions. Code Apps are designed for rapid prototyping, POCs, and single-purpose tools.
This page explains how Code Apps work, what they can and cannot do, and when they are the right choice.
How Code Apps work
You write Python code in DIAL Chat's built-in code editor. When you deploy, the platform builds a container from your source code and hosts it on DIAL infrastructure. Users interact with the deployed Code App through the standard chat interface, just like any other DIAL application.
For the services behind this workflow, see App Controller and App Builder Python. The controller runs the image build and Knative deployment; the builder downloads and validates the source project before the image build.
The development cycle is entirely browser-based:
- Create — open the Application Builder in DIAL Chat and select Code App.
- Write code — use the built-in Python editor to write your application. Upload existing source files or start from scratch.
- Configure — set the app name, version, description, attachment types, environment variables, and endpoints.
- Deploy — click Deploy. The platform builds and hosts the container.
- Test — use the app in DIAL Chat or call it through the Unified API.
- Iterate — edit code and click Redeploy to apply changes without downtime.
The runtime environment
Code Apps run in a managed Python environment with access to:
- A curated set of pre-approved Python libraries.
- DIAL Core APIs for calling language models, reading files, and managing state.
- Environment variables that you configure through the UI.
The runtime version is selectable when creating the app. Each runtime provides a specific Python version and a fixed set of available libraries.
Required endpoints
Like all DIAL applications, a Code App must expose a chat completion endpoint:
POST /openai/deployments/<DEPLOYMENT_NAME>/chat/completions
Two additional endpoints are optional:
- Rate endpoint — reports token usage and cost information.
- Configuration endpoint — returns the app's configurable properties.
Security model
Code Apps run under strict security restrictions by design:
- No internet access — Code Apps cannot make outbound network calls to external services.
- Isolated network — all traffic is encrypted, and Code Apps run in a network-isolated environment.
- No cross-app calls — Code Apps cannot call each other or any external endpoint, except DIAL Core (when explicitly allowed).
- No persistent state — there is no local file system or database. State is managed through DIAL APIs only.
- Limited libraries — only pre-approved Python packages are available. Arbitrary
pip installis not supported.
These restrictions exist to ensure that platform-hosted code cannot exfiltrate data, access unauthorized resources, or affect other tenants.
Deployment and lifecycle
Code Apps must be deployed before they can be used. Application owners, administrators, and users with editing rights can manage the deployment lifecycle:
| Action | What it does |
|---|---|
| Deploy | Builds and starts the Code App container. May take a few minutes. The status icon changes from yellow to green when ready. |
| Undeploy | Stops the running container. Required before changing the app name or version. |
| Redeploy | Applies code changes to a running app without downtime. Use this for iterative development. |
Logs are accessible through DIAL Chat (the app's context menu) and the DIAL API.
Sharing and access
Code Apps follow the standard DIAL sharing model:
- Private by default — a new Code App is visible only in the creator's workspace.
- Shareable — grant READ or WRITE access to specific users. WRITE access allows collaborators to edit and redeploy the app.
- Publishable — submit the app to the Catalog for broader access through the standard approval workflow.
Code Apps can also be added as tools in Quick Apps 2.0, enabling no-code workflows to leverage custom Python logic.
When Code Apps are the right choice
Code Apps work well when:
- You need to quickly prototype an idea without setting up infrastructure.
- The app is self-contained and does not need external network access.
- You want to share a working demo with colleagues in minutes.
- The use case fits within the available Python libraries.
Code Apps are not suited for:
- Production workloads with custom dependencies or system libraries.
- Applications that need to call external APIs or services.
- Use cases requiring persistent state outside of DIAL APIs.
- Performance-critical applications that need hardware control (GPUs, specific regions).
For these cases, use a Custom App instead.