Skip to content

tashtemirlan/deepseekGo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 DeepSeek Local Skeleton with Go Backend

Welcome to the DeepSeek Local Skeleton project! This is a foundational setup to work with DeepSeek locally and build a Go backend to interact with it. Whether you're experimenting or building a full-fledged application, this skeleton provides the essential structure to get started.


🛠️ Prerequisites

Before diving in, ensure you have the following installed and configured:

  1. Ollama:

    • Download and install Ollama from https://ollama.com/.
    • If you move the Ollama folder, set the PATH environment variable to point to its new location.
    • Set the OLLAMA_MODELS environment variable to specify where your models will be stored.
    • Verify the installation by running:
      ollama --version
  2. DeepSeek Model:

    • Install the DeepSeek model of your choice. You can find models on Hugging Face or the Ollama library.
    • For example, to install the deepseek-r1:8b model, run:
      ollama run deepseek-r1:8b
  3. PostgreSQL:

    • Ensure PostgreSQL is installed and running.
    • Check the status of PostgreSQL:
      pg_ctl status -D <path-to-postgresql>\PostgreSQL\data
    • Start PostgreSQL if it’s not running:
      pg_ctl start -D <path-to-postgresql>\PostgreSQL\data
    • Create the database for the project:
      CREATE DATABASE material_todo_go;

🏗️ Project Structure

Here’s an overview of the project structure:

📂 deepseekBackend
 ├── 📁 controllers    # API controllers (auth, user, notes)
 ├── 📁 models         # Database models (User, Note)
 ├── 📁 database       # Database connection (PostgreSQL)
 ├── 📁 routes         # API route definitions
 ├── 📁 utils          # Utility functions (JWT handling)
 ├── 🌍 main.go        # Entry point of the app
 ├── 📜 go.mod         # Go modules
 ├── 📜 README.md      # Project documentation

🚀 Getting Started

  1. Clone the Repository:
    Clone this repository to your local machine.

  2. Install Dependencies:
    Run the following command to install the required Go dependencies:

    go mod tidy
  3. Configure Environment Variables:
    Set up the necessary environment variables for the database connection, JWT secrets, and Ollama configurations.

  4. Run the Application:
    Start the Go backend by running:

    go run main.go
  5. Test the API:
    Use tools like Postman or cURL to test the API endpoints defined in the routes folder.


☁️ API Endpoint Example

To interact with the DeepSeek model, you can use the following API endpoint:

Start a Chat with DeepSeek

  • Endpoint: POST http://localhost:2626/api/chats/start
  • Request Body:
    {
        "prompt": "How much water should I drink a day?"
    }

Example Request (Postman or cURL):

  • Postman:

    1. Set the request type to POST.
    2. Enter the URL: http://localhost:2626/api/chats/start.
    3. Go to the Body tab, select raw, and choose JSON format.
    4. Paste the JSON payload:
      {
          "prompt": "How much water should I drink a day?"
      }
    5. Click Send to get the response.
  • cURL:

    curl -X POST http://localhost:2626/api/chats/start \
    -H "Content-Type: application/json" \
    -d '{"prompt": "How much water should I drink a day?"}'

Example Response:

{
    "response": "The general recommendation is to drink about 8 glasses (64 ounces) of water per day, but individual needs may vary based on factors like age, weight, activity level, and climate."
}

🧩 Features

  • DeepSeek Integration: Work with DeepSeek models locally using Ollama.
  • PostgreSQL Database: Store and manage data efficiently.
  • RESTful API: Build scalable and maintainable APIs with Go.
  • JWT Authentication: Secure your application with token-based authentication.

📜 License

This project is open-source and available under the MIT License. Feel free to use, modify, and distribute it as needed.


🙌 Contributing

Contributions are welcome! If you have any suggestions, bug reports, or feature requests, please open an issue or submit a pull request.


Happy coding! 🎉
Let’s build something amazing with DeepSeek and Go! 🚀

About

This repository serves as a foundational setup to work with DeepSeek models locally and build a Go backend to interact with them. Whether you're experimenting, learning, or building a full-fledged application, this skeleton provides the essential structure to get started quickly.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages