DeployFrame Docs

AI Services Testing

Validate AI services functionality and credit usage

AI Services Testing

This guide focuses on verifying that the AI services in your platform are functioning correctly and that the credit system is properly tracking usage. We'll test a few representative services to ensure the entire system is working.

Test OCR Service

The Optical Character Recognition (OCR) service is a good first test since it has a clear input/output process and consumes credits.

Access OCR Service

  1. Sign in to your application
  2. Navigate to the OCR service in the services menu
  3. Verify that the service UI loads correctly

Check Initial Credit Balance

Before using the service, note your current credit balance. You'll verify that it decreases after service use.

Upload Test Document

  1. Prepare a simple text document or image containing text
  2. Upload the document through the OCR interface
  3. Submit the document for processing

For testing purposes, a simple PDF or image with a few paragraphs of text is sufficient.

Verify OCR Results

  1. Wait for the OCR processing to complete
  2. Check that the extracted text appears in the results
  3. Verify the accuracy of the text extraction

Verify Credit Deduction

  1. Check your updated credit balance
  2. Confirm that credits were deducted based on the service usage
  3. The deduction should match the credit cost specified for the OCR service

Test Image Generation Service

If your platform includes an image generation service, test it as well:

Access Image Generation Service

  1. Navigate to the image generation service
  2. Verify that the service UI loads correctly

Generate an Image

  1. Enter a text prompt for image generation
  2. Submit the request
  3. Wait for the image to be generated

Verify Results and Credits

  1. Check that the generated image appears and matches your prompt
  2. Verify that the appropriate number of credits were deducted

Verify Usage Tracking

To ensure that the system is properly tracking service usage:

Check Usage History

  1. Navigate to your account dashboard or usage history section
  2. Verify that the services you just used appear in the history
  3. Check that the timestamp, service type, and credit usage are correctly recorded

Verify in AWS DynamoDB (Optional)

For deeper verification:

  1. Open the AWS Console
  2. Navigate to DynamoDB
  3. Find the service usage table (named like ${STAGE}_${APP_NAME}_table_user_credits)
  4. Look for entries matching your user ID
  5. Verify that your service usage is correctly recorded

Next Steps

Now that you've verified the core AI services and credit system functionality, you have successfully tested all the essential components of your AI SaaS platform. Your platform is now ready for use!

If you'd like to enhance your platform with a professional touch, you can optionally proceed to Custom Domain Setup to configure a custom domain for your application.