Skip to content

danielmerja/ollama-phi4-weather

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weather CLI with Ollama & Phi-4 LLM

A command-line interface for getting weather information with natural language processing powered by Ollama and Phi-4 LLM.

Features

  • Natural language queries for weather information
  • AI-powered weather descriptions
  • Detailed weather data including:
    • Temperature and "feels like" temperature
    • Weather conditions
    • Wind speed, direction, and gusts
    • Humidity and pressure
    • Visibility and cloud cover
    • UV index
    • Precipitation chance
  • Clean, formatted terminal output

Prerequisites

  • Go 1.21 or higher
  • Latest Ollama installed and running
  • The phi-4 llm installed via Ollama

Installation

  1. Clone the repository:
git clone https://github.com/danielmerja/ollama-phi4-weather
cd ollama-phi4-weather
  1. Install dependencies:
go mod download
  1. Copy the example environment file:
cp .env.example .env
  1. Update the .env file with your settings

  2. Install the phi model in Ollama:

ollama run phi4

Usage

  1. Start the Ollama server:
ollama serve
  1. Run the CLI:
go run main.go
  1. Ask about the weather using natural language:
> What's the weather like in Miami?
> Is it raining in Seattle right now?
> How's the temperature in New York City?
  1. Type 'quit' to exit

Environment Variables

  • API_KEY: Your API key for authentication
  • RATE_LIMIT: Rate limit for requests (default: 1)
  • PORT: Server port (default: 8080)
  • OLLAMA_URL: Ollama API URL (default: http://localhost:11434/api)
  • OLLAMA_MODEL: Ollama model to use (default: phi4)

License

MIT License

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages