Skip to content

sauravsku/DeepSeek-Spring-Integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeepSeek-Spring-Integration 🌐🤖

Spring Boot Java License

A seamless integration of DeepSeek's AI capabilities into Spring Boot applications. Add natural language processing, chatbots, and intelligent text generation to your Java projects with just a few lines of code.

Demo Article: Medium Tutorial
API Documentation: DeepSeek API Docs

Features ✨

  • 🚀 Text generation via DeepSeek's language models
  • 💬 Conversational AI chatbot implementation
  • ⚡ Spring Boot-native configuration
  • 🔒 Secure API key management
  • 📦 Ready-to-deploy REST API endpoints

Prerequisites 📋

Quick Start 🚀

1. Clone the Repository

git clone https://github.com/sauravsku/DeepSeek-Spring-Integration.git
cd DeepSeek-Spring-Integration

2. Configure API Key

Create src/main/resources/application.properties:

deepseek.api.key=your_api_key_here
deepseek.api.url=https://api.deepseek.com/v1/chat/completions

3. Build & Run

mvn spring-boot:run
# or
./gradlew bootRun

Usage Examples 💻

Basic Text Generation

curl -X POST -H "Content-Type: application/json" \
-d '"Explain quantum computing in simple terms"' \
http://localhost:8080/api/ai/generate

Sample Response

{
  "id": "chatcmpl-123",
  "object": "chat.completion",
  "choices": [{
    "message": {
      "role": "assistant",
      "content": "Quantum computing uses quantum bits..."
    }
  }]
}

Project Structure 📂

├── src
│   └── main
│       ├── java
│       │   └── com
│       │       └── deepseek
│       │           ├── config      # Configuration classes
│       │           ├── controller  # REST endpoints
│       │           └── service     # Business logic
│       └── resources
│           └── application.properties
├── LICENSE
└── README.md

Advanced Configuration ⚙️

Custom Model Parameters

# Optional parameters
deepseek.model=deepseek-chat
deepseek.temperature=0.7
deepseek.max_tokens=1000

Enable Request Logging

# Add to application.properties
logging.level.org.apache.http=DEBUG

API Reference 📚

Endpoint Method Description
/api/ai/generate POST Process text generation requests

Request Body Format:

"Your prompt text here"

Contributing 🤝

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License 📄

This project is licensed under the MIT License - see the LICENSE file for details.


Built with ❤️ by Saurav Kumar
GitHub Stars

About

Enable deepseek in your spring applications

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages