DevSpaces + Continue AI (Granite)

Red Hat OpenShift Dev Spaces provides cloud-native workspaces with Continue AI pre-configured to use IBM Granite 3.1 2B Instruct served by OpenShift AI (KServe + llama.cpp). Developers can generate Apache Camel YAML DSL routes using AI-assisted code generation directly inside the IDE.

Architecture

Component Role

DevSpaces

Cloud-native IDE based on Eclipse Che — runs in OpenShift with pre-installed extensions

Continue AI

Open-source AI coding assistant (VS Code extension) — chat, autocomplete, inline edit

Granite 3.1 2B Instruct

IBM’s small-footprint LLM (Q4_K_M GGUF) running on llama.cpp via KServe

OpenShift AI (KServe)

Model serving platform — hosts the Granite model as an InferenceService with OpenAI-compatible API

Kaoto

Visual designer for Apache Camel routes — edit YAML DSL through drag-and-drop

Workspace Configuration

Devfile

Each workspace is defined by a devfile.yaml that configures the container, extensions, and startup tasks:

schemaVersion: 2.2.2
metadata:
  name: my-camel-cdc-route
components:
  - name: tools
    container:
      image: registry.redhat.io/devspaces/udi-rhel9:latest
      memoryLimit: 2Gi
      cpuLimit: "1"
commands:
  - id: install-extensions
    exec:
      component: tools
      commandLine: |
        export LD_LIBRARY_PATH=/checode/checode-linux-libc/ubi9/ld_libs/openssl:/checode/checode-linux-libc/ubi9/ld_libs/core:/usr/lib64
        CHE_CODE=/checode/checode-linux-libc/ubi9/bin/che-code
        EXT_DIR=/checode/checode-linux-libc/ubi9/extensions
        $CHE_CODE --extensions-dir $EXT_DIR --install-extension redhat.vscode-kaoto --force
        $CHE_CODE --extensions-dir $EXT_DIR --install-extension redhat.vscode-apache-camel --force
        $CHE_CODE --extensions-dir $EXT_DIR --install-extension Continue.continue --force
        $CHE_CODE --extensions-dir $EXT_DIR --install-extension redhat.vscode-yaml --force
        $CHE_CODE --extensions-dir $EXT_DIR --install-extension redhat.java --force
        $CHE_CODE --extensions-dir $EXT_DIR --install-extension redhat.vscode-quarkus --force
  - id: setup-project
    exec:
      component: tools
      commandLine: |
        chmod +x /projects/my-camel-cdc-route/mvnw
        mkdir -p /home/user/.continue && cp /projects/my-camel-cdc-route/continue-config.json /home/user/.continue/config.json
events:
  postStart:
    - install-extensions
    - setup-project
The LD_LIBRARY_PATH must reference the ubi9 subdirectories (ld_libs/openssl and ld_libs/core). The extensions directory is /checode/checode-linux-libc/ubi9/extensions. Using incorrect paths causes silent installation failures.

Pre-installed Extensions

Extension Purpose

redhat.vscode-kaoto

Visual Camel route designer

redhat.vscode-apache-camel

Camel YAML DSL language support

Continue.continue

AI coding assistant

redhat.vscode-yaml

YAML language support

redhat.java

Java language server

redhat.vscode-quarkus

Quarkus development tools

Continue AI Configuration

The continue-config.json file connects Continue to the Granite model served by OpenShift AI:

{
  "models": [
    {
      "title": "Granite 3.1 2B (OpenShift AI)",
      "model": "granite-3.1-2b-instruct-Q4_K_M.gguf",
      "apiBase": "http://granite-llm-predictor.neuroface.svc.cluster.local:8080/v1",
      "provider": "openai",
      "apiKey": "no-key",
      "contextLength": 8192,
      "completionOptions": {
        "maxTokens": 1024
      }
    }
  ],
  "tabAutocompleteModel": {
    "title": "Granite 3.1 2B Autocomplete",
    "model": "granite-3.1-2b-instruct-Q4_K_M.gguf",
    "apiBase": "http://granite-llm-predictor.neuroface.svc.cluster.local:8080/v1",
    "provider": "openai",
    "apiKey": "no-key",
    "contextLength": 8192,
    "completionOptions": {
      "maxTokens": 128
    }
  },
  "allowAnonymousTelemetry": false
}

Model Serving — Granite on llama.cpp

The Granite model runs as a KServe InferenceService with a custom ServingRuntime:

Parameter Value

Model

granite-3.1-2b-instruct-Q4_K_M.gguf

Runtime

ghcr.io/ggml-org/llama.cpp:server

Context size

8192 tokens

Threads

8

Parallel slots

1

API

OpenAI-compatible (/v1/chat/completions)

Endpoint

http://granite-llm-predictor.neuroface.svc.cluster.local:8080

DevSpaces IDE with Continue AI

DevSpaces IDE with Continue AI and Kaoto

The screenshot shows a DevSpaces workspace with the Continue AI panel open on the left side. The AI assistant uses the Granite 3.1 2B model served by OpenShift AI to generate Apache Camel routes.

Creating Camel Routes with AI

Workflow

  1. Create a new file: touch routes/my-new-route.camel.yaml

  2. Open the file in the editor

  3. Press Ctrl+I to open Continue’s inline edit, or use the chat panel

  4. Type a prompt describing the route — use @ to include project context

  5. Continue generates the YAML DSL code directly in the file

  6. Open the file with Kaoto to visualize and refine the route

Using Project Context (@ Providers)

Continue is pre-configured with context providers that give the AI visibility into your project. Type @ in the chat to see available options:

Provider What it does

@File

Include a specific file as context (e.g. the existing CDC route)

@Codebase

Search relevant snippets across the entire project automatically

@Folder

Reference all code from a specific folder (e.g. routes/)

@CurrentFile

Include the file you have open in the editor

@Tree

Show the full project file structure

@Problems

Include current linter errors and warnings from the active file

Using @File routes/cdc-to-mail.camel.yaml before a prompt gives the model a real example of the expected YAML DSL structure and produces much better results.

Prompts for Working with the camel-kaoto Component

The project has a sample route at routes/cdc-to-mail.camel.yaml. Use it as a reference when asking the AI to generate new routes.

Basic — Generate routes from scratch

Prompt What it generates

@File routes/cdc-to-mail.camel.yaml + Create a new Camel YAML route that consumes from Kafka topic "inventory-events", unmarshals JSON, and logs the product name

A Kafka consumer route following the same structure as the existing CDC route

@File routes/cdc-to-mail.camel.yaml + Create a route like this one but consuming from topic "audit-events" and POSTing to http://audit-service:8080/api/events

A Kafka-to-REST route modeled after the existing template

Create a Camel YAML route: timer every 30s, GET http://localhost:8080/q/health, log the response body

A health-check timer route (no Kafka dependency)

Intermediate — Content-based routing and transformations

Prompt What it generates

@File routes/cdc-to-mail.camel.yaml + Add a new when branch for op=d (delete) that logs a warning "Record deleted" and sends to http://alert-service:8080/api/alert

Extends the choice pattern with a delete-operation handler

@Folder routes/ + Create a new route that consumes from Kafka "order-events", uses choice to split by ${body[payload][status]}: "pending" logs info, "failed" POSTs to http://retry-service:8080/retry, otherwise logs warning

A multi-branch content-based router for order processing

@File routes/cdc-to-mail.camel.yaml + Create a similar route but marshal the response as XML instead of JSON before sending

Route with XML marshalling instead of JSON

Advanced — Multi-step integrations

Prompt What it generates

@Codebase + Create a Camel YAML route that: 1) consumes from Kafka "payment-events", 2) unmarshals JSON, 3) enriches with a GET to payload[after][customer_id]}, 4) marshals to JSON, 5) POSTs to http://notification-service:8080/api/notify

A multi-step enrichment pipeline: Kafka → unmarshal → REST enrich → marshal → REST notify

@File routes/cdc-to-mail.camel.yaml + Create a Camel YAML route with error handling: consume from Kafka "transaction-events", unmarshal JSON, try POSTing to http://ledger:8080/api/record, on failure log the error and send to Kafka topic "dead-letter-transactions"

A route with try/catch error handling and dead-letter queue

@File pom.xml + @File routes/cdc-to-mail.camel.yaml + Create a route that reads from Kafka "sensor-data", aggregates 10 messages by ${header.sensorId}, marshals to JSON, and POSTs the batch to http://analytics:8080/api/batch

An aggregation route that batches Kafka messages before sending

Context & Exploration

Prompt What it does

@Codebase + Explain the architecture of this Camel CDC project

Analyzes the project structure, routes, and configuration

@File routes/cdc-to-mail.camel.yaml + Explain step by step what this route does

Provides a detailed walkthrough of each step in the route

@Tree + What Camel routes exist in this project and what do they do?

Lists and describes all routes found in the project

@File src/main/resources/application.properties + What is the route discovery pattern configured?

Explains how Quarkus discovers and loads Camel routes

Keep prompts concise. The Granite 2B model (8192 token context) works best with short, direct instructions. When including files via @File, avoid adding too many large files at once.

Developer Hub Integration

The software template in Developer Hub creates new Camel CDC projects with:

  • Pre-configured devfile.yaml with all extensions

  • continue-config.json pointing to the Granite model

  • Maven wrapper with Quarkus 3.15

  • Sample CDC route (cdc-to-mail.camel.yaml)

  • Correct DevSpaces factory URL for one-click workspace creation

Access Developer Hub: https://developer-hub.

Troubleshooting

Issue Solution

Extensions not visible after workspace start

Reload the browser with F5 — extensions install in postStart and require a page refresh

./mvnw: Permission denied

Run chmod +x mvnw — the devfile’s postStart does this automatically

Continue shows "context size exceeded"

The model’s --ctx-size or --parallel may have been reverted — check the ServingRuntime args in namespace neuroface

Workspace opens with "generateName: empty"

Use the factory URL with the raw devfile: https://devspaces.DOMAIN/#https://gitea.DOMAIN/owner/repo/raw/branch/main/devfile.yaml