CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/maven-dev-langchain4j--langchain4j-github-models

This package provides a deprecated integration module that enables Java applications to interact with GitHub Models through the LangChain4j framework. It offers chat models (both synchronous and streaming), embedding models, and support for AI services with tool integration, JSON schema responses, and responsible AI features. The module wraps Azure AI Inference SDK to provide a unified API for accessing various language models hosted on GitHub Models, including chat completion capabilities, embeddings generation, and content filtering management. As of version 1.10.0, this module has been marked for deprecation and future removal, with users recommended to migrate to the langchain4j-openai-official module for enhanced functionality and better integration. The library is designed for reusability as a foundational component in LLM-powered Java applications that need to leverage GitHub-hosted AI models, offering builder patterns for configuration, support for proxy options, custom timeouts, and comprehensive model service versioning capabilities.

Pending

Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

Overview
Eval results
Files

model-names-api.mddocs/api/

Model Names API Reference

Type-safe enumerations for chat and embedding model names.

GitHubModelsChatModelName

package dev.langchain4j.model.github;

public enum GitHubModelsChatModelName {
    // OpenAI GPT
    GPT_4_O,
    GPT_4_O_MINI,

    // Microsoft Phi
    PHI_3_5_MINI_INSTRUCT,
    PHI_3_5_VISION_INSTRUCT,
    PHI_3_MEDIUM_INSTRUCT_128K,
    PHI_3_MEDIUM_INSTRUCT_4K,
    PHI_3_MINI_INSTRUCT_128K,
    PHI_3_MINI_INSTRUCT_4K,
    PHI_3_SMALL_INSTRUCT_128K,
    PHI_3_SMALL_INSTRUCT_8K,

    // AI21 Jamba
    AI21_JAMBA_1_5_LARGE,
    AI21_JAMBA_1_5_MINI,
    AI21_JAMBA_INSTRUCT,

    // Cohere Command
    COHERE_COMMAND_R,
    COHERE_COMMAND_R_PLUS,

    // Meta Llama
    META_LLAMA_3_1_405B_INSTRUCT,
    META_LLAMA_3_1_70B_INSTRUCT,
    META_LLAMA_3_1_8B_INSTRUCT,
    META_LLAMA_3_70B_INSTRUCT,
    META_LLAMA_3_8B_INSTRUCT,

    // Mistral
    MISTRAL_NEMO,
    MISTRAL_LARGE,
    MISTRAL_LARGE_2407,
    MISTRAL_SMALL;

    public String toString();
}

toString

public String toString();

Get model identifier string for API calls.

Returns:

  • String - Model name (e.g., "gpt-4o")

GitHubModelsEmbeddingModelName

package dev.langchain4j.model.github;

public enum GitHubModelsEmbeddingModelName {
    TEXT_EMBEDDING_3_SMALL,
    TEXT_EMBEDDING_3_LARGE,
    COHERE_EMBED_V3_ENGLISH,
    COHERE_EMBED_V3_MULTILINGUAL;

    public String toString();
}

toString

public String toString();

Get model identifier string for API calls.

Returns:

  • String - Model name (e.g., "text-embedding-3-small")

Chat Model Constants

OpenAI GPT Models

GPT_4_O           // "gpt-4o" - Latest GPT-4, vision capable
GPT_4_O_MINI      // "gpt-4o-mini" - Efficient, cost-effective

Microsoft Phi Models

PHI_3_5_MINI_INSTRUCT        // "Phi-3.5-mini-instruct"
PHI_3_5_VISION_INSTRUCT      // "Phi-3.5-vision-instruct" - Vision capable
PHI_3_MEDIUM_INSTRUCT_128K   // "Phi-3-medium-128k-instruct"
PHI_3_MEDIUM_INSTRUCT_4K     // "Phi-3-medium-4k-instruct"
PHI_3_MINI_INSTRUCT_128K     // "Phi-3-mini-128k-instruct"
PHI_3_MINI_INSTRUCT_4K       // "Phi-3-mini-4k-instruct"
PHI_3_SMALL_INSTRUCT_128K    // "Phi-3-small-128k-instruct"
PHI_3_SMALL_INSTRUCT_8K      // "Phi-3-small-8k-instruct"

AI21 Jamba Models

AI21_JAMBA_1_5_LARGE    // "ai21-jamba-1.5-large"
AI21_JAMBA_1_5_MINI     // "ai21-jamba-1.5-mini"
AI21_JAMBA_INSTRUCT     // "ai21-jamba-instruct"

Cohere Command Models

COHERE_COMMAND_R        // "cohere-command-r"
COHERE_COMMAND_R_PLUS   // "cohere-command-r-plus"

Meta Llama Models

META_LLAMA_3_1_405B_INSTRUCT  // "meta-llama-3.1-405b-instruct"
META_LLAMA_3_1_70B_INSTRUCT   // "meta-llama-3.1-70b-instruct"
META_LLAMA_3_1_8B_INSTRUCT    // "meta-llama-3.1-8b-instruct"
META_LLAMA_3_70B_INSTRUCT     // "meta-llama-3-70b-instruct"
META_LLAMA_3_8B_INSTRUCT      // "meta-llama-3-8b-instruct"

Mistral Models

MISTRAL_NEMO         // "Mistral-nemo"
MISTRAL_LARGE        // "Mistral-large"
MISTRAL_LARGE_2407   // "Mistral-large-2407"
MISTRAL_SMALL        // "Mistral-small"

Embedding Model Constants

OpenAI Embedding Models

TEXT_EMBEDDING_3_SMALL   // "text-embedding-3-small" - 1536 dimensions, custom dimensions supported
TEXT_EMBEDDING_3_LARGE   // "text-embedding-3-large" - 3072 dimensions, custom dimensions supported

Cohere Embedding Models

COHERE_EMBED_V3_ENGLISH        // "cohere-embed-v3-english" - 1024 dimensions, English only
COHERE_EMBED_V3_MULTILINGUAL   // "cohere-embed-v3-multilingual" - 1024 dimensions, 100+ languages

Model Dimensions Reference

ModelDefault DimensionsCustom Dimensions
TEXT_EMBEDDING_3_SMALL1536Yes
TEXT_EMBEDDING_3_LARGE3072Yes
COHERE_EMBED_V3_ENGLISH1024No
COHERE_EMBED_V3_MULTILINGUAL1024No

Types

import dev.langchain4j.model.github.GitHubModelsChatModelName;
import dev.langchain4j.model.github.GitHubModelsEmbeddingModelName;

Install with Tessl CLI

npx tessl i tessl/maven-dev-langchain4j--langchain4j-github-models

docs

api

chat-model-api.md

embedding-model-api.md

model-names-api.md

streaming-chat-model-api.md

index.md

quick-reference.md

tile.json