Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A Cloud Foundry buildpack for pushing prompt text that result in Python-based apps.

License

Notifications You must be signed in to change notification settings

funcf/ai-buildpack

Repository files navigation

Cloud Foundry AI Buildpack based on the Python Buildpack

A Cloud Foundry buildpack for pushing prompt text that result in Python based apps.

This buildpack builds upon the official Python buildpack.

Buildpack User Documentation

To push an app you simply need a prompt and an access token to the STACKIT Model Serving Service or another OpenAI-compatible API of you choice.

You have the following options to push an app to Cloud Foundry this way:

  1. Via the following ai.env file:

    CF_APP_SPEC='A web page that allows to do basic math with two numbers.'
    STACKIT_MODEL_SERVING_AUTH_TOKEN='ey...'

    Pushed with: cf push mybasicmath -b 'https://github.com/funcf/ai-buildpack.git'

  2. Via the following Promptfile:

    A web page that allows to do basic math with two numbers.

    and the following manifest.yml:

     ---
     applications:
     - name: mybasicmath
       buildpacks:
       - https://github.com/funcf/ai-buildpack.git
       env:
         STACKIT_MODEL_SERVING_AUTH_TOKEN: ey...

    Pushed with: cf push

  3. Or via the Promptfile:

    A web page that allows to do basic math with two numbers.

    and some more commands:

    cf create-app mybasicmath -b 'https://github.com/funcf/ai-buildpack.git'
    cf set-env mybasicmath STACKIT_MODEL_SERVING_AUTH_TOKEN 'ey...'
    cf push

FAQ

A) Why not pushing just a manifest.yml with all needed environment variables or just a cf push with -b 'https://github.com/funcf/ai-buildpack.git' and the prompt injected as start command with -c 'I need an app to play tic tac toe in the browser.' (the initial idea btw.)?

The current Cloud Foundry implementation will fail if you push no files other than a manifest.yml (because magic AI buildpacks were not there yet ;-)!

B) What model is used and how can I change the model or the model serving service?

Via app environment variable or a separate ai.env file you can change the following default values:

STACKIT_MODEL_SERVING_BASE_URL='https://api.openai-compat.model-serving.eu01.onstackit.cloud/v1'
STACKIT_MODEL_SERVING_MODEL='google/gemma-3-27b-it'

The API Call will be a POST request to: ${STACKIT_MODEL_SERVING_BASE_URL}/chat/completions.

Reporting Issues

Open a GitHub issue on this project here. Or directly reach out to the maintainer via CF Slack.

About

A Cloud Foundry buildpack for pushing prompt text that result in Python-based apps.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published