> Markdown version of [/videos/989-building-apis-in-the-ai-era](https://www.wearedevelopers.com/videos/989-building-apis-in-the-ai-era). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # Building APIs in the AI Era Are commercial AI assistants compromising your proprietary data? Discover how to securely generate and refine APIs using local, open-source LLMs like Ollama and IBM Granite. - **Speakers:** [Hugo Guerrero](https://www.wearedevelopers.com/@hugo-guerrero) - **Event:** World Congress 2024 - **Published:** August 20, 2024 - **Duration:** 32:28 - **URL:** https://www.wearedevelopers.com/videos/989-building-apis-in-the-ai-era ## Summary The modern AI landscape operates on a fundamental truth: "there is no AI without APIs." While commercial AI coding assistants drastically boost developer productivity, they often introduce exorbitant subscription costs and severe data privacy risks for enterprises. To combat these challenges, development teams can transition to running open-source Large Language Models (LLMs) locally. Using tools like InstructLab and Ollama alongside open-source models like IBM Granite, developers can establish secure, cost-effective local inference servers that keep proprietary data in-house and avoid vendor lock-in. Integrating these local models into everyday workflows requires bridging the gap between the IDE and the inference server. Because many local inference tools expose an OpenAI-compatible API, developers can easily connect extensions like Continue in VS Code directly to their local hardware. This enables a seamless AI-assisted API development cycle. For example, a developer can prompt the local model to generate a complete OpenAPI v3 specification for a RESTful service, apply Spectral linting rules to enforce architectural governance, and then instruct the AI to iteratively fix compliance warnings, such as missing server properties or contact fields. Beyond design and governance, local AI models can accelerate backend implementation, automatically generating boilerplate code and endpoint logic for frameworks like Quarkus. However, because AI lacks total contextual awareness, relying solely on generated code introduces risks. Developers must review and refine AI outputs, manually resolving issues like deprecated package imports. Ultimately, utilizing open-source models guarantees compliance with licensing and datasets, empowering teams to build robust APIs securely and sustainably in the AI era. **Keywords:** local AI inference, open-source LLMs, API development, InstructLab, IBM Granite models, OpenAPI specification, IDE integration, Continue extension, Spectral linting, Quarkus framework, data privacy compliance, prompt engineering, AI code generation, OpenAI API compatibility, enterprise software costs ## Chapters 1. **Understanding the relationship between APIs and AI** (00:03) — Why building and consuming APIs is fundamental to creating modern AI-powered applications. 1. **Benefits of running AI code assistants locally** (02:43) — How running models on local hardware reduces expensive subscription costs and improves data security. 1. **Exploring the API architecture of local inference** (04:54) — How external chat interfaces rely on background API requests and standardized protocols to communicate with inference engines. 1. **Selecting open-source LLMs for code generation** (07:37) — Downloading permissible open-source models like IBM Granite from Hugging Face to avoid legal compliance risks. 1. **Setting up a local AI coding environment** (09:56) — Configuring InstructLab and the Continue extension in VS Code to run a local inference server. 1. **Generating an OpenAPI specification with AI prompts** (13:47) — Using prompt engineering within the IDE to automatically generate OpenAPI YAML files for REST operations. 1. **Validating OpenAPI specifications with Spectral linting** (17:34) — Applying default Spectral rules to identify and fix missing governance properties like server URLs and contact records. 1. **Authoring custom Spectral rules via AI chat** (22:04) — Formulating prompt instructions to generate specific OpenAPI linting rules for enforcing internal organizational standards. 1. **Implementing a Java REST API with Quarkus** (25:00) — Translating an OpenAPI definition into functional Quarkus code and replacing outdated Java dependency imports interactively. 1. **Evaluating the risks of AI code generation** (30:56) — Recognizing the limitations of AI context windows to appropriately mix generated code with reliable predefined SDK tools. ## Related Moments - [Building a community-governed LAMP stack for open AI](https://www.wearedevelopers.com/videos/100065-the-8th-layer-building-the-open-ai-stack-before-it-builds-you) (from "The 8th Layer: Building the Open AI Stack Before It Builds You") - [Exploring AI integrations in modern agile development workflows](https://www.wearedevelopers.com/videos/631-chatgpt-create-a-presentation) (from "ChatGPT: Create a Presentation!") - [Why developers should run AI models locally](https://www.wearedevelopers.com/videos/1597-self-hosted-llms-from-zero-to-inference) (from "Self-Hosted LLMs: From Zero to Inference") - [Exploring open source AI resources and learning paths](https://www.wearedevelopers.com/videos/950-supercharge-your-cloud-native-applications-with-generative-ai) (from "Supercharge your cloud-native applications with Generative AI") - [Designing governed and AI-native API platforms](https://www.wearedevelopers.com/videos/2004-are-your-apis-ready-for-ai-agents) (from "Are Your APIs Ready for AI Agents") - [Developing a containerized AI code assistant locally](https://www.wearedevelopers.com/videos/1593-bootable-ai-containers-with-podman-desktop) (from "Bootable AI Containers with Podman Desktop") ## Related Articles - [MLOps And AI Driven Development](https://www.wearedevelopers.com/magazine/82-mlops-and-ai-driven-development) - [Stephan Gillich - Bringing AI Everywhere](https://www.wearedevelopers.com/magazine/489-stephan-gillich-bringing-ai-everywhere) - [Exploring AI: Opportunities and Risks for Developers](https://www.wearedevelopers.com/magazine/522-exploring-ai-opportunities-and-risks-for-developers) - [How to Use Generative AI to Accelerate Learning to Code](https://www.wearedevelopers.com/magazine/530-how-to-use-generative-ai-to-accelerate-learning-to-code) ## Related Jobs - [AI Software Engineer (Germany)](https://www.wearedevelopers.com/jobs/48317-ai-software-engineer-germany) at **Sunhat** - [Principal Software Engineer, AI Inference Cloud](https://www.wearedevelopers.com/jobs/ext/2854957-principal-software-engineer-ai-inference-cloud) at **ARM** - [Senior AI/ML Engineer](https://www.wearedevelopers.com/jobs/48352-senior-ai-ml-engineer) at **PagerDuty** - [Principal Software Engineer, AI Inference Runtime](https://www.wearedevelopers.com/jobs/ext/2854958-principal-software-engineer-ai-inference-runtime) at **ARM** - [LLM Training Engineer](https://www.wearedevelopers.com/jobs/48420-llm-training-engineer) at **Sciforium** - [Partner Sales Director - AI Alliances - Model Providers](https://www.wearedevelopers.com/jobs/48429-partner-sales-director-ai-alliances-model-providers) at **Dynatrace**