Skip to content

Define LlmProvider trait and core message types #8

@bug-ops

Description

@bug-ops

Description

Define the abstract LLM provider interface and message types that all backends will implement.

Parent: #2

Branch

feat/m1/llm-provider-trait

Files

  • crates/zeph-llm/src/provider.rs — trait + types
  • crates/zeph-llm/src/lib.rs — exports

Key Types

pub enum Role { System, User, Assistant }

pub struct Message {
    pub role: Role,
    pub content: String,
}

pub trait LlmProvider: Send + Sync {
    async fn chat(&self, messages: &[Message]) -> Result<String>;
    fn name(&self) -> &str;
}

Acceptance Criteria

  • Trait compiles with native async (no async-trait crate)
  • Message and Role types with serde Serialize/Deserialize
  • Exported from zeph-llm crate root

Metadata

Metadata

Assignees

No one assigned

    Labels

    M1Milestone 1: Ollama ChatfeatureNew functionalityllmLLM provider related

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions