Skip to content

Together.ai JSON mode and Function Calling #205

@Kolaposki

Description

@Kolaposki

TogetherAI just announced JSON mode and function calling for their models. It currently supports these models: Mixtral, Mistra, and CodeLlama. How do we implement this? Using either Langchain or CrewAI.

This is how I use their model in my agent.

    self.MistralLLM = openai.ChatOpenAI(
        base_url="https://api.together.xyz/v1",
        api_key=os.getenv('TOGETHER_APIKEY'),
        temperature=0.75,
        model="mistralai/Mistral-7B-Instruct-v0.2")

Its hard for these models to follow simple instructions like return JSON and be consistent with it even when you scream at them in the system prompts. Does anyone know how to enforce this or found a hacky way?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions