GenAI has taken the world by storm. Many of us are enjoying its use daily. Whether it’s for getting advice on virtually any topic, code generation, making images or summarizing a difficult legal text; for many of us living without GenAI has become unthinkable. The most prominent GenAI model, or should I say application, is ChatGPT. However, left and right new companies pop-up that jumped on ChatGPT’s success and have created applications for use cases of their own. As a business owner or AI enthusiast, you may wonder; how would I go about making an AI for my specific use case? Here I’ve listed the five ways you can start implementing AI yourself, ranging from the most difficult to the easiest ways to make an AI.

Building your own model (from scratch)

Difficulty level: *****
Requirements: Full ML stack expertise, infrastructure skills, tons of data.

  1. How it Works:
    1. Train a Generative AI model from scratch using your proprietary data and machine learning frameworks.
    2. Choose architectures like GPT, LLaMA, or custom diffusion models for text, image, or multimodal generation.
  2. When to Use:
    1. You need full control over the model’s architecture and training.
    2. You have ample data, computing resources, and in-house AI expertise.
  3. Example Frameworks:
    1. TensorFlow, PyTorch
  4. Implementation Steps:
    1. Design the model architecture (or adopt an open-source one).
    2. Train the model on GPUs/TPUs using your data.
    3. Deploy the model on cloud platforms or edge devices.

When people see a GenAI business, most would think that they made a model from scratch. However, you’ll come to find that almost all of AI businesses are made through the other methods listed below. This is with good reason. By far the hardest way to get started is training a model from scratch. Building a model from scratch requires you have ample data (e.g. scraping all of the internet), computing sources and in-house AI expertise. However, the reason you’d do this, is when you require full control over the model’s architecture and training, for instance when you need a highly specialized language model for a niche industry requiring a domain-specific dataset.

Another reason would be that you don’t want to be locked-in by any vendor’s base models. When you have the data to build your own model, you’re entirely self-reliant and can adapt and improve performance if you feel that the latest GPT, LLaMA and other models don’t fulfil your purpose.

Finally, pre-trained models are designed to handle general tasks, such as conversational AI, image generation or text generation. If your business needs a specialized solution, such as interpreting multi-modal data (e.g., text and images), a custom model may be necessary.

However, it’s safe to say that for most use cases (and likely yours), you’re not required to have full control over the model’s architecture and training, and find that the benefits of using a pretrained model, by far outweighs the downsides of making your own.

Leveraging Open-source Models

Difficulty level: ***
Requirements: Python, ML frameworks, Cloud Services / deployment.

  1. How it Works:
    1. Download and deploy open-source generative models like GPT variants (OpenAI, EleutherAI), Stable Diffusion, or LLaMA.
    2. Modify or adapt these models for your use case.
  2. When to Use:
    1. You want to avoid ongoing API costs and prefer in-house hosting.
    2. You have moderate resources and technical expertise.
  3. Example Open-source Models:
    1. Hugging Face (BLOOM, GPT-J)
    2. Meta’s LLaMA (for text)
    3. Stable Diffusion (for images)
  4. Implementation Steps:
    1. Set up the model on your infrastructure.
    2. Adapt and fine-tune using your data.
    3. Host it via APIs or integrate it into applications.
    4. Create the architecture to interface with the model (e.g. via API)

Lucky for us, a ton of these powerful pretrained models are free to download from public repositories. For example you can find a ton of models on HuggingFace or download them directly through PyTorch. Aside from generative models such as LLMs or image generation models (including well known ones like LLaMA or GPT models), you can get models for computer vision, text to speech, image to video and much more.

No matter what you choose to use (including making your own model), you need a way for your application or service to interface with the model. This can be done by making a cloud service such as an API and will require a backend engineer to set up the backend (microservice) architecture to make the model usable in your application or service. What is great about this, is that you don’t need a data scientist on your team to set this up. All you need is (a team of) backend developers that are able to feed the input data into the model and return the output.

Using Pre-built APIs

Difficulty level: **
Requirements: API integration, Microservice development, technical infrastructure

  1. How it Works:
    1. Leverage existing Generative AI APIs offered by providers like OpenAI, Google, or AWS.
    2. These APIs give you access to powerful GenAI models for tasks like text generation, image creation, or code completion.
  2. When to Use:
    1. You need a quick and cost-effective solution.
    2. Your use cases don’t require deep customization or proprietary data training.
    3. When you have a use case that doesn’t immediately require a fine-tuned model but also is not covered by any GenAI Service Providers. Example Workbee and ChatGPT written job openings.
  3. Example Providers:
    1. OpenAI (e.g., GPT-4)
    2. Google Cloud’s Vertex AI
    3. AWS Bedrock
  4. Implementation Steps:
    1. Identify your use case (e.g., content generation, summarization).
    2. Integrate the API into your system via SDKs or REST endpoints.
    3. Fine-tune responses with API parameters.

Setting up the infrastructure to interface with an LLM may be challenging for some. Additionally, it may be costly and takes a while to set up. If you want a quick and cost effective way to use the power of ChatGPT for your application you can do so through OpenAI’s API. OpenAI offers an easy to use application programming interface that allows you to use the power of a variety of models ranging from language models (including their latest) to image models and even audio models. However, there are a couple of downsides to the use of OpenAI’s API. Like with any of the AI services, privacy may be an issue. OpenAI’s API may log prompts and completions temporarily for monitoring abuse and improving the model. However, as of recent updates, OpenAI provides options for customers to opt out of such data retention by default for most enterprise plans. The jurisdiction in which OpenAI operates might not align with your local regulations (e.g., GDPR, HIPAA, or CCPA) and OpenAI’s servers may not be located in your region, leading to cross-border data transfer concerns.

However, in most cases this should not be a concern and setting up your AI-powered application through OpenAI’s API is a valid and quick way to get started. For example, for my company Workbee, we implemented automated Job Description optimization through the OpenAI API.

Adapting Pre-trained Models

Difficulty level: ****
Requirements: Fine-tuning, data preparation, ML frameworks.

  1. How it Works:
    1. Use a pre-trained model and fine-tune it with your own data to align it with your specific business needs.
    2. Fine-tuning adjusts the weights of the model using your data while retaining the original training knowledge.
  2. When to Use:
    1. Your business needs specialized outputs (e.g., domain-specific language, tone, or style).
    2. You have proprietary data that can enhance model performance.
  3. Example Frameworks:
    1. Hugging Face Transformers
    2. OpenAI’s fine-tuning options
    3. LangChain for GenAI chaining
  4. Implementation Steps:
    1. Gather and preprocess your proprietary data.
    2. Use the model’s fine-tuning pipeline.
    3. Deploy the fine-tuned model via APIs or locally.

When the LLM that you need has to follow a specific format (e.g. it has to provide text with a certain composition, you want to save tokens because the generic models are too verbose or your model requires specific domain knowledge), you can adapt and fine-tune pretrained models.

By far the most convenient way to fine-tune OpenAI’s LLMs is through OpenAI’s fine-tuning services. It’s inexpensive and the fine-tuning service handles the whole cloud infrastructure for you which saves you time and personnel costs. In short, you compile the data with which you want to finetune the model, train the model with it and then, via API, you can use it as you would any other model. This, however, has a couple of caveats; The data that you feed the model will have to be uploaded to OpenAI and be trained on their servers. This means that if you have any sensitive or proprietary data you’d be sharing that with OpenAI. Once you’ve fine-tuned the model, it will live on OpenAI’s servers. Meaning, in order to interface with it you’ll have to use their API which will continue to cost money and may lead to being locked-in.

If you have the resources to set up training of an LLM yourself you can download any of the freely available LLMs and fine tune that by feeding your data into it on your own cloud infrastructure. You can then easily download the model from your servers and use it anywhere you want, using any infrastructure you need. What’s great about this is that you have all the access and rights to your model, you’re not dependent on OpenAI and can optimize costs so that it fits your business, likely saving money in the long run.

Of course, in both these cases, you have to provide the model with ample data to train the pretrained models with. Soon I’ll provide another blog post with a code example showing you how to effectively fine-tune your LLM.

Partnering with GenAI Solution Providers

Difficulty level: *
Requirements: Minimal coding (depending on the solution)

  1. How it Works:
    1. Collaborate with companies that have developed solutions that you want to integrate into your business (e.g. a chatbot or image generation).
  2. When to Use:
    1. You lack in-house expertise or infrastructure.
    2. You need to have something up and running quickly
    3. You want to first try out whether your users are open to interacting with an AI. Buying a ready made solution can be a good first MVP so you can check out how your users respond to it. If the solution fits, you can always decide to improve the solution by adapting it to your specific use case by fine tuning your own model and building the infrastructure around it yourself.

If you don’t have any development resources, you need an MVP up and running quickly or you want to try it out and see whether your users are open to interacting with an AI you can opt for buying ready made solutions. Today there are a ton of startups that have developed solutions for a wide variety of use cases.

The downside is of course that, in the long run, it may be more expensive to buy a complete solution than to make one of your own. Additionally, depending on how much you’ll build your company on top of the solution provider, you may be locking yourself in to using the solution indefinitely.

Closing remarks

There you have it, these are the 5 ways to get started with GenAI for your business. If you need tailored advice on how to implement AI for your specific case, feel free to drop me a message and I’ll provide you with my insights.